code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
{% extends "tacc_stats_site/base.html" %} {% block content %} <div class="container-fluid"> <h2>Job {{ jobid }} / Type {{ type_name }}</h2> <h4>Rates Aggregated over devices</h4> <div class="graphs"> {{ tscript|safe }} {{ tdiv|safe }} </div> {% if stats_data %} <h4>Counts Aggregated over devices and hosts</h4> <div class="table-responsive"> <table class="table table-condensed table-bordered" style="max-width:100%;"> <thead> <tr><th>record</th>{% for key in schema %} <th>{{key}}</th>{% endfor %}</tr> </thead> <tbody> {% for time, values in stats_data %} <tr><th>{{time}}</th>{% for value in values %}<th>{{ value|stringformat:"0.2e" }} </th> {% endfor %}</tr> {% endfor %} </tbody> </table> </div> {% else %} <h1>Type not found</h1> {% endif %} </div> {% endblock %}
TACC/tacc_stats
tacc_stats/site/machine/templates/machine/type_detail.html
HTML
lgpl-2.1
846
/** * @author Spitfire4466 */ package train.common.blocks.tracks; import net.minecraft.util.IIcon; import train.common.library.TrackIDs; public class BlockSteelTrack extends TrackBaseTraincraft { public BlockSteelTrack() { this.speedController = SpeedControllerSteel.getInstance(); } @Override public TrackIDs getTrackType() { return TrackIDs.STEEL_TRACK; } @Override public IIcon getIcon() { int meta = this.tileEntity.getBlockMetadata(); if (meta >= 6) { return getIcon(1); } return getIcon(0); } @Override public boolean isFlexibleRail() { return true; } }
BlesseNtumble/Traincraft-5
src/main/java/train/common/blocks/tracks/BlockSteelTrack.java
Java
lgpl-2.1
592
package org.yawlfoundation.yawl.elements.predicate; import org.yawlfoundation.yawl.elements.YDecomposition; import org.yawlfoundation.yawl.elements.state.YIdentifier; import java.util.Set; /** * @author Michael Adams * @date 5/12/12 */ public class PredicateEvaluatorCache { private static Set<PredicateEvaluator> _evaluators; public static String process(YDecomposition decomposition, String predicate, YIdentifier token) { PredicateEvaluator evaluator = getEvaluator(predicate); while (evaluator != null) { predicate = evaluator.replace(decomposition, predicate, token); evaluator = getEvaluator(predicate); } return predicate; } public static String substitute(String predicate) { PredicateEvaluator evaluator = getEvaluator(predicate); while (evaluator != null) { predicate = evaluator.substituteDefaults(predicate); evaluator = getEvaluator(predicate); } return predicate; } public static boolean accept(String predicate) { return getEvaluator(predicate) != null; } private static PredicateEvaluator getEvaluator(String predicate) { try { if (_evaluators == null) { _evaluators = PredicateEvaluatorFactory.getInstances(); } for (PredicateEvaluator evaluator : _evaluators) { if (evaluator.accept(predicate)) { return evaluator; } } } catch (Exception e) { // fall through to null } return null; } }
herculeshssj/unirio-ppgi-aspectservice
aspectService/src/org/yawlfoundation/yawl/elements/predicate/PredicateEvaluatorCache.java
Java
lgpl-2.1
1,673
<!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:59 CST 2016 --> <title>Uses of Class org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType (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="Uses of Class org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType (Hibernate JavaDocs)"; } } catch(err) { } //--> </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><a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/hibernate/boot/jaxb/hbm/spi/class-use/JaxbHbmBasicAttributeType.html" target="_top">Frames</a></li> <li><a href="JaxbHbmBasicAttributeType.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> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType" class="title">Uses of Class<br>org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.hibernate.boot.jaxb.hbm.spi">org.hibernate.boot.jaxb.hbm.spi</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.hibernate.boot.model.source.internal.hbm">org.hibernate.boot.model.source.internal.hbm</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.hibernate.boot.jaxb.hbm.spi"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a> in <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/package-summary.html">org.hibernate.boot.jaxb.hbm.spi</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/package-summary.html">org.hibernate.boot.jaxb.hbm.spi</a> that return <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a></code></td> <td class="colLast"><span class="typeNameLabel">ObjectFactory.</span><code><span class="memberNameLink"><a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/ObjectFactory.html#createJaxbHbmBasicAttributeType--">createJaxbHbmBasicAttributeType</a></span>()</code> <div class="block">Create an instance of <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi"><code>JaxbHbmBasicAttributeType</code></a></div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.hibernate.boot.model.source.internal.hbm"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a> in <a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/package-summary.html">org.hibernate.boot.model.source.internal.hbm</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/package-summary.html">org.hibernate.boot.model.source.internal.hbm</a> with parameters of type <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static void</code></td> <td class="colLast"><span class="typeNameLabel">AttributesHelper.</span><code><span class="memberNameLink"><a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/AttributesHelper.html#processBasicAttribute-org.hibernate.boot.model.source.internal.hbm.MappingDocument-org.hibernate.boot.model.source.internal.hbm.AttributesHelper.Callback-org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType-java.lang.String-org.hibernate.boot.model.source.spi.NaturalIdMutability-">processBasicAttribute</a></span>(<a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/MappingDocument.html" title="class in org.hibernate.boot.model.source.internal.hbm">MappingDocument</a>&nbsp;mappingDocument, <a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/AttributesHelper.Callback.html" title="interface in org.hibernate.boot.model.source.internal.hbm">AttributesHelper.Callback</a>&nbsp;callback, <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a>&nbsp;basicAttributeJaxbMapping, <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;logicalTableName, <a href="../../../../../../../org/hibernate/boot/model/source/spi/NaturalIdMutability.html" title="enum in org.hibernate.boot.model.source.spi">NaturalIdMutability</a>&nbsp;naturalIdMutability)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/package-summary.html">org.hibernate.boot.model.source.internal.hbm</a> with parameters of type <a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/BasicAttributeColumnsAndFormulasSource.html#BasicAttributeColumnsAndFormulasSource-org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType-">BasicAttributeColumnsAndFormulasSource</a></span>(<a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a>&nbsp;basicAttributeMapping)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/hibernate/boot/model/source/internal/hbm/BasicAttributePropertySource.html#BasicAttributePropertySource-org.hibernate.boot.jaxb.hbm.spi.JaxbHbmBasicAttributeType-">BasicAttributePropertySource</a></span>(<a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">JaxbHbmBasicAttributeType</a>&nbsp;basicAttributeMapping)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= 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><a href="../../../../../../../org/hibernate/boot/jaxb/hbm/spi/JaxbHbmBasicAttributeType.html" title="class in org.hibernate.boot.jaxb.hbm.spi">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/hibernate/boot/jaxb/hbm/spi/class-use/JaxbHbmBasicAttributeType.html" target="_top">Frames</a></li> <li><a href="JaxbHbmBasicAttributeType.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> <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/boot/jaxb/hbm/spi/class-use/JaxbHbmBasicAttributeType.html
HTML
lgpl-2.1
12,230
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>index</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>index</h1> <!-- Type and Stereotype --> <section style="margin-top: .5em;"> <span class="alert alert-info"> <span class="node-icon _icon-UMLParameter"></span> UMLParameter </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='4dbfae26d501b5fb2413ae4960b470e4.html'><span class='node-icon _icon-UMLClass'></span>DuplicatedChannelBuffer</a></span> <span>::</span> <span class="label label-info"><a href='fd0240a024d0f591d5bc8693649592f1.html'><span class='node-icon _icon-UMLOperation'></span>getShort</a></span> <span>::</span> <span class="label label-info"><a href='86cb0c58ac270c029d2c9dbb1a1708e4.html'><span class='node-icon _icon-UMLParameter'></span>index</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 --> <!-- 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>index</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>type</td> <td>int</td> </tr> <tr> <td>multiplicity</td> <td></td> </tr> <tr> <td>isReadOnly</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>isOrdered</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>isUnique</td> <td><span class='label label-info'>false</span></td> </tr> <tr> <td>defaultValue</td> <td></td> </tr> <tr> <td>direction</td> <td>in</td> </tr> </table> </section> <!-- Tags --> <!-- Constraints, Dependencies, Dependants --> <!-- Relationships --> <!-- Owned Elements --> </div> </body> </html>
jiangbo212/netty-init
html-docs/contents/86cb0c58ac270c029d2c9dbb1a1708e4.html
HTML
lgpl-2.1
7,184
/* GStreamer * Copyright (C) 2015 FIXME <fixme@example.com> * * 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., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef _GST_MPRTPPLAYOUTER_H_ #define _GST_MPRTPPLAYOUTER_H_ #include <gst/gst.h> #include "gstmprtcpbuffer.h" #include "streamjoiner.h" #include <gst/net/gstnetaddressmeta.h> #if GLIB_CHECK_VERSION (2, 35, 7) #include <gio/gnetworking.h> #else /* nicked from gnetworking.h */ #ifdef G_OS_WIN32 #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include <winsock2.h> #undef interface #include <ws2tcpip.h> /* for socklen_t */ #endif /* G_OS_WIN32 */ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif G_BEGIN_DECLS #define GST_TYPE_MPRTPPLAYOUTER (gst_mprtpplayouter_get_type()) #define GST_MPRTPPLAYOUTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MPRTPPLAYOUTER,GstMprtpplayouter)) #define GST_MPRTPPLAYOUTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MPRTPPLAYOUTER,GstMprtpplayouterClass)) #define GST_IS_MPRTPPLAYOUTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPRTPPLAYOUTER)) #define GST_IS_MPRTPPLAYOUTER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPRTPPLAYOUTER)) #define GST_MPRTCP_PLAYOUTER_SENT_BYTES_STRUCTURE_NAME "GstCustomQueryMpRTCPPlayouter" #define GST_MPRTCP_PLAYOUTER_SENT_OCTET_SUM_FIELD "RTCPPlayouterSentBytes" typedef struct _GstMprtpplayouter GstMprtpplayouter; typedef struct _GstMprtpplayouterClass GstMprtpplayouterClass; struct _GstMprtpplayouter { GstElement base_mprtpreceiver; GRWLock rwmutex; guint8 mprtp_ext_header_id; guint8 abs_time_ext_header_id; guint32 pivot_ssrc; guint32 pivot_clock_rate; GSocketAddress *pivot_address; guint8 pivot_address_subflow_id; guint64 clock_base; gboolean auto_flow_riporting; gboolean rtp_passthrough; GstPad *mprtp_srcpad; GstPad *mprtp_sinkpad; GstPad *mprtcp_sr_sinkpad; GstPad *mprtcp_rr_srcpad; gboolean riport_flow_signal_sent; GHashTable *paths; StreamJoiner *joiner; gpointer controller; GstClock* sysclock; guint subflows_num; void (*controller_add_path) (gpointer, guint8, MpRTPRPath *); void (*controller_rem_path) (gpointer, guint8); void (*mprtcp_receiver) (gpointer, GstBuffer *); void (*riport_can_flow) (gpointer); guint32 rtcp_sent_octet_sum; }; struct _GstMprtpplayouterClass { GstElementClass base_mprtpreceiver_class; }; GType gst_mprtpplayouter_get_type (void); G_END_DECLS #endif //_GST_MPRTPPLAYOUTER_H_
froggatt/gst-plugins-good-m
gst/mprtp/gstmprtpplayouter.h
C
lgpl-2.1
3,161
/* 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 "csgeom/math3d.h" #include "csgeom/box.h" #include "nullmesh.h" #include "iengine/movable.h" #include "iengine/rview.h" #include "ivideo/graph3d.h" #include "ivideo/graph2d.h" #include "ivideo/material.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 "csqsqrt.h" csNullmeshMeshObject::csNullmeshMeshObject (csNullmeshMeshFactory* factory, iMeshObjectType* parent) : scfImplementationType(this), nullmesh_type (parent), logparent (0), hitbeam_mesh(0), vis_cb (0) { csNullmeshMeshObject::factory = factory; radius = factory->GetRadius (); factory->GetBoundingBox (box); } csNullmeshMeshObject::~csNullmeshMeshObject () { if (vis_cb) vis_cb->DecRef (); } void csNullmeshMeshObject::SetRadius (float radius) { csNullmeshMeshObject::radius = radius; box.Set (-radius, -radius, -radius, radius, radius, radius); ShapeChanged (); } void csNullmeshMeshObject::SetBoundingBox (const csBox3& box) { csNullmeshMeshObject::box = box; radius = csQsqrt (csSquaredDist::PointPoint (box.Max (), box.Min ())) / 2.0; ShapeChanged (); } const csBox3& csNullmeshMeshObject::GetObjectBoundingBox () { return box; } void csNullmeshMeshObject::SetObjectBoundingBox (const csBox3& bbox) { box = bbox; ShapeChanged (); } bool csNullmeshMeshObject::HitBeamOutline (const csVector3& start, const csVector3& end, csVector3& isect, float* pr) { if(hitbeam_mesh) { return hitbeam_mesh->HitBeamOutline(start, end, isect, pr); } return false; } bool csNullmeshMeshObject::HitBeamObject (const csVector3& start, const csVector3& end, csVector3& isect, float* pr, int* polygon_idx, iMaterialWrapper** mwrap) { if(hitbeam_mesh) { return hitbeam_mesh->HitBeamObject(start, end, isect, pr, polygon_idx, mwrap); } return false; } void csNullmeshMeshObject::GetRadius (float& rad, csVector3& cent) { rad = radius; cent.Set (box.GetCenter ()); } //---------------------------------------------------------------------- csNullmeshMeshFactory::csNullmeshMeshFactory (csNullmeshMeshObjectType* type) : scfImplementationType(this), nullmesh_type (type), collision_data(0) { csVector3 b1 (-1, -1, -1); csVector3 b2 (1, 1, 1); SetBoundingBox (csBox3 (b1, b2)); } void csNullmeshMeshFactory::SetRadius (float radius) { csNullmeshMeshFactory::radius = radius; float r = radius / sqrt (3.0); box.Set (-r, -r, -r, r, r, r); } void csNullmeshMeshFactory::SetBoundingBox (const csBox3& box) { csNullmeshMeshFactory::box = box; radius = csQsqrt (csSquaredDist::PointPoint (box.Max (), box.Min ())) / 2.0; } csPtr<iMeshObject> csNullmeshMeshFactory::NewInstance () { csRef<csNullmeshMeshObject> cm; cm.AttachNew (new csNullmeshMeshObject (this, nullmesh_type)); csRef<iMeshObject> im = scfQueryInterface<iMeshObject> (cm); return csPtr<iMeshObject> (im); } //---------------------------------------------------------------------- SCF_IMPLEMENT_FACTORY (csNullmeshMeshObjectType) csNullmeshMeshObjectType::csNullmeshMeshObjectType (iBase* pParent) : scfImplementationType (this, pParent) { } csNullmeshMeshObjectType::~csNullmeshMeshObjectType () { } csPtr<iMeshObjectFactory> csNullmeshMeshObjectType::NewFactory () { csNullmeshMeshFactory* cm = new csNullmeshMeshFactory (this); csRef<iMeshObjectFactory> ifact ( scfQueryInterface<iMeshObjectFactory> (cm)); cm->DecRef (); return csPtr<iMeshObjectFactory> (ifact); }
crystalspace/CS
plugins/mesh/null/object/nullmesh.cpp
C++
lgpl-2.1
4,590
/** * SaxParser.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /*eslint max-depth:[2, 9] */ /** * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements * and attributes that doesn't fit the schema if the validate setting is enabled. * * @example * var parser = new tinymce.html.SaxParser({ * validate: true, * * comment: function(text) { * console.log('Comment:', text); * }, * * cdata: function(text) { * console.log('CDATA:', text); * }, * * text: function(text, raw) { * console.log('Text:', text, 'Raw:', raw); * }, * * start: function(name, attrs, empty) { * console.log('Start:', name, attrs, empty); * }, * * end: function(name) { * console.log('End:', name); * }, * * pi: function(name, text) { * console.log('PI:', name, text); * }, * * doctype: function(text) { * console.log('DocType:', text); * } * }, schema); * @class tinymce.html.SaxParser * @version 3.4 */ define( 'tinymce.core.html.SaxParser', [ "tinymce.core.html.Schema", "tinymce.core.html.Entities", "tinymce.core.util.Tools" ], function (Schema, Entities, Tools) { var each = Tools.each; var isValidPrefixAttrName = function (name) { return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0; }; /** * Returns the index of the end tag for a specific start tag. This can be * used to skip all children of a parent element from being processed. * * @private * @method findEndTag * @param {tinymce.html.Schema} schema Schema instance to use to match short ended elements. * @param {String} html HTML string to find the end tag in. * @param {Number} startIndex Indext to start searching at should be after the start tag. * @return {Number} Index of the end tag. */ function findEndTag(schema, html, startIndex) { var count = 1, index, matches, tokenRegExp, shortEndedElements; shortEndedElements = schema.getShortEndedElements(); tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g; tokenRegExp.lastIndex = index = startIndex; while ((matches = tokenRegExp.exec(html))) { index = tokenRegExp.lastIndex; if (matches[1] === '/') { // End element count--; } else if (!matches[1]) { // Start element if (matches[2] in shortEndedElements) { continue; } count++; } if (count === 0) { break; } } return index; } /** * Constructs a new SaxParser instance. * * @constructor * @method SaxParser * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. */ function SaxParser(settings, schema) { var self = this; function noop() { } settings = settings || {}; self.schema = schema = schema || new Schema(); if (settings.fix_self_closing !== false) { settings.fix_self_closing = true; } // Add handler functions from settings and setup default handlers each('comment cdata text start end pi doctype'.split(' '), function (name) { if (name) { self[name] = settings[name] || noop; } }); /** * Parses the specified HTML string and executes the callbacks for each item it finds. * * @example * new SaxParser({...}).parse('<b>text</b>'); * @method parse * @param {String} html Html string to sax parse. */ self.parse = function (html) { var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name; var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded; var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns; var attributesRequired, attributesDefault, attributesForced, processHtml; var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0; var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster'); var scriptUriRegExp = /((java|vb)script|mhtml):/i, dataUriRegExp = /^data:/i; function processEndTag(name) { var pos, i; // Find position of parent of the same type pos = stack.length; while (pos--) { if (stack[pos].name === name) { break; } } // Found parent if (pos >= 0) { // Close all the open elements for (i = stack.length - 1; i >= pos; i--) { name = stack[i]; if (name.valid) { self.end(name.name); } } // Remove the open elements from the stack stack.length = pos; } } function parseAttribute(match, name, value, val2, val3) { var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g; name = name.toLowerCase(); value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute // Validate name and value pass through all data- attributes if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) { attrRule = validAttributesMap[name]; // Find rule by pattern matching if (!attrRule && validAttributePatterns) { i = validAttributePatterns.length; while (i--) { attrRule = validAttributePatterns[i]; if (attrRule.pattern.test(name)) { break; } } // No rule matched if (i === -1) { attrRule = null; } } // No attribute rule found if (!attrRule) { return; } // Validate value if (attrRule.validValues && !(value in attrRule.validValues)) { return; } } // Block any javascript: urls or non image data uris if (filteredUrlAttrs[name] && !settings.allow_script_urls) { var uri = value.replace(trimRegExp, ''); try { // Might throw malformed URI sequence uri = decodeURIComponent(uri); } catch (ex) { // Fallback to non UTF-8 decoder uri = unescape(uri); } if (scriptUriRegExp.test(uri)) { return; } if (!settings.allow_html_data_urls && dataUriRegExp.test(uri) && !/^data:image\//i.test(uri)) { return; } } // Add attribute to list and map attrList.map[name] = value; attrList.push({ name: name, value: value }); } // Precompile RegExps and map objects tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)-->)|' + // Comment '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + // End element '(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element ')', 'g'); attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g; // Setup lookup tables for empty elements and boolean attributes shortEndedElements = schema.getShortEndedElements(); selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); fillAttrsMap = schema.getBoolAttrs(); validate = settings.validate; removeInternalElements = settings.remove_internals; fixSelfClosing = settings.fix_self_closing; specialElements = schema.getSpecialElements(); processHtml = html + '>'; while ((matches = tokenRegExp.exec(processHtml))) { // Adds and extra '>' to keep regexps from doing catastrofic backtracking on malformed html // Text if (index < matches.index) { self.text(decode(html.substr(index, matches.index - index))); } if ((value = matches[6])) { // End element value = value.toLowerCase(); // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements if (value.charAt(0) === ':') { value = value.substr(1); } processEndTag(value); } else if ((value = matches[7])) { // Start element // Did we consume the extra character then treat it as text // This handles the case with html like this: "text a<b text" if (matches.index + matches[0].length > html.length) { self.text(decode(html.substr(matches.index))); index = matches.index + matches[0].length; continue; } value = value.toLowerCase(); // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements if (value.charAt(0) === ':') { value = value.substr(1); } isShortEnded = value in shortEndedElements; // Is self closing tag for example an <li> after an open <li> if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) { processEndTag(value); } // Validate element if (!validate || (elementRule = schema.getElementRule(value))) { isValidElement = true; // Grab attributes map and patters when validation is enabled if (validate) { validAttributesMap = elementRule.attributes; validAttributePatterns = elementRule.attributePatterns; } // Parse attributes if ((attribsValue = matches[8])) { isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element // If the element has internal attributes then remove it if we are told to do so if (isInternalElement && removeInternalElements) { isValidElement = false; } attrList = []; attrList.map = {}; attribsValue.replace(attrRegExp, parseAttribute); } else { attrList = []; attrList.map = {}; } // Process attributes if validation is enabled if (validate && !isInternalElement) { attributesRequired = elementRule.attributesRequired; attributesDefault = elementRule.attributesDefault; attributesForced = elementRule.attributesForced; anyAttributesRequired = elementRule.removeEmptyAttrs; // Check if any attribute exists if (anyAttributesRequired && !attrList.length) { isValidElement = false; } // Handle forced attributes if (attributesForced) { i = attributesForced.length; while (i--) { attr = attributesForced[i]; name = attr.name; attrValue = attr.value; if (attrValue === '{$uid}') { attrValue = 'mce_' + idCount++; } attrList.map[name] = attrValue; attrList.push({ name: name, value: attrValue }); } } // Handle default attributes if (attributesDefault) { i = attributesDefault.length; while (i--) { attr = attributesDefault[i]; name = attr.name; if (!(name in attrList.map)) { attrValue = attr.value; if (attrValue === '{$uid}') { attrValue = 'mce_' + idCount++; } attrList.map[name] = attrValue; attrList.push({ name: name, value: attrValue }); } } } // Handle required attributes if (attributesRequired) { i = attributesRequired.length; while (i--) { if (attributesRequired[i] in attrList.map) { break; } } // None of the required attributes where found if (i === -1) { isValidElement = false; } } // Invalidate element if it's marked as bogus if ((attr = attrList.map['data-mce-bogus'])) { if (attr === 'all') { index = findEndTag(schema, html, tokenRegExp.lastIndex); tokenRegExp.lastIndex = index; continue; } isValidElement = false; } } if (isValidElement) { self.start(value, attrList, isShortEnded); } } else { isValidElement = false; } // Treat script, noscript and style a bit different since they may include code that looks like elements if ((endRegExp = specialElements[value])) { endRegExp.lastIndex = index = matches.index + matches[0].length; if ((matches = endRegExp.exec(html))) { if (isValidElement) { text = html.substr(index, matches.index - index); } index = matches.index + matches[0].length; } else { text = html.substr(index); index = html.length; } if (isValidElement) { if (text.length > 0) { self.text(text, true); } self.end(value); } tokenRegExp.lastIndex = index; continue; } // Push value on to stack if (!isShortEnded) { if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) { stack.push({ name: value, valid: isValidElement }); } else if (isValidElement) { self.end(value); } } } else if ((value = matches[1])) { // Comment // Padd comment value to avoid browsers from parsing invalid comments as HTML if (value.charAt(0) === '>') { value = ' ' + value; } if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') { value = ' ' + value; } self.comment(value); } else if ((value = matches[2])) { // CDATA self.cdata(value); } else if ((value = matches[3])) { // DOCTYPE self.doctype(value); } else if ((value = matches[4])) { // PI self.pi(value, matches[5]); } index = matches.index + matches[0].length; } // Text if (index < html.length) { self.text(decode(html.substr(index))); } // Close any open elements for (i = stack.length - 1; i >= 0; i--) { value = stack[i]; if (value.valid) { self.end(value.name); } } }; } SaxParser.findEndTag = findEndTag; return SaxParser; } );
adaptiffdesigns/tinymce
src/core/src/main/js/html/SaxParser.js
JavaScript
lgpl-2.1
16,743
/** edittable 选择人员插件 caratename:chenxihu caratetime:2014-04-06 21:40:00 email:admin@rockoa.com homepage:www.xh829.com */ (function ($) { function _getstyles(){ var s='<style>.changeuserlist div.listsss{padding:10px; background:white;border-bottom:1px #eeeeee solid;cursor:default}.changeuserlist div:active{ background:#f1f1f1}.changeuserbotton{height:30px;width:50px; background:#d9534f;color:white;font-size:14px;border:none;padding:0px;margin:0px;line-height:20px;cursor:default;opacity:1}.changeuserbotton:active{color:white;border:none;opacity:0.8}</style>'; return s; } function chnageuser(sobj, options){ var obj = sobj; var rand = ''+parseInt(Math.random()*9999999)+''; var me = this; this.rand = rand; this._init = function(){ for(var i in options)this[i]=options[i]; this.oveob = false; if(this.showview!='' && get(this.showview))this.oveob=true; if(!this.oveob){ window.onhashchange=function(){ var has = location.hash; if(has.indexOf('#changeuser')==-1)me.hide(); } js.location('#changeuser'); } this.userarr = []; this.deptarr = []; if(isempt(this.changerange) && isempt(this.changerangeno)){ var us = js.getoption('userjson'); if(us)this.userarr = js.decode(us); us = js.getoption('deptjson'); if(us)this.deptarr = js.decode(us); } this.show(); }; this.creatediv=function(){ var type='checkbox'; if(this.changetype.indexOf('check')==-1)type='radio'; this.inputtype = type; $('#changeuser_'+rand+'').remove(); var hei = $(window).height(),jhei=50,atts='position:fixed;'; if(this.oveob){ hei = $('#'+this.showview+'').height(); atts=''; } var s='<div style="'+atts+'z-index:100;width:100%;height:100%;overflow:hidden;left:0px;top:0px; background:white" id="changeuser_'+rand+'">'; if(this.titlebool){ s+='<div style="height:50px;line-height:50px;text-align:center; background:white;border-bottom:1px #cccccc solid"><b>'+this.title+'</b></div>'; jhei+=50; } if(this.changetype.indexOf('user')>=0){ s+='<div style="height:50px;overflow:hidden;border-bottom:1px #cccccc solid"><table width="100%"><tr><td width="100%" height="50"><input id="changekey_'+this.rand+'" placeholder="部门/姓名/职位" style="height:30px;border:none;background:none;width:100%;margin:0px 10px"></td><td><input style="background:none;border:none;color:#666666" class="changeuserbotton" id="changesoubtn_'+this.rand+'" value="查找" type="button" ></td></tr></table></div>'; jhei+=50; } s+='<div style="-webkit-overflow-scrolling:touch;height:'+(hei-jhei)+'px;overflow:auto; background:#f1f1f1" class="changeuserlist">'; s+='<span id="showdiv'+rand+'_0"></span>'; s+='<span id="showdiv'+rand+'_search"></span>'; s+='</div>'; var s3= '<input id="changeboxs_'+rand+'" style="width:18px;height:18px;" align="absmiddle" type="checkbox" >'; if(type!='checkbox1')s3=''; s+='<div style="height:50px;line-height:50px;border-top:1px #cccccc solid" align="right"><table width="100%"><tr><td width="10" nowrap>&nbsp;</td><td width="80%">'+s3+'</td><td><input style="width:70px;border:none" type="button" id="changereload_'+rand+'" class="changeuserbotton" value="刷新数据" ></td><td width="20" nowrap>&nbsp;</td><td><input class="changeuserbotton" type="button" id="changecancl_'+rand+'" value="取消" ></td><td width="20" nowrap>&nbsp;</td><td height="50"><input style="background:#1389D3;" id="changeok_'+rand+'" type="button" value="确定" class="changeuserbotton"></td><td width="10" nowrap>&nbsp;</td></tr></table></div>'; s+=_getstyles(); s+='</div>'; if(atts==''){ $('#'+this.showview+'').html(s); }else{ obj.append(s); } $('#changecancl_'+this.rand+'').click(function(){ me._clickcancel(); }); $('#changereload_'+this.rand+'').click(function(){ me._loaddata(); }); $('#changeok_'+this.rand+'').click(function(){ me.queding(); }); $('#changesoubtn_'+this.rand+'').click(function(){ me._searchkey(true); }); $('#changekey_'+this.rand+'').keydown(function(e){ me._searchkeys(e) }); $('#changeboxs_'+this.rand+'').click(function(){ me._changboxxuan(this) }); }; this.showlist=function(pid,oi){ var type=this.inputtype,hw=24; var a=this.deptarr,len=a.length,i,s='',ssu='',wjj,s2='',sids; var s1='<div style="width:'+(hw*oi)+'px"></div>'; var dob=this.changetype.indexOf('dept')==-1; var uob=this.changetype.indexOf('user')>=0; for(i=0;i<len;i++){ if(a[i].pid==pid){ wjj= 'images/files.png'; if(a[i].ntotal=='0' && uob)wjj= 'images/file.png'; s2 = '<input name="changeuserinput_'+rand+'" xls="d" xname="'+a[i].name+'" xu="'+i+'" value="'+a[i].id+'" style="width:18px;height:18px;" type="'+type+'">'; if(dob)s2=''; if(s2!='' && !this._isdeptcheck(a[i]))s2=''; s+='<div class="listsss">'; s+='<table width="100%"><tr><td>'+s1+'</td><td deptxu="'+i+'_'+oi+'" width="100%"><img align="absmiddle" height="20" height="20" src="'+wjj+'">&nbsp;'+a[i].name+'</td><td>'+s2+'</td></tr></table>'; s+='</div>'; s+='<span show="false" id="showdiv'+rand+'_'+a[i].id+'"></span>'; } } if(uob){ a=this.userarr; len=a.length; for(i=0;i<len;i++){ sids = ','+a[i].deptids+','; if(a[i].deptid==pid || sids.indexOf(','+pid+',')>=0){ ssu+='<div class="listsss">'; ssu+='<table width="100%"><tr><td>'+s1+'</td><td width="100%"><img align="absmiddle" height="24" height="24" src="'+a[i].face+'">&nbsp;'+a[i].name+'<span style="font-size:12px;color:#888888">('+a[i].ranking+')</span></td><td><input name="changeuserinput_'+rand+'" xls="u" xname="'+a[i].name+'" value="'+a[i].id+'" style="width:18px;height:18px;" type="'+type+'"></td></tr></table>'; ssu+='</div>'; } } } $('#showdiv'+rand+'_'+pid+'').html(ssu+s).attr('show','true'); if(pid==0)this.showlist(1, 1); $('#showdiv'+rand+'_0 [deptxu]').unbind('click').click(function(){ me._deptclicks(this); }); }; this._searchkeys=function(e){ clearTimeout(this._searchkeystime); this._searchkeystime=setTimeout(function(){ me._searchkey(false); },500); }; this._isdeptcheck=function(a){ if(this.inputtype=='checkbox' && this.changetype.indexOf('user')>=0 && this.changetype.indexOf('dept')>=0){ var stotal,i,nstotal=0,len=this.userarr.length,spath; stotal = parseFloat(a.stotal); for(i=0;i<len;i++){ spath = this.userarr[i].deptpath; if(spath.indexOf('['+a.id+']')>=0)nstotal++; } return nstotal>=stotal; }else{ return true; } }, this._clickcheckbox=function(o1){ var o = $(o1),xu,a,stotal,i,nstotal=0,len=this.userarr.length,spath; if(o.attr('xls')!='d')return; xu = parseFloat(o.attr('xu')); a = this.deptarr[xu]; stotal = parseFloat(a.stotal); for(i=0;i<len;i++){ spath = this.userarr[i].deptpath; if(spath.indexOf('['+a.id+']')>=0)nstotal++; } if(nstotal<stotal){ o1.checked=false; o1.disabled=true; js.msg('msg','无权选择部门['+a.name+']'); } }, this._searchkey = function(bo){ var key = $('#changekey_'+this.rand+'').val(),s='',a=[],d=[],len,i; a=this.userarr; len=a.length; if(key!='')for(i=0;i<len;i++)if(a[i].name.indexOf(key)>-1 || a[i].pingyin.indexOf(key)==0 || a[i].deptname.indexOf(key)>-1 || a[i].ranking.indexOf(key)>-1)d.push(a[i]); len = d.length; for(i=0;i<len;i++){ s+='<div class="listsss">'; s+='<table width="100%"><tr><td></td><td width="100%"><img align="absmiddle" height="24" height="24" src="'+d[i].face+'">&nbsp;'+d[i].name+'<span style="font-size:12px;color:#888888">('+d[i].ranking+')</span></td><td><input name="changeuserinput_'+rand+'_soukey" xls="u" xname="'+d[i].name+'" value="'+d[i].id+'" style="width:18px;height:18px;" type="'+this.inputtype+'"></td></tr></table>'; s+='</div>'; } if(bo && s=='' && key!='')js.msg('msg','无相关['+key+']的记录', 2); $('#showdiv'+rand+'_search').html(s); var o1 = $('#showdiv'+rand+'_0'); if(s==''){o1.show();}else{o1.hide();} }; this._clickcancel=function(){ if(!this.oveob)history.back(); this.hide(); }; this.hide=function(){ $('#changeuser_'+rand+'').remove(); this.oncancel(); }; this.show=function(){ this.creatediv(); if(this.deptarr.length>0){ this.showlist(0,0); }else{ this._loaddata(); } }; this._deptclicks=function(o){ var sxu = $(o).attr('deptxu').split('_'); var a = this.deptarr[sxu[0]]; var o1 = $('#showdiv'+rand+'_'+a.id+''); var lx = o1.attr('show'); if(lx=='false'){ this.showlist(a.id, parseFloat(sxu[1])+1); }else{ o1.toggle(); } }; this._loaddata=function(){ var o1 = $('#showdiv'+rand+'_0'),url; o1.html('<div align="center" style="padding:30px"><img src="images/mloading.gif"></div>'); var url = 'index.php?a=deptuserjson&m=dept&d=system&ajaxbool=true&changerange='+this.changerange+'&changerangeno='+this.changerangeno+'&gtype=change'; $.getJSON(url, function(ret){ if(ret.code==200){ ret = ret.data; me._loaddatashow(ret); }else{ o1.html(ret.msg); } }); }; this._loaddatashow=function(ret){ if(isempt(this.changerange) && isempt(this.changerangeno)){ js.setoption('deptjson', ret.deptjson); js.setoption('userjson', ret.userjson); js.setoption('groupjson', ret.groupjson); } this.userarr = js.decode(ret.userjson); this.deptarr = js.decode(ret.deptjson); this.showlist(0, 0); }; this._changboxxuan=function(os){ var ns= 'changeuserinput_'+rand+''; if($('#showdiv'+rand+'_search').html()!='')ns+='_soukey'; var ob = os.checked,o=$("input[name='"+ns+"']"),i; for(i=0;i<o.length;i++)o[i].checked=ob; }; this.queding=function(){ var ns= 'changeuserinput_'+rand+''; if($('#showdiv'+rand+'_search').html()!='')ns+='_soukey'; var o = $("input[name='"+ns+"']"); var i,len=o.length,o1,xls,xna,xal,sid='',sna='',ob1=this.changetype.indexOf('dept')==-1,ob2=this.changetype.indexOf('user')==-1; var ob3=ob1 || ob2; for(i=0;i<len;i++){ o1 = $(o[i]); if(o[i].checked){ xls= o1.attr('xls'); xna= o1.attr('xname'); xal= o1.val(); if(ob3)xls=''; sid+=','+xls+''+xal+''; sna+=','+xna+''; } } if(sid!=''){ sid=sid.substr(1); sna=sna.substr(1); } if(this.idobj)this.idobj.value=sid; if(this.nameobj){ this.nameobj.value=sna; this.nameobj.focus(); } this.onselect(sna, sid); this.hide(); } } function selectdata(sobj, options){ var obj = sobj; var rand = ''+parseInt(Math.random()*9999999)+''; var me = this; this.rand = rand; this.ismobile = false; this._init = function(){ for(var i in options)this[i]=options[i]; if(typeof(ismobile) && ismobile==1)this.ismobile = true; this._showcreate(); }; this._showcreate = function(){ var ws = '300px'; if(this.ismobile)ws='90%'; var s='<div style="z-index:1;width:100%;height:100%;overflow:hidden;left:0px;top:0px; background:rgba(0,0,0,0.3);position:fixed;z-index:9" id="selectdata_'+rand+'">'; s+='<div tsid="main" id="mints_'+rand+'" style="position:absolute;top:30%; background:white;width:'+ws+';box-shadow:0px 0px 5px rgba(0,0,0,0.3)">'; s+=' <div onmousedown="js.move(\'mints_'+rand+'\')" style="line-height:40px; background:#2c3e50;color:white;font-size:16px"> &nbsp; &nbsp;'+this.title+'</div>'; s+=' <div style="height:50px;overflow:hidden;border-bottom:1px #cccccc solid"><table width="100%"><tr><td width="100%" height="50"><input id="changekey_'+this.rand+'" placeholder="搜索关键词" style="height:30px;border:none;background:none;width:100%;margin:0px 10px"></td><td><input style="background:none;color:#666666" class="changeuserbotton" id="changesoubtn_'+this.rand+'" value="查找" type="button" ></td></tr></table></div>'; s+=' <div style="-webkit-overflow-scrolling:touch;height:300px;overflow:auto; background:#f1f1f1" id="selectlist_'+rand+'" class="changeuserlist"></div>'; s+=' <div style="height:50px;line-height:50px;border-top:1px #cccccc solid" align="right"><table width="100%"><tr><td width="10" nowrap>&nbsp;</td><td width="80%"><font color="#888888" tsid="count"></font></td><td><input type="button" id="changereload_'+rand+'" class="changeuserbotton" value="刷新" ></td><td width="10" nowrap>&nbsp;</td><td><input class="changeuserbotton" type="button" id="changecancl_'+rand+'" value="取消" ></td><td width="10" nowrap>&nbsp;</td><td height="50"><input style="background:#1389D3;" id="changeok_'+rand+'" type="button" value="确定" class="changeuserbotton"></td><td width="10" nowrap>&nbsp;</td></tr></table></div>'; s+='</div>'; s+='</div>'; s+=_getstyles(); $('body').append(s); this.showdata(this.data); var o = this._getobj('main'); var l = ($(window).width()-o.width())*0.5,t = ($(window).height()-o.height())*0.5; o.css({'left':''+l+'px','top':''+t+'px'}); $('#changecancl_'+this.rand+'').click(function(){ me._clickcancel(); }); $('#changeok_'+this.rand+'').click(function(){ me.queding(); }); $('#changereload_'+this.rand+'').click(function(){ me.loaddata(); }); $('#changesoubtn_'+this.rand+'').click(function(){ me._searchkey(true); }); $('#changekey_'+this.rand+'').keydown(function(e){ me._searchkeys(e) }); $('#changekey_'+this.rand+'').keyup(function(e){ me._searchkeys(e) }); }; this._getobj=function(lx){ var o = $('#selectdata_'+rand+'').find("[tsid='"+lx+"']"); return o; }; this._clickcancel=function(){ this.hide(); }; this.hide=function(){ $('#selectdata_'+rand+'').remove(); this.oncancel(); }; this.queding=function(){ var ns= 'changeuserinput_'+rand+''; var o = $("input[name='"+ns+"']"); var i,len=o.length,o1,xna,xu,xal,sid='',sna='',seld=[]; for(i=0;i<len;i++){ o1 = $(o[i]); if(o[i].checked){ xna= o1.attr('xname'); xu = parseFloat(o1.attr('xu')); if(this.checked){ seld.push(this.nowdata[xu]); }else{ seld=this.nowdata[xu]; } xal= o1.val(); sid+=','+xal+''; sna+=','+xna+''; } } if(sid!=''){ sid=sid.substr(1); sna=sna.substr(1); } if(this.idobj)this.idobj.value=sid; if(this.nameobj){ this.nameobj.value=sna; this.nameobj.focus(); } this.onselect(seld,sna, sid); this.hide(); }; this.showdata=function(a,inb){ if(!a)a=[]; var s='',len=a.length,s1=''; if(len==0){ s='<div align="center" style="margin-top:30px;color:#cccccc;font-size:16px">无记录</div>'; }else{ s = this.showhtml(a); s1='共'+len+'条'; } this._getobj('count').html(s1); var o = $('#selectlist_'+rand+''); o.html(s); if(!inb && len==0)this.loaddata(); }; this.showhtml=function(a){ this.nowdata = a; var i,len=a.length,s='',s2,s1='',atr,oldvel='',d; if(this.nameobj)oldvel=this.nameobj.value; if(this.idobj)oldvel=this.idobj.value; var type='checkbox',ched=''; if(!this.checked)type='radio'; oldvel = ','+oldvel+','; for(i=0;i<len && i<this.maxshow;i++){ ched=''; d = a[i]; if(!isempt(d.value) && oldvel.indexOf(','+d.value+',')>-1)ched='checked'; s2 = '<input xu="'+i+'" '+ched+' name="changeuserinput_'+rand+'" xname="'+d.name+'" value="'+d.value+'" style="width:18px;height:18px;" align="absmiddle" type="'+type+'">'; if(d.disabled)s2=''; atr = ''; if(d.padding)atr='style="padding-left:'+d.padding+'px"'; if(!d.iconswidth)d.iconswidth=18; if(d.iconsimg)s2+=' <img align="absmiddle" src="'+d.iconsimg+'" height="'+d.iconswidth+'" width="'+d.iconswidth+'">'; s+='<div class="listsss" '+atr+'><label>'+s2+'&nbsp;'+d.name+''; if(d.subname)s+='&nbsp;<span style="font-size:12px;color:#888888">('+d.subname+')</span>'; s+='</label></div>'; } return s; }; this.loaddata=function(){ var url = this.url; if(url=='')return; $('#selectlist_'+rand+'').html('<div align="center" style="margin-top:30px"><img src="images/mloading.gif"></div>'); $.getJSON(url, function(a){ me.data = a; me.onloaddata(a); me.showdata(a, true); }); }; this._searchkeys=function(e){ clearTimeout(this._searchkeystime); this._searchkeystime=setTimeout(function(){ me._searchkey(false); },500); }; this._searchkey = function(bo){ var key = $('#changekey_'+this.rand+'').val(),a=[],d=[],d1,len,i,oi=0,s; a=this.data; len=a.length;if(len==0)return; if(key!='')for(i=0;i<len;i++){ d1 = a[i]; if(d1.name.indexOf(key)>-1 || d1.value==key || (d1.subname && d1.subname.indexOf(key)>-1)){ d.push(d1); oi++; if(oi>20)break;//最多显示搜索 } } len = d.length; if(len==0){ s=this.showhtml(this.data); }else{ s=this.showhtml(d); } $('#selectlist_'+rand+'').html(s); if(bo && len==0 && key!='')js.msg('msg','无相关['+key+']的记录', 2); }; } $.fn.chnageuser = function(options){ var defaultVal = { 'title' : '请选择...', 'titlebool':true, 'showview':'', 'changerange':'', //从哪些人员中选择 'changerangeno':'', //不从哪些人选择 'changetype' : 'user', 'idobj':false,'nameobj':false, 'onselect':function(){}, 'oncancel':function(){} }; var can = $.extend({}, defaultVal, options); var funcls = new chnageuser($(this), can); funcls._init(); return funcls; }; $.selectdata = function(options){ var defaultVal = { 'showview': '', 'title' : '请选择...', 'maxshow' : 100, //最多显示防止卡死浏览器 'data' : [], 'url' : '', 'checked' : false, 'idobj' : false, 'nameobj':false, 'onselect': function(){}, 'oncancel': function(){}, 'onloaddata':function(){} }; var can = $.extend({}, defaultVal, options); var funcls = new selectdata(false, can); funcls._init(); return funcls; }; })(jQuery);
holmesian/xinhu-project
web/res/js/jquery-changeuser.js
JavaScript
lgpl-2.1
18,474
# !/bin/python # -*- coding: latin-1 -*- # Copyright (C) 2009-2014 CEA/DEN, EDF R&D # # 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 # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # Hexa : Creation d'hexaedres import hexablock import os #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 doc = hexablock.addDocument ("default") vx = doc.addVector (1,0,0) vy = doc.addVector (0,1,0) vz = doc.addVector (0,0,1) vxy = doc.addVector (1,1,0) nbr_files = 0 # ======================================================= save_vtk def save_vtk () : global nbr_files nom = "monica%d.vtk" % nbr_files nbr_files += 1 doc.saveVtk (nom) # ======================================================= carre def carre (x) : return x*x # ======================================================= get_center def get_center (quad) : px = 0 py = 0 pz = 0 for nv in range (4) : vertex = quad.getVertex (nv) px += vertex.getX() / 4 py += vertex.getY() / 4 pz += vertex.getZ() / 4 return [ px, py, pz ] # ======================================================= nearest def nearest (grid, vertex) : nbre = grid.countVertex() dmin = 1e+6 result = None px = vertex.getX() py = vertex.getY() pz = vertex.getZ() for nro in range (nbre) : v1 = grid.getVertex (nro) d2 = carre(px-v1.getX()) + carre(py-v1.getY()) + carre(pz-v1.getZ()) if (d2 < dmin) : result = v1 dmin = d2 print vertex.getName () , px, py, pz, " -> ", result.getName() return result # ======================================================= nearest_quad def nearest_quad (grid, quad) : dmin = 1e+16 result = None [ox, oy, oz] = get_center (quad) nbre = grid.countQuad () for nro in range (nbre) : q1 = grid.getQuad (nro) if q1 != None : [px, py, pz] = get_center (q1) d2 = carre(px-ox) + carre(py-oy) + carre(pz-oz) if (d2 < dmin) : result = q1 dmin = d2 print quad.getName () , px, py, pz, " -> ", result.getName() return result # ======================================================= insert_cylinder def insert_cylinder (plaque, nx, ny) : hexa = plaque.getHexaIJK (nx, ny, 0) xmin = 666 ; ymin = xmin ; zmin = xmin xmax = -666 ; ymax = xmax ; zmax = xmax tabv1 = [] for nv in range (8) : node = hexa.getVertex (nv) xmin = min (xmin, node.getX()) ; xmax = max (xmax, node.getX()) ymin = min (ymin, node.getY()) ; ymax = max (ymax, node.getY()) zmin = min (zmin, node.getZ()) ; zmax = max (zmax, node.getZ()) tabv1.append (node) doc.removeHexa (hexa) save_vtk () dx = (xmax - xmin)/2 dz = (zmax - zmin)/2 xorig = (xmin + xmax)/2 yorig = (ymin + ymax)/2 zorig = (zmin + zmax)/2 - 3*dz orig = doc.addVertex (xorig, yorig, zorig) nr = 1 na = 4 nh = 3 rext = dx rint = rext/3 haut = 3 angle = 360 pipe = doc.makePipeUni (orig, vxy,vz, rint,rext,angle,haut, nr,na,nh) hexablock.what () tabquad = [] tabv0 = [] for nq in range (4) : quad = pipe.getQuadJK (1, nq, 1) tabquad.append (quad) print " .. tabquad[0] = ", tabquad[0].getName () cible = nearest_quad (plaque, tabquad[0]) tabquad[0]. setColor (5) cible . setColor (5) save_vtk () va1 = tabquad[0].getVertex (0) va2 = tabquad[0].getVertex (1) vb1 = cible.nearestVertex (va1) vb2 = cible.nearestVertex (va2) doc.setLevel (1) doc.joinQuadsUni (tabquad, cible, va1, vb1, va2, vb2, 1) hexablock.what () save_vtk () return doc.setLevel (1) for nv in range (8) : ier = doc.mergeVertices (tabv0[nv], tabv1[nv]) print "ier = ", ier save_vtk () # ======================================================= test_monica def test_monica () : orig = doc.addVertex (0,0,0) lx = 1 ly = lx lz = lx nx = 3 ny = nx nz = 1 plaque = doc.makeCartesianUni (orig, vx,vy,vz, lx, ly, lz, nx,ny,nz) save_vtk () insert_cylinder (plaque, 1, 1) ## hexa = plaque.getHexaIJK (1,1,0) ## doc.removeHexa (hexa) return doc # ================================================================= Begin doc = test_monica () law = doc.addLaw("Uniform", 4) for j in range(doc.countPropagation()): propa = doc.getPropagation(j) propa.setLaw(law) mesh_hexas = hexablock.mesh (doc)
FedoraScientific/salome-hexablock
src/TEST_PY/test_v6/monica.py
Python
lgpl-2.1
5,353
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * 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 */ package eu.europa.esig.dss.pades.validation.suite; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import java.util.List; import java.util.Set; import org.junit.jupiter.api.Test; import eu.europa.esig.dss.diagnostic.DiagnosticData; import eu.europa.esig.dss.enumerations.DigestAlgorithm; import eu.europa.esig.dss.enumerations.EncryptionAlgorithm; import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.model.InMemoryDocument; import eu.europa.esig.dss.pades.validation.PAdESSignature; import eu.europa.esig.dss.validation.AdvancedSignature; import eu.europa.esig.dss.validation.CommonCertificateVerifier; import eu.europa.esig.dss.validation.SignedDocumentValidator; import eu.europa.esig.dss.validation.reports.Reports; public class DSS1420Test { @Test public void testSHA3_0() { DSSDocument dssDocument = new InMemoryDocument(getClass().getResourceAsStream("/validation/dss-1420/PAdES-BpB-att-SHA256-SHA3_256withRSA.pdf")); SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(dssDocument); validator.setCertificateVerifier(new CommonCertificateVerifier()); Reports reports = validator.validateDocument(); List<AdvancedSignature> signatures = validator.getSignatures(); assertEquals(1, signatures.size()); PAdESSignature pades = (PAdESSignature) signatures.get(0); Set<DigestAlgorithm> messageDigestAlgorithms = pades.getMessageDigestAlgorithms(); assertEquals(1, signatures.size()); assertEquals(DigestAlgorithm.SHA256, messageDigestAlgorithms.iterator().next()); assertNotNull(pades.getMessageDigestValue()); assertEquals(EncryptionAlgorithm.RSA, pades.getEncryptionAlgorithm()); assertEquals(DigestAlgorithm.SHA3_256, pades.getDigestAlgorithm()); assertNull(pades.getMaskGenerationFunction()); // reports.print(); DiagnosticData diagnosticData = reports.getDiagnosticData(); assertFalse(diagnosticData.isBLevelTechnicallyValid(diagnosticData.getFirstSignatureId())); } @Test public void testSHA3_1() { DSSDocument dssDocument = new InMemoryDocument(getClass().getResourceAsStream("/validation/dss-1420/PAdES-BpB-att-SHA256-SHA3_224withRSA.pdf")); SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(dssDocument); validator.setCertificateVerifier(new CommonCertificateVerifier()); Reports reports = validator.validateDocument(); List<AdvancedSignature> signatures = validator.getSignatures(); assertEquals(1, signatures.size()); PAdESSignature pades = (PAdESSignature) signatures.get(0); Set<DigestAlgorithm> messageDigestAlgorithms = pades.getMessageDigestAlgorithms(); assertEquals(1, signatures.size()); assertEquals(DigestAlgorithm.SHA256, messageDigestAlgorithms.iterator().next()); assertNotNull(pades.getMessageDigestValue()); assertEquals(EncryptionAlgorithm.RSA, pades.getEncryptionAlgorithm()); assertEquals(DigestAlgorithm.SHA3_224, pades.getDigestAlgorithm()); assertNull(pades.getMaskGenerationFunction()); // reports.print(); DiagnosticData diagnosticData = reports.getDiagnosticData(); assertFalse(diagnosticData.isBLevelTechnicallyValid(diagnosticData.getFirstSignatureId())); } }
openlimit-signcubes/dss
dss-pades/src/test/java/eu/europa/esig/dss/pades/validation/suite/DSS1420Test.java
Java
lgpl-2.1
4,290
/*! \file usbh_int.h \brief USB host mode interrupt handler header file \version 2017-02-10, V1.0.0, firmware for GD32F30x \version 2018-10-10, V1.1.0, firmware for GD32F30x \version 2018-12-25, V2.0.0, firmware for GD32F30x */ /* Copyright (c) 2018, GigaDevice Semiconductor Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. 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 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 USBH_INT_H #define USBH_INT_H #include "usb_core.h" typedef struct { uint8_t (*sof) (usb_core_handle_struct *pudev); uint8_t (*device_connected) (usb_core_handle_struct *pudev); uint8_t (*device_disconnected) (usb_core_handle_struct *pudev); }usbh_hcd_int_cb_struct; extern usbh_hcd_int_cb_struct *usbh_hcd_int_fops; /* function declarations */ /* handle global host interrupt */ uint32_t usbh_isr (usb_core_handle_struct *pudev); #endif /* USBH_INT_H */
prefetchnta/crhack
src/naked/arm-gd32/gd32f30x/usbfs/usbh_int.h
C
lgpl-2.1
2,394
/* * ggit-diff.h * This file is part of libgit2-glib * * Copyright (C) 2012 - Garrett Regier * * libgit2-glib 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. * * libgit2-glib 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 libgit2-glib. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __GGIT_DIFF_H__ #define __GGIT_DIFF_H__ #include <git2.h> #include "ggit-native.h" #include "ggit-types.h" #include "ggit-blob.h" #include "ggit-tree.h" #include "ggit-index.h" #include "ggit-diff-find-options.h" #include "ggit-diff-options.h" #include "ggit-diff-format-email-options.h" G_BEGIN_DECLS #define GGIT_TYPE_DIFF (ggit_diff_get_type ()) G_DECLARE_DERIVABLE_TYPE (GgitDiff, ggit_diff, GGIT, DIFF, GgitNative) /** * GgitDiffClass: * @parent_class: The parent class. * * The class structure for #GgitDiffClass. */ struct _GgitDiffClass { /*< private >*/ GgitNativeClass parent_class; }; GgitDiff *ggit_diff_new_tree_to_tree (GgitRepository *repository, GgitTree *old_tree, GgitTree *new_tree, GgitDiffOptions *diff_options, GError **error); GgitDiff *ggit_diff_new_tree_to_index (GgitRepository *repository, GgitTree *old_tree, GgitIndex *index, GgitDiffOptions *diff_options, GError **error); GgitDiff *ggit_diff_new_index_to_workdir (GgitRepository *repository, GgitIndex *index, GgitDiffOptions *diff_options, GError **error); GgitDiff *ggit_diff_new_tree_to_workdir (GgitRepository *repository, GgitTree *old_tree, GgitDiffOptions *diff_options, GError **error); GgitDiff *ggit_diff_new_buffers (const guint8 *buffer1, gssize buffer1_len, const gchar *buffer1_as_path, const guint8 *buffer2, gssize buffer2_len, const gchar *buffer2_as_path, GgitDiffOptions *diff_options, GError **error); void ggit_diff_merge (GgitDiff *onto, GgitDiff *from, GError **error); void ggit_diff_foreach (GgitDiff *diff, GgitDiffFileCallback file_cb, GgitDiffBinaryCallback binary_cb, GgitDiffHunkCallback hunk_cb, GgitDiffLineCallback line_cb, gpointer *user_data, GError **error); void ggit_diff_print (GgitDiff *diff, GgitDiffFormatType type, GgitDiffLineCallback print_cb, gpointer *user_data, GError **error); gchar *ggit_diff_format_email (GgitDiff *diff, GgitDiffFormatEmailOptions *options, GError **error); gsize ggit_diff_get_num_deltas (GgitDiff *diff); GgitDiffDelta *ggit_diff_get_delta (GgitDiff *diff, gsize index); void ggit_diff_blobs (GgitBlob *old_blob, const gchar *old_as_path, GgitBlob *new_blob, const gchar *new_as_path, GgitDiffOptions *diff_options, GgitDiffFileCallback file_cb, GgitDiffBinaryCallback binary_cb, GgitDiffHunkCallback hunk_cb, GgitDiffLineCallback line_cb, gpointer *user_data, GError **error); void ggit_diff_blob_to_buffer (GgitBlob *old_blob, const gchar *old_as_path, const guint8 *buffer, gssize buffer_len, const gchar *buffer_as_path, GgitDiffOptions *diff_options, GgitDiffFileCallback file_cb, GgitDiffBinaryCallback binary_cb, GgitDiffHunkCallback hunk_cb, GgitDiffLineCallback line_cb, gpointer user_data, GError **error); gboolean ggit_diff_find_similar (GgitDiff *diff, GgitDiffFindOptions *options, GError **error); G_END_DECLS #endif /* __GGIT_DIFF_H__ */ /* ex:set ts=8 noet: */
GNOME/libgit2-glib
libgit2-glib/ggit-diff.h
C
lgpl-2.1
7,673
package org.herac.tuxguitar.app.view.dialog.text; import org.herac.tuxguitar.app.TuxGuitar; import org.herac.tuxguitar.app.ui.TGApplication; import org.herac.tuxguitar.app.view.controller.TGViewContext; import org.herac.tuxguitar.app.view.util.TGDialogUtil; import org.herac.tuxguitar.document.TGDocumentContextAttributes; import org.herac.tuxguitar.editor.action.TGActionProcessor; import org.herac.tuxguitar.editor.action.note.TGInsertTextAction; import org.herac.tuxguitar.editor.action.note.TGRemoveTextAction; import org.herac.tuxguitar.song.models.TGBeat; import org.herac.tuxguitar.ui.UIFactory; import org.herac.tuxguitar.ui.event.UISelectionEvent; import org.herac.tuxguitar.ui.event.UISelectionListener; import org.herac.tuxguitar.ui.layout.UITableLayout; import org.herac.tuxguitar.ui.widget.UIButton; import org.herac.tuxguitar.ui.widget.UILabel; import org.herac.tuxguitar.ui.widget.UILegendPanel; import org.herac.tuxguitar.ui.widget.UIPanel; import org.herac.tuxguitar.ui.widget.UITextField; import org.herac.tuxguitar.ui.widget.UIWindow; import org.herac.tuxguitar.util.TGContext; public class TGTextDialog { public void show(final TGViewContext context) { final TGBeat beat = context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_BEAT); final UIFactory uiFactory = TGApplication.getInstance(context.getContext()).getFactory(); final UIWindow uiParent = context.getAttribute(TGViewContext.ATTRIBUTE_PARENT2); final UITableLayout dialogLayout = new UITableLayout(); final UIWindow dialog = uiFactory.createWindow(uiParent, true, false); dialog.setLayout(dialogLayout); dialog.setText(TuxGuitar.getProperty("text.editor")); UITableLayout groupLayout = new UITableLayout(); UILegendPanel group = uiFactory.createLegendPanel(dialog); group.setLayout(groupLayout); group.setText(TuxGuitar.getProperty("text.insert")); dialogLayout.set(group, 1, 1, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_FILL, true, true, 1, 1, 300f, null, null); final UILabel label = uiFactory.createLabel(group); label.setText(TuxGuitar.getProperty("text.text") + ":"); groupLayout.set(label, 1, 1, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_CENTER, false, true); final UITextField text = uiFactory.createTextField(group); text.setText(beat.getText() != null ? beat.getText().getValue() : new String()); groupLayout.set(text, 1, 2, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_FILL, true, true); //------------------BUTTONS-------------------------- UITableLayout buttonsLayout = new UITableLayout(0f); UIPanel buttons = uiFactory.createPanel(dialog, false); buttons.setLayout(buttonsLayout); dialogLayout.set(buttons, 2, 1, UITableLayout.ALIGN_RIGHT, UITableLayout.ALIGN_FILL, true, true); UIButton buttonOK = uiFactory.createButton(buttons); buttonOK.setDefaultButton(); buttonOK.setText(TuxGuitar.getProperty("ok")); buttonOK.addSelectionListener(new UISelectionListener() { public void onSelect(UISelectionEvent event) { doInsertText(context.getContext(), beat, text.getText()); dialog.dispose(); } }); buttonsLayout.set(buttonOK, 1, 1, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_FILL, true, true, 1, 1, 80f, 25f, null); UIButton buttonClean = uiFactory.createButton(buttons); buttonClean.setText(TuxGuitar.getProperty("clean")); buttonClean.addSelectionListener(new UISelectionListener() { public void onSelect(UISelectionEvent event) { doRemoveText(context.getContext(), beat); dialog.dispose(); } }); buttonsLayout.set(buttonClean, 1, 2, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_FILL, true, true, 1, 1, 80f, 25f, null); UIButton buttonCancel = uiFactory.createButton(buttons); buttonCancel.setText(TuxGuitar.getProperty("cancel")); buttonCancel.addSelectionListener(new UISelectionListener() { public void onSelect(UISelectionEvent event) { dialog.dispose(); } }); buttonsLayout.set(buttonCancel, 1, 3, UITableLayout.ALIGN_FILL, UITableLayout.ALIGN_FILL, true, true, 1, 1, 80f, 25f, null); buttonsLayout.set(buttonCancel, UITableLayout.MARGIN_RIGHT, 0f); TGDialogUtil.openDialog(dialog,TGDialogUtil.OPEN_STYLE_CENTER | TGDialogUtil.OPEN_STYLE_PACK); } public void doInsertText(TGContext context, TGBeat beat, String textValue) { TGActionProcessor tgActionProcessor = new TGActionProcessor(context, TGInsertTextAction.NAME); tgActionProcessor.setAttribute(TGDocumentContextAttributes.ATTRIBUTE_BEAT, beat); tgActionProcessor.setAttribute(TGInsertTextAction.ATTRIBUTE_TEXT_VALUE, textValue); tgActionProcessor.processOnNewThread(); } public void doRemoveText(TGContext context, TGBeat beat) { TGActionProcessor tgActionProcessor = new TGActionProcessor(context, TGRemoveTextAction.NAME); tgActionProcessor.setAttribute(TGDocumentContextAttributes.ATTRIBUTE_BEAT, beat); tgActionProcessor.processOnNewThread(); } }
halfspiral/tuxguitar
TuxGuitar/src/org/herac/tuxguitar/app/view/dialog/text/TGTextDialog.java
Java
lgpl-2.1
4,901
package org.concord.otrunk.test; import java.net.MalformedURLException; import java.util.ArrayList; import org.concord.framework.otrunk.OTObjectService; import org.concord.otrunk.OTrunkImpl; import org.concord.otrunk.datamodel.OTDatabase; import org.concord.otrunk.view.OTViewerHelper; import org.concord.otrunk.xml.XMLDatabase; public class LargeNumberOfInstancesTest { /** * @param args * @throws Exception * @throws MalformedURLException */ public static void main(String[] args) throws MalformedURLException, Exception { // load in the first argument as an otml file // assume the root object is a folder, and then // get the first child of the folder and // copy it and store the copy as the second // object in the folder OTViewerHelper viewerHelper = new OTViewerHelper(); OTDatabase mainDb = new XMLDatabase(); viewerHelper.loadOTrunk(mainDb, null); OTrunkImpl otrunk = (OTrunkImpl)viewerHelper.getOtrunk(); OTObjectService objService = otrunk.getRootObjectService(); ArrayList<OTBasicTestObject> objs = new ArrayList<OTBasicTestObject>(); for(int i=0; i<1000000; i++){ try{ OTBasicTestObject obj = (OTBasicTestObject) objService.createObject(OTBasicTestObject.class); objs.add(obj); } catch (Throwable t){ objs = null; System.err.println("got error creating objects on obj: " + i); t.printStackTrace(); break; } } System.exit(0); } }
concord-consortium/otrunk
src/test/java/org/concord/otrunk/test/LargeNumberOfInstancesTest.java
Java
lgpl-2.1
1,450
/* * Copyright (C) 2008-2021 The QXmpp developers * * Author: * Linus Jahn * * Source: * https://github.com/qxmpp-project/qxmpp * * This file is a part of QXmpp library. * * 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. * */ #ifndef QXMPPBITSOFBINARYCONTENTID_H #define QXMPPBITSOFBINARYCONTENTID_H #include "QXmppGlobal.h" #include <QCryptographicHash> #include <QSharedDataPointer> class QXmppBitsOfBinaryContentIdPrivate; class QXMPP_EXPORT QXmppBitsOfBinaryContentId { public: static QXmppBitsOfBinaryContentId fromCidUrl(const QString &input); static QXmppBitsOfBinaryContentId fromContentId(const QString &input); QXmppBitsOfBinaryContentId(); QXmppBitsOfBinaryContentId(const QXmppBitsOfBinaryContentId &cid); ~QXmppBitsOfBinaryContentId(); QXmppBitsOfBinaryContentId &operator=(const QXmppBitsOfBinaryContentId &other); QString toContentId() const; QString toCidUrl() const; QByteArray hash() const; void setHash(const QByteArray &hash); QCryptographicHash::Algorithm algorithm() const; void setAlgorithm(QCryptographicHash::Algorithm algo); bool isValid() const; static bool isBitsOfBinaryContentId(const QString &uri, bool checkIsCidUrl = false); bool operator==(const QXmppBitsOfBinaryContentId &other) const; private: QSharedDataPointer<QXmppBitsOfBinaryContentIdPrivate> d; }; #endif // QXMPPBITSOFBINARYCONTENTID_H
KangLin/qxmpp
src/base/QXmppBitsOfBinaryContentId.h
C
lgpl-2.1
1,892
#include "mainwindow.h" #include <QApplication> #include <QTranslator> #include <QLocale> int main(int argc, char *argv[]) { QApplication a(argc, argv); QTranslator translator; translator.load(":/" + QLocale::system().name()); a.installTranslator(&translator); QTranslator qtTranslator; qtTranslator.load(":/qt_" + QLocale::system().name()); a.installTranslator(&qtTranslator); MainWindow w; w.show(); return a.exec(); }
xbzmeng/ImageCrop
main.cpp
C++
lgpl-2.1
488
/** * UpDownLatch * Copyright 2011 by Michael Peter Christen, mc@yacy.net, Frankfurt a. M., Germany * First released 16.07.2011 at http://yacy.net * * $LastChangedDate: 2011-05-30 10:53:58 +0200 (Mo, 30 Mai 2011) $ * $LastChangedRevision: 7759 $ * $LastChangedBy: orbiter $ * * 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 in the file lgpl21.txt * If not, see <http://www.gnu.org/licenses/>. */ package net.yacy.cora.sorting; import java.util.concurrent.locks.AbstractQueuedSynchronizer; public class UpDownLatch extends AbstractQueuedSynchronizer { private static final long serialVersionUID = 1L; public UpDownLatch(final int count) { setState(count); } public int getCount() { return getState(); } @Override public int tryAcquireShared(final int acquires) { return getState() == 0? 1 : -1; } @Override public boolean tryReleaseShared(final int releases) { // Decrement count; signal when transition to zero for (;;) { final int c = getState(); if (c == 0) return false; final int nextc = c-1; if (compareAndSetState(c, nextc)) return nextc == 0; } } public void countUp() { for (;;) { final int c = getState(); if (compareAndSetState(c, c + 1)) return; } } public void countDown() { releaseShared(1); } public void await() throws InterruptedException { acquireSharedInterruptibly(1); } }
automenta/kelondro
src/main/java/yacy/cora/sorting/UpDownLatch.java
Java
lgpl-2.1
2,125
/* * 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.jpa.test.lob; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.HashMap; import java.util.Map; import javax.persistence.EntityManager; import org.junit.Test; import org.hibernate.Session; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.RequiresDialectFeature; import static org.junit.Assert.assertTrue; /** * @author Emmanuel Bernard */ @RequiresDialectFeature( DialectChecks.SupportsExpectedLobUsagePattern.class ) public class BlobTest extends BaseEntityManagerFunctionalTestCase { @Test public void testBlobSerialization() throws Exception { EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); Map<String,String> image = new HashMap<String, String>(); image.put( "meta", "metadata" ); image.put( "data", "imagedata" ); ImageReader reader = new ImageReader(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream( baos ); oos.writeObject( image ); reader.setImage( em.unwrap( Session.class ).getLobHelper().createBlob( baos.toByteArray() ) ); em.persist( reader ); em.getTransaction().commit(); em.close(); //useless but y'a know em = getOrCreateEntityManager(); em.getTransaction().begin(); reader = em.find( ImageReader.class, reader.getId() ); ObjectInputStream ois = new ObjectInputStream( reader.getImage().getBinaryStream() ); image = (HashMap<String, String>) ois.readObject(); assertTrue( image.containsKey( "meta" ) ); em.getTransaction().commit(); em.close(); } @Override public Class[] getAnnotatedClasses() { return new Class[] { ImageReader.class }; } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/lob/BlobTest.java
Java
lgpl-2.1
2,030
// ReSharper disable UnusedMember.Global using System.Collections.Generic; namespace CUE.NET.Effects { /// <summary> /// Represents a basic effect-target. /// </summary> /// <typeparam name="T">The type this target represents.</typeparam> public interface IEffectTarget<T> where T : IEffectTarget<T> { #region Properties & Fields /// <summary> /// Gets a list of all active effects of this target. /// </summary> IList<IEffect<T>> Effects { get; } #endregion #region Methods /// <summary> /// Updates all effects added to this target. /// </summary> void UpdateEffects(); /// <summary> /// Adds an affect. /// </summary> /// <param name="effect">The effect to add.</param> void AddEffect(IEffect<T> effect); /// <summary> /// Removes an effect /// </summary> /// <param name="effect">The effect to remove.</param> void RemoveEffect(IEffect<T> effect); #endregion } }
DarthAffe/CUE.NET
Effects/IEffectTarget.cs
C#
lgpl-2.1
1,091
package org.jboss.hal.testsuite.page.config; import org.jboss.arquillian.graphene.Graphene; import org.jboss.arquillian.graphene.page.Location; import org.jboss.hal.testsuite.fragment.config.interfaces.NetworkInterfaceContentFragment; import org.jboss.hal.testsuite.page.ConfigPage; import org.jboss.hal.testsuite.util.PropUtils; import org.openqa.selenium.By; /** * @author mkrajcov <mkrajcov@redhat.com> */ @Location("#interfaces") public class NetworkInterfacesPage extends ConfigPage { private static final By CONTENT = By.id(PropUtils.get("page.content.id")); public NetworkInterfaceContentFragment getContent(){ return Graphene.createPageFragment(NetworkInterfaceContentFragment.class, getContentRoot().findElement(CONTENT)); } }
cypo721/testsuite
src/main/java/org/jboss/hal/testsuite/page/config/NetworkInterfacesPage.java
Java
lgpl-2.1
762
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* Camel * Copyright (C) 1999-2004 Jeffrey Stedfast * * 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 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 Street #330, Boston, MA 02111-1307, USA. */ #ifndef __CAMEL_IMAP4_SPECIALS_H__ #define __CAMEL_IMAP4_SPECIALS_H__ #ifdef __cplusplus extern "C" { #pragma } #endif /* __cplusplus */ enum { IS_ASPECIAL = (1 << 0), IS_CTRL = (1 << 1), IS_LWSP = (1 << 2), IS_QSPECIAL = (1 << 3), IS_SPACE = (1 << 4), IS_WILDCARD = (1 << 5), }; extern unsigned char camel_imap4_specials[256]; #define is_atom(x) ((camel_imap4_specials[(unsigned char)(x)] & (IS_ASPECIAL|IS_SPACE|IS_CTRL|IS_WILDCARD|IS_QSPECIAL)) == 0) #define is_ctrl(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_CTRL) != 0) #define is_lwsp(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_LWSP) != 0) #define is_type(x, t) ((camel_imap4_specials[(unsigned char)(x)] & (t)) != 0) #define is_qsafe(x) ((camel_imap4_specials[(unsigned char)(x)] & (IS_QSPECIAL|IS_CTRL)) == 0) #define is_wild(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_WILDCARD) != 0) void camel_imap4_specials_init (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __CAMEL_IMAP4_SPECIALS_H__ */
community-ssu/evolution-data-server
camel/providers/imap4/camel-imap4-specials.h
C
lgpl-2.1
1,910
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="pl"> <head> <!-- Generated by javadoc (version 1.7.0_71) on Sun Mar 01 23:32:09 CET 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Overview</title> <meta name="date" content="2015-03-01"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Overview"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li class="navBarCell1Rev">Overview</li> <li>Package</li> <li>Class</li> <li><a href="overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="overview-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All 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> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="contentContainer"> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Packages table, listing packages, and an explanation"> <caption><span>Packages</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="modgraf/package-summary.html">modgraf</a></td> <td class="colLast"> <div class="block">Jest to najmniejszy pakiet programu.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="modgraf/action/package-summary.html">modgraf.action</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy odpowiedzialne za wykonywanie pewnych akcji.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="modgraf/algorithm/package-summary.html">modgraf.algorithm</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy odpowiedzialne za wykonywanie algorytmów tj. obliczeń na grafie matematycznym i ich późniejszej prezentacji w warstwie wizualnej.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="modgraf/algorithm/steps/package-summary.html">modgraf.algorithm.steps</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy odpowiedzialne za wykonywanie algorytmów w trybie krokowym.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="modgraf/event/package-summary.html">modgraf.event</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy odpowiedzialne za integrację warstwy wizualnej i matematycznej.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="modgraf/jgrapht/package-summary.html">modgraf.jgrapht</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy i interfejsy uzupełniające bibliotekę JGraphT o obsługę grafów ważonych i podwójnie ważonych.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="modgraf/jgrapht/edge/package-summary.html">modgraf.jgrapht.edge</a></td> <td class="colLast"> <div class="block">Zawiera klasy i interfejsy reprezentujące krawędzie oraz klasy z nimi związane.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="modgraf/view/package-summary.html">modgraf.view</a></td> <td class="colLast"> <div class="block">W tym pakiecie zostały umieszczone klasy zawierające elementy wizualne w tym klasa <a href="modgraf/view/Editor.html" title="class in modgraf.view"><code>Editor</code></a>, która jest najważniejszą klasą w programie.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="modgraf/view/properties/package-summary.html">modgraf.view.properties</a></td> <td class="colLast"> <div class="block">Wszystkie klasy tego pakietu służą do obsługi mechanizmu opcji.</div> </td> </tr> </tbody> </table> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li class="navBarCell1Rev">Overview</li> <li>Package</li> <li>Class</li> <li><a href="overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="overview-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All 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> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
duboti/modgraf
docs/api/overview-summary.html
HTML
lgpl-2.1
6,194
/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2006 - 2017 Hitachi Vantara and Contributors. All rights reserved. */ package org.pentaho.reporting.engine.classic.demo.util; import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.TableColumn; import javax.swing.table.TableModel; /** * The AbstractDemoHandler provides some common implementations that are used by all other demo handlers, and which are * of minor interest for the demo's purposes. * * @author Thomas Morgner */ public abstract class AbstractDemoHandler implements InternalDemoHandler { private DemoController controller; public AbstractDemoHandler() { } protected JComponent createDefaultTable(final TableModel data) { final JTable table = new JTable(data); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); for (int columnIndex = 0; columnIndex < data.getColumnCount(); columnIndex++) { final TableColumn column = table.getColumnModel().getColumn(columnIndex); column.setMinWidth(50); final Class c = data.getColumnClass(columnIndex); if (c.equals(Number.class)) { column.setCellRenderer(new NumberCellRenderer()); } } return new JScrollPane (table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); } public DemoController getController() { return controller; } public void setController(final DemoController controler) { this.controller = controler; } public PreviewHandler getPreviewHandler() { return new DefaultPreviewHandler(this); } }
mbatchelor/pentaho-reporting
engine/demo/src/main/java/org/pentaho/reporting/engine/classic/demo/util/AbstractDemoHandler.java
Java
lgpl-2.1
2,367
using System; using Timok.Rbr.Core.Config; using Timok.Rbr.DTO; namespace Timok.Rbr.BLL.Inventory { [Serializable] public class InventoryCommandRequest { public short ServiceId { get; set; } public short CustomerAcctId { get; set; } public int PinLength { get; set; } public decimal Denomination { get; set; } public InventoryCommand InventoryCommand { get; set; } public bool ActivateOnLoad { get; set; } public BatchDto[] Batches { get; set; } public PersonDto Person { get; set; } public DateTime DateCreated { get; set; } public DateTime DateActive { get; set; } public DateTime DateToExpire { get; set; } public InventoryCommandFilter Filter { get; set; } public InventoryCommandRequest(short pServiceId, short pCustomerAcctId, InventoryCommand pInventoryCommand, PersonDto pPerson, InventoryCommandFilter pFilter) { ServiceId = pServiceId; CustomerAcctId = pCustomerAcctId; InventoryCommand = pInventoryCommand; Person = pPerson; Filter = pFilter; } public InventoryCommandRequest(short pServiceId, short pCustomerAcctId, int pPinLength, decimal pDenomination, InventoryCommand pInventoryCommand, BatchDto[] pBatches, PersonDto pPerson, bool pActivateOnLoad) { ServiceId = pServiceId; CustomerAcctId = pCustomerAcctId; PinLength = pPinLength; Denomination = pDenomination; InventoryCommand = pInventoryCommand; Batches = pBatches; Person = pPerson; ActivateOnLoad = pActivateOnLoad; Filter = InventoryCommandFilter.All; } } [Serializable] public class InventoryExportRequest { public short ServiceId { get; set; } public short CustomerAcctId { get; private set; } public InventoryCommand Command { get; private set; } public PersonDto Person { get; private set; } public InventoryCommandFilter Filter { get; private set; } public InventoryExportRequest(short pServiceId, short pCustomerAcctId, InventoryCommand pCommand, BatchDto[] pSelectedBatches, PersonDto pPerson, InventoryCommandFilter pFilter) { ServiceId = pServiceId; CustomerAcctId = pCustomerAcctId; Command = pCommand; Person = pPerson; Filter = pFilter; } } public enum InventoryCommandFilter { All, Loaded, Active } }
Srdjan/timok.rbr
Rbr/BLL/Inventory/InventoryCommandRequest.cs
C#
lgpl-2.1
2,223
/******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2013 kindsoft.net * * @author Roddy <luolonghao@gmail.com> * @website http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php * @version 4.1.10 (2013-11-23) *******************************************************************************/ (function (window, undefined) { if (window.KindEditor) { return; } if (!window.console) { window.console = {}; } if (!console.log) { console.log = function () {}; } var _VERSION = '4.1.10 (2013-11-23)', _ua = navigator.userAgent.toLowerCase(), _IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1, _NEWIE = _ua.indexOf('msie') == -1 && _ua.indexOf('trident') > -1, _GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1, _WEBKIT = _ua.indexOf('applewebkit') > -1, _OPERA = _ua.indexOf('opera') > -1, _MOBILE = _ua.indexOf('mobile') > -1, _IOS = /ipad|iphone|ipod/.test(_ua), _QUIRKS = document.compatMode != 'CSS1Compat', _IERANGE = !window.getSelection, _matches = /(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(_ua), _V = _matches ? _matches[1] : '0', _TIME = new Date().getTime(); function _isArray(val) { if (!val) { return false; } return Object.prototype.toString.call(val) === '[object Array]'; } function _isFunction(val) { if (!val) { return false; } return Object.prototype.toString.call(val) === '[object Function]'; } function _inArray(val, arr) { for (var i = 0, len = arr.length; i < len; i++) { if (val === arr[i]) { return i; } } return -1; } function _each(obj, fn) { if (_isArray(obj)) { for (var i = 0, len = obj.length; i < len; i++) { if (fn.call(obj[i], i, obj[i]) === false) { break; } } } else { for (var key in obj) { if (obj.hasOwnProperty(key)) { if (fn.call(obj[key], key, obj[key]) === false) { break; } } } } } function _trim(str) { return str.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, ''); } function _inString(val, str, delimiter) { delimiter = delimiter === undefined ? ',' : delimiter; return (delimiter + str + delimiter).indexOf(delimiter + val + delimiter) >= 0; } function _addUnit(val, unit) { unit = unit || 'px'; return val && /^\d+$/.test(val) ? val + unit : val; } function _removeUnit(val) { var match; return val && (match = /(\d+)/.exec(val)) ? parseInt(match[1], 10) : 0; } function _escape(val) { return val.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); } function _unescape(val) { return val.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&amp;/g, '&'); } function _toCamel(str) { var arr = str.split('-'); str = ''; _each(arr, function(key, val) { str += (key > 0) ? val.charAt(0).toUpperCase() + val.substr(1) : val; }); return str; } function _toHex(val) { function hex(d) { var s = parseInt(d, 10).toString(16).toUpperCase(); return s.length > 1 ? s : '0' + s; } return val.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig, function($0, $1, $2, $3) { return '#' + hex($1) + hex($2) + hex($3); } ); } function _toMap(val, delimiter) { delimiter = delimiter === undefined ? ',' : delimiter; var map = {}, arr = _isArray(val) ? val : val.split(delimiter), match; _each(arr, function(key, val) { if ((match = /^(\d+)\.\.(\d+)$/.exec(val))) { for (var i = parseInt(match[1], 10); i <= parseInt(match[2], 10); i++) { map[i.toString()] = true; } } else { map[val] = true; } }); return map; } function _toArray(obj, offset) { return Array.prototype.slice.call(obj, offset || 0); } function _undef(val, defaultVal) { return val === undefined ? defaultVal : val; } function _invalidUrl(url) { return !url || /[<>"]/.test(url); } function _addParam(url, param) { return url.indexOf('?') >= 0 ? url + '&' + param : url + '?' + param; } function _extend(child, parent, proto) { if (!proto) { proto = parent; parent = null; } var childProto; if (parent) { var fn = function () {}; fn.prototype = parent.prototype; childProto = new fn(); _each(proto, function(key, val) { childProto[key] = val; }); } else { childProto = proto; } childProto.constructor = child; child.prototype = childProto; child.parent = parent ? parent.prototype : null; } function _json(text) { var match; if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) { text = match[0]; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } if (/^[\],:{}\s]*$/. test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { return eval('(' + text + ')'); } throw 'JSON parse error'; } var _round = Math.round; var K = { DEBUG : false, VERSION : _VERSION, IE : _IE, GECKO : _GECKO, WEBKIT : _WEBKIT, OPERA : _OPERA, V : _V, TIME : _TIME, each : _each, isArray : _isArray, isFunction : _isFunction, inArray : _inArray, inString : _inString, trim : _trim, addUnit : _addUnit, removeUnit : _removeUnit, escape : _escape, unescape : _unescape, toCamel : _toCamel, toHex : _toHex, toMap : _toMap, toArray : _toArray, undef : _undef, invalidUrl : _invalidUrl, addParam : _addParam, extend : _extend, json : _json }; var _INLINE_TAG_MAP = _toMap('a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'), _BLOCK_TAG_MAP = _toMap('address,applet,blockquote,body,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul'), _SINGLE_TAG_MAP = _toMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,video'), _STYLE_TAG_MAP = _toMap('b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u'), _CONTROL_TAG_MAP = _toMap('img,table,input,textarea,button'), _PRE_TAG_MAP = _toMap('pre,style,script'), _NOSPLIT_TAG_MAP = _toMap('html,head,body,td,tr,table,ol,ul,li'), _AUTOCLOSE_TAG_MAP = _toMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'), _FILL_ATTR_MAP = _toMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'), _VALUE_TAG_MAP = _toMap('input,button,textarea,select'); function _getBasePath() { var els = document.getElementsByTagName('script'), src; for (var i = 0, len = els.length; i < len; i++) { src = els[i].src || ''; if (/kindeditor[\w\-\.]*\.js/.test(src)) { return src.substring(0, src.lastIndexOf('/') + 1); } } return ''; } K.basePath = _getBasePath(); //add by tinfu:use in video_url K.rootPath = "http://"+ document.domain; K.options = { designMode : true, fullscreenMode : false, filterMode : true, wellFormatMode : true, shadowMode : true, loadStyleMode : true, basePath : K.basePath, themesPath : K.basePath + 'themes/', langPath : K.basePath + 'lang/', pluginsPath : K.basePath + 'plugins/', themeType : 'default', langType : 'zh_CN', urlType : '', newlineTag : 'p', resizeType : 2, syncType : 'form', pasteType : 2, dialogAlignType : 'page', useContextmenu : true, fullscreenShortcut : false, bodyClass : 'ke-content', indentChar : '\t', cssPath : '', cssData : '', minWidth : 300, minHeight : 100, minChangeSize : 50, zIndex : 811213, items : [ 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage', 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'anchor', 'link', 'unlink', '|', 'about' ], noDisableItems : ['source', 'fullscreen'], colorTable : [ ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] ], fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'], htmlTags : { font : ['id', 'class', 'color', 'size', 'face', '.background-color'], span : [ 'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background', '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height' ], div : [ 'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', '.background', '.font-style', '.text-decoration', '.vertical-align', '.margin-left', "style" ], table: [ 'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor', '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background', '.width', '.height', '.border-collapse' ], 'td,th': [ 'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.background', '.border' ], a : ['id', 'class', 'href', 'target', 'name'], embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'], 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [ 'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background', '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left' ], pre : ['id', 'class'], hr : ['id', 'class', '.page-break-after'], 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : ['id', 'class'], iframe : ['id', 'class', 'src', 'frameborder', 'width', 'height', '.width', '.height'], //add by tinfu script : ['type', "src"] }, layout : '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>' }; var _useCapture = false; var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222'); var _CURSORMOVE_KEY_MAP = _toMap('33..40'); var _CHANGE_KEY_MAP = {}; _each(_INPUT_KEY_MAP, function(key, val) { _CHANGE_KEY_MAP[key] = val; }); _each(_CURSORMOVE_KEY_MAP, function(key, val) { _CHANGE_KEY_MAP[key] = val; }); function _bindEvent(el, type, fn) { if (el.addEventListener){ el.addEventListener(type, fn, _useCapture); } else if (el.attachEvent){ el.attachEvent('on' + type, fn); } } function _unbindEvent(el, type, fn) { if (el.removeEventListener){ el.removeEventListener(type, fn, _useCapture); } else if (el.detachEvent){ el.detachEvent('on' + type, fn); } } var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' + 'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' + 'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(','); function KEvent(el, event) { this.init(el, event); } _extend(KEvent, { init : function(el, event) { var self = this, doc = el.ownerDocument || el.document || el; self.event = event; _each(_EVENT_PROPS, function(key, val) { self[val] = event[val]; }); if (!self.target) { self.target = self.srcElement || doc; } if (self.target.nodeType === 3) { self.target = self.target.parentNode; } if (!self.relatedTarget && self.fromElement) { self.relatedTarget = self.fromElement === self.target ? self.toElement : self.fromElement; } if (self.pageX == null && self.clientX != null) { var d = doc.documentElement, body = doc.body; self.pageX = self.clientX + (d && d.scrollLeft || body && body.scrollLeft || 0) - (d && d.clientLeft || body && body.clientLeft || 0); self.pageY = self.clientY + (d && d.scrollTop || body && body.scrollTop || 0) - (d && d.clientTop || body && body.clientTop || 0); } if (!self.which && ((self.charCode || self.charCode === 0) ? self.charCode : self.keyCode)) { self.which = self.charCode || self.keyCode; } if (!self.metaKey && self.ctrlKey) { self.metaKey = self.ctrlKey; } if (!self.which && self.button !== undefined) { self.which = (self.button & 1 ? 1 : (self.button & 2 ? 3 : (self.button & 4 ? 2 : 0))); } switch (self.which) { case 186 : self.which = 59; break; case 187 : case 107 : case 43 : self.which = 61; break; case 189 : case 45 : self.which = 109; break; case 42 : self.which = 106; break; case 47 : self.which = 111; break; case 78 : self.which = 110; break; } if (self.which >= 96 && self.which <= 105) { self.which -= 48; } }, preventDefault : function() { var ev = this.event; if (ev.preventDefault) { ev.preventDefault(); } else { ev.returnValue = false; } }, stopPropagation : function() { var ev = this.event; if (ev.stopPropagation) { ev.stopPropagation(); } else { ev.cancelBubble = true; } }, stop : function() { this.preventDefault(); this.stopPropagation(); } }); var _eventExpendo = 'kindeditor_' + _TIME, _eventId = 0, _eventData = {}; function _getId(el) { return el[_eventExpendo] || null; } function _setId(el) { el[_eventExpendo] = ++_eventId; return _eventId; } function _removeId(el) { try { delete el[_eventExpendo]; } catch(e) { if (el.removeAttribute) { el.removeAttribute(_eventExpendo); } } } function _bind(el, type, fn) { if (type.indexOf(',') >= 0) { _each(type.split(','), function() { _bind(el, this, fn); }); return; } var id = _getId(el); if (!id) { id = _setId(el); } if (_eventData[id] === undefined) { _eventData[id] = {}; } var events = _eventData[id][type]; if (events && events.length > 0) { _unbindEvent(el, type, events[0]); } else { _eventData[id][type] = []; _eventData[id].el = el; } events = _eventData[id][type]; if (events.length === 0) { events[0] = function(e) { var kevent = e ? new KEvent(el, e) : undefined; _each(events, function(i, event) { if (i > 0 && event) { event.call(el, kevent); } }); }; } if (_inArray(fn, events) < 0) { events.push(fn); } _bindEvent(el, type, events[0]); } function _unbind(el, type, fn) { if (type && type.indexOf(',') >= 0) { _each(type.split(','), function() { _unbind(el, this, fn); }); return; } var id = _getId(el); if (!id) { return; } if (type === undefined) { if (id in _eventData) { _each(_eventData[id], function(key, events) { if (key != 'el' && events.length > 0) { _unbindEvent(el, key, events[0]); } }); delete _eventData[id]; _removeId(el); } return; } if (!_eventData[id]) { return; } var events = _eventData[id][type]; if (events && events.length > 0) { if (fn === undefined) { _unbindEvent(el, type, events[0]); delete _eventData[id][type]; } else { _each(events, function(i, event) { if (i > 0 && event === fn) { events.splice(i, 1); } }); if (events.length == 1) { _unbindEvent(el, type, events[0]); delete _eventData[id][type]; } } var count = 0; _each(_eventData[id], function() { count++; }); if (count < 2) { delete _eventData[id]; _removeId(el); } } } function _fire(el, type) { if (type.indexOf(',') >= 0) { _each(type.split(','), function() { _fire(el, this); }); return; } var id = _getId(el); if (!id) { return; } var events = _eventData[id][type]; if (_eventData[id] && events && events.length > 0) { events[0](); } } function _ctrl(el, key, fn) { var self = this; key = /^\d{2,}$/.test(key) ? key : key.toUpperCase().charCodeAt(0); _bind(el, 'keydown', function(e) { if (e.ctrlKey && e.which == key && !e.shiftKey && !e.altKey) { fn.call(el); e.stop(); } }); } var _readyFinished = false; function _ready(fn) { if (_readyFinished) { fn(KindEditor); return; } var loaded = false; function readyFunc() { if (!loaded) { loaded = true; fn(KindEditor); _readyFinished = true; } } function ieReadyFunc() { if (!loaded) { try { document.documentElement.doScroll('left'); } catch(e) { setTimeout(ieReadyFunc, 100); return; } readyFunc(); } } function ieReadyStateFunc() { if (document.readyState === 'complete') { readyFunc(); } } if (document.addEventListener) { _bind(document, 'DOMContentLoaded', readyFunc); } else if (document.attachEvent) { _bind(document, 'readystatechange', ieReadyStateFunc); var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if (document.documentElement.doScroll && toplevel) { ieReadyFunc(); } } _bind(window, 'load', readyFunc); } if (_IE) { window.attachEvent('onunload', function() { _each(_eventData, function(key, events) { if (events.el) { _unbind(events.el); } }); }); } K.ctrl = _ctrl; K.ready = _ready; function _getCssList(css) { var list = {}, reg = /\s*([\w\-]+)\s*:([^;]*)(;|$)/g, match; while ((match = reg.exec(css))) { var key = _trim(match[1].toLowerCase()), val = _trim(_toHex(match[2])); list[key] = val; } return list; } function _getAttrList(tag) { var list = {}, reg = /\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g, match; while ((match = reg.exec(tag))) { var key = (match[1] || match[2] || match[4] || match[6]).toLowerCase(), val = (match[2] ? match[3] : (match[4] ? match[5] : match[7])) || ''; list[key] = val; } return list; } function _addClassToTag(tag, className) { if (/\s+class\s*=/.test(tag)) { tag = tag.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/, function($0, $1, $2, $3) { if ((' ' + $2 + ' ').indexOf(' ' + className + ' ') < 0) { return $2 === '' ? $1 + className + $3 : $1 + $2 + ' ' + className + $3; } else { return $0; } }); } else { tag = tag.substr(0, tag.length - 1) + ' class="' + className + '">'; } return tag; } function _formatCss(css) { var str = ''; _each(_getCssList(css), function(key, val) { str += key + ':' + val + ';'; }); return str; } function _formatUrl(url, mode, host, pathname) { mode = _undef(mode, '').toLowerCase(); if (url.substr(0, 5) != 'data:') { url = url.replace(/([^:])\/\//g, '$1/'); } if (_inArray(mode, ['absolute', 'relative', 'domain']) < 0) { return url; } host = host || location.protocol + '//' + location.host; if (pathname === undefined) { var m = location.pathname.match(/^(\/.*)\//); pathname = m ? m[1] : ''; } var match; if ((match = /^(\w+:\/\/[^\/]*)/.exec(url))) { if (match[1] !== host) { return url; } } else if (/^\w+:/.test(url)) { return url; } function getRealPath(path) { var parts = path.split('/'), paths = []; for (var i = 0, len = parts.length; i < len; i++) { var part = parts[i]; if (part == '..') { if (paths.length > 0) { paths.pop(); } } else if (part !== '' && part != '.') { paths.push(part); } } return '/' + paths.join('/'); } if (/^\//.test(url)) { url = host + getRealPath(url.substr(1)); } else if (!/^\w+:\/\//.test(url)) { url = host + getRealPath(pathname + '/' + url); } function getRelativePath(path, depth) { if (url.substr(0, path.length) === path) { var arr = []; for (var i = 0; i < depth; i++) { arr.push('..'); } var prefix = '.'; if (arr.length > 0) { prefix += '/' + arr.join('/'); } if (pathname == '/') { prefix += '/'; } return prefix + url.substr(path.length); } else { if ((match = /^(.*)\//.exec(path))) { return getRelativePath(match[1], ++depth); } } } if (mode === 'relative') { url = getRelativePath(host + pathname, 0).substr(2); } else if (mode === 'absolute') { if (url.substr(0, host.length) === host) { url = url.substr(host.length); } } return url; } function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) { if (html == null) { html = ''; } urlType = urlType || ''; wellFormatted = _undef(wellFormatted, false); indentChar = _undef(indentChar, '\t'); var fontSizeList = 'xx-small,x-small,small,medium,large,x-large,xx-large'.split(','); html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) { return $1 + $2.replace(/<(?:br|br\s[^>]*)>/ig, '\n') + $3; }); html = html.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig, '</p>'); html = html.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, '$1<br />$2'); html = html.replace(/\u200B/g, ''); html = html.replace(/\u00A9/g, '&copy;'); html = html.replace(/\u00AE/g, '&reg;'); html = html.replace(/<[^>]+/g, function($0) { return $0.replace(/\s+/g, ' '); }); var htmlTagMap = {}; if (htmlTags) { _each(htmlTags, function(key, val) { var arr = key.split(','); for (var i = 0, len = arr.length; i < len; i++) { htmlTagMap[arr[i]] = _toMap(val); } }); if (!htmlTagMap.script) { html = html.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig, ''); } if (!htmlTagMap.style) { html = html.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig, ''); } } var re = /(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g; var tagStack = []; html = html.replace(re, function($0, $1, $2, $3, $4, $5, $6) { var full = $0, startNewline = $1 || '', startSlash = $2 || '', tagName = $3.toLowerCase(), attr = $4 || '', endSlash = $5 ? ' ' + $5 : '', endNewline = $6 || ''; if (htmlTags && !htmlTagMap[tagName]) { return ''; } if (endSlash === '' && _SINGLE_TAG_MAP[tagName]) { endSlash = ' /'; } if (_INLINE_TAG_MAP[tagName]) { if (startNewline) { startNewline = ' '; } if (endNewline) { endNewline = ' '; } } if (_PRE_TAG_MAP[tagName]) { if (startSlash) { endNewline = '\n'; } else { startNewline = '\n'; } } if (wellFormatted && tagName == 'br') { endNewline = '\n'; } if (_BLOCK_TAG_MAP[tagName] && !_PRE_TAG_MAP[tagName]) { if (wellFormatted) { if (startSlash && tagStack.length > 0 && tagStack[tagStack.length - 1] === tagName) { tagStack.pop(); } else { tagStack.push(tagName); } startNewline = '\n'; endNewline = '\n'; for (var i = 0, len = startSlash ? tagStack.length : tagStack.length - 1; i < len; i++) { startNewline += indentChar; if (!startSlash) { endNewline += indentChar; } } if (endSlash) { tagStack.pop(); } else if (!startSlash) { endNewline += indentChar; } } else { startNewline = endNewline = ''; } } if (attr !== '') { var attrMap = _getAttrList(full); if (tagName === 'font') { var fontStyleMap = {}, fontStyle = ''; _each(attrMap, function(key, val) { if (key === 'color') { fontStyleMap.color = val; delete attrMap[key]; } if (key === 'size') { fontStyleMap['font-size'] = fontSizeList[parseInt(val, 10) - 1] || ''; delete attrMap[key]; } if (key === 'face') { fontStyleMap['font-family'] = val; delete attrMap[key]; } if (key === 'style') { fontStyle = val; } }); if (fontStyle && !/;$/.test(fontStyle)) { fontStyle += ';'; } _each(fontStyleMap, function(key, val) { if (val === '') { return; } if (/\s/.test(val)) { val = "'" + val + "'"; } fontStyle += key + ':' + val + ';'; }); attrMap.style = fontStyle; } _each(attrMap, function(key, val) { if (_FILL_ATTR_MAP[key]) { attrMap[key] = key; } if (_inArray(key, ['src', 'href']) >= 0) { attrMap[key] = _formatUrl(val, urlType); } if (htmlTags && key !== 'style' && !htmlTagMap[tagName]['*'] && !htmlTagMap[tagName][key] || tagName === 'body' && key === 'contenteditable' || /^kindeditor_\d+$/.test(key)) { delete attrMap[key]; } if (key === 'style' && val !== '') { var styleMap = _getCssList(val); _each(styleMap, function(k, v) { if (htmlTags && !htmlTagMap[tagName].style && !htmlTagMap[tagName]['.' + k]) { delete styleMap[k]; } }); var style = ''; _each(styleMap, function(k, v) { style += k + ':' + v + ';'; }); attrMap.style = style; } }); attr = ''; _each(attrMap, function(key, val) { if (key === 'style' && val === '') { return; } val = val.replace(/"/g, '&quot;'); attr += ' ' + key + '="' + val + '"'; }); } if (tagName === 'font') { tagName = 'span'; } return startNewline + '<' + startSlash + tagName + attr + endSlash + '>' + endNewline; }); html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) { return $1 + $2.replace(/\n/g, '<span id="__kindeditor_pre_newline__">\n') + $3; }); html = html.replace(/\n\s*\n/g, '\n'); html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n'); return _trim(html); } function _clearMsWord(html, htmlTags) { html = html.replace(/<meta[\s\S]*?>/ig, '') .replace(/<![\s\S]*?>/ig, '') .replace(/<style[^>]*>[\s\S]*?<\/style>/ig, '') .replace(/<script[^>]*>[\s\S]*?<\/script>/ig, '') .replace(/<w:[^>]+>[\s\S]*?<\/w:[^>]+>/ig, '') .replace(/<o:[^>]+>[\s\S]*?<\/o:[^>]+>/ig, '') .replace(/<xml>[\s\S]*?<\/xml>/ig, '') .replace(/<(?:table|td)[^>]*>/ig, function(full) { return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1'); }); return _formatHtml(html, htmlTags); } function _mediaType(src) { if (/\.(rm|rmvb)(\?|$)/i.test(src)) { return 'audio/x-pn-realaudio-plugin'; } if (/\.(swf|flv)(\?|$)/i.test(src)) { return 'application/x-shockwave-flash'; } return 'video/x-ms-asf-plugin'; } function _mediaClass(type) { if (/realaudio/i.test(type)) { return 'ke-rm'; } if (/flash/i.test(type)) { return 'ke-flash'; } return 'ke-media'; } function _mediaAttrs(srcTag) { return _getAttrList(unescape(srcTag)); } function _mediaEmbed(attrs) { var html = '<embed '; _each(attrs, function(key, val) { html += key + '="' + val + '" '; }); html += '/>'; return html; } /* video by tinfu -------begin------*/ function _videoEmbed(attrs){ var html = '<div style="width: 640px; height: 352px; margin:0 auto; padding: 20px; border:5px solid #999;">'; if(attrs.src.indexOf("server")>0){ html += '<script type="text/javascript" src="'+ attrs.src +'">'; }else{ html += '<script type="text/javascript" src="'+K.options.pluginsPath+'player/sewise.player.min.js?server=vod&type=mp4&videourl='+K.rootPath+attrs.src; html += '&sourceid=&autostart=false&starttime=0&lang=en_US&logo=http://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&title=VodVideo&buffer=5&claritybutton=disable&skin=vodFlowPlayer&topbardisplay=disable">'; } html += '</script></div>'; return html; } /*--------end----------*/ function _mediaImg(blankPath, attrs) { var width = attrs.width, height = attrs.height,autostart type = attrs.type || _mediaType(attrs.src), // old begin // srcTag = _mediaEmbed(attrs), // style = ''; // old end //by tinfu srcTag = '', style = ''; if(attrs.type == "video/x-ms-asf-plugin" || attrs.src.indexOf("server")>0){ srcTag = _videoEmbed(attrs); }else{ srcTag = _mediaEmbed(attrs); } //by tinfu end if (/\D/.test(width)) { style += 'width:' + width + ';'; } else if (width > 0) { style += 'width:' + width + 'px;'; } if (/\D/.test(height)) { style += 'height:' + height + ';'; } else if (height > 0) { style += 'height:' + height + 'px;'; } var html = '<img class="' + _mediaClass(type) + '" src="' + blankPath + '" '; if (style !== '') { html += 'style="' + style + '" '; } html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />'; return html; } function _tmpl(str, data) { var fn = new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + "with(obj){p.push('" + str.replace(/[\r\t\n]/g, " ") .split("<%").join("\t") .replace(/((^|%>)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%>/g, "',$1,'") .split("\t").join("');") .split("%>").join("p.push('") .split("\r").join("\\'") + "');}return p.join('');"); return data ? fn(data) : fn; } K.formatUrl = _formatUrl; K.formatHtml = _formatHtml; K.getCssList = _getCssList; K.getAttrList = _getAttrList; K.mediaType = _mediaType; K.mediaAttrs = _mediaAttrs; K.mediaEmbed = _mediaEmbed; K.mediaImg = _mediaImg; K.clearMsWord = _clearMsWord; K.tmpl = _tmpl; function _contains(nodeA, nodeB) { if (nodeA.nodeType == 9 && nodeB.nodeType != 9) { return true; } while ((nodeB = nodeB.parentNode)) { if (nodeB == nodeA) { return true; } } return false; } var _getSetAttrDiv = document.createElement('div'); _getSetAttrDiv.setAttribute('className', 't'); var _GET_SET_ATTRIBUTE = _getSetAttrDiv.className !== 't'; function _getAttr(el, key) { key = key.toLowerCase(); var val = null; if (!_GET_SET_ATTRIBUTE && el.nodeName.toLowerCase() != 'script') { var div = el.ownerDocument.createElement('div'); div.appendChild(el.cloneNode(false)); var list = _getAttrList(_unescape(div.innerHTML)); if (key in list) { val = list[key]; } } else { try { val = el.getAttribute(key, 2); } catch(e) { val = el.getAttribute(key, 1); } } if (key === 'style' && val !== null) { val = _formatCss(val); } return val; } function _queryAll(expr, root) { var exprList = expr.split(','); if (exprList.length > 1) { var mergedResults = []; _each(exprList, function() { _each(_queryAll(this, root), function() { if (_inArray(this, mergedResults) < 0) { mergedResults.push(this); } }); }); return mergedResults; } root = root || document; function escape(str) { if (typeof str != 'string') { return str; } return str.replace(/([^\w\-])/g, '\\$1'); } function stripslashes(str) { return str.replace(/\\/g, ''); } function cmpTag(tagA, tagB) { return tagA === '*' || tagA.toLowerCase() === escape(tagB.toLowerCase()); } function byId(id, tag, root) { var arr = [], doc = root.ownerDocument || root, el = doc.getElementById(stripslashes(id)); if (el) { if (cmpTag(tag, el.nodeName) && _contains(root, el)) { arr.push(el); } } return arr; } function byClass(className, tag, root) { var doc = root.ownerDocument || root, arr = [], els, i, len, el; if (root.getElementsByClassName) { els = root.getElementsByClassName(stripslashes(className)); for (i = 0, len = els.length; i < len; i++) { el = els[i]; if (cmpTag(tag, el.nodeName)) { arr.push(el); } } } else if (doc.querySelectorAll) { els = doc.querySelectorAll((root.nodeName !== '#document' ? root.nodeName + ' ' : '') + tag + '.' + className); for (i = 0, len = els.length; i < len; i++) { el = els[i]; if (_contains(root, el)) { arr.push(el); } } } else { els = root.getElementsByTagName(tag); className = ' ' + className + ' '; for (i = 0, len = els.length; i < len; i++) { el = els[i]; if (el.nodeType == 1) { var cls = el.className; if (cls && (' ' + cls + ' ').indexOf(className) > -1) { arr.push(el); } } } } return arr; } function byName(name, tag, root) { var arr = [], doc = root.ownerDocument || root, els = doc.getElementsByName(stripslashes(name)), el; for (var i = 0, len = els.length; i < len; i++) { el = els[i]; if (cmpTag(tag, el.nodeName) && _contains(root, el)) { if (el.getAttribute('name') !== null) { arr.push(el); } } } return arr; } function byAttr(key, val, tag, root) { var arr = [], els = root.getElementsByTagName(tag), el; for (var i = 0, len = els.length; i < len; i++) { el = els[i]; if (el.nodeType == 1) { if (val === null) { if (_getAttr(el, key) !== null) { arr.push(el); } } else { if (val === escape(_getAttr(el, key))) { arr.push(el); } } } } return arr; } function select(expr, root) { var arr = [], matches; matches = /^((?:\\.|[^.#\s\[<>])+)/.exec(expr); var tag = matches ? matches[1] : '*'; if ((matches = /#((?:[\w\-]|\\.)+)$/.exec(expr))) { arr = byId(matches[1], tag, root); } else if ((matches = /\.((?:[\w\-]|\\.)+)$/.exec(expr))) { arr = byClass(matches[1], tag, root); } else if ((matches = /\[((?:[\w\-]|\\.)+)\]/.exec(expr))) { arr = byAttr(matches[1].toLowerCase(), null, tag, root); } else if ((matches = /\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(expr))) { var key = matches[1].toLowerCase(), val = matches[2]; if (key === 'id') { arr = byId(val, tag, root); } else if (key === 'class') { arr = byClass(val, tag, root); } else if (key === 'name') { arr = byName(val, tag, root); } else { arr = byAttr(key, val, tag, root); } } else { var els = root.getElementsByTagName(tag), el; for (var i = 0, len = els.length; i < len; i++) { el = els[i]; if (el.nodeType == 1) { arr.push(el); } } } return arr; } var parts = [], arr, re = /((?:\\.|[^\s>])+|[\s>])/g; while ((arr = re.exec(expr))) { if (arr[1] !== ' ') { parts.push(arr[1]); } } var results = []; if (parts.length == 1) { return select(parts[0], root); } var isChild = false, part, els, subResults, val, v, i, j, k, length, len, l; for (i = 0, lenth = parts.length; i < lenth; i++) { part = parts[i]; if (part === '>') { isChild = true; continue; } if (i > 0) { els = []; for (j = 0, len = results.length; j < len; j++) { val = results[j]; subResults = select(part, val); for (k = 0, l = subResults.length; k < l; k++) { v = subResults[k]; if (isChild) { if (val === v.parentNode) { els.push(v); } } else { els.push(v); } } } results = els; } else { results = select(part, root); } if (results.length === 0) { return []; } } return results; } function _query(expr, root) { var arr = _queryAll(expr, root); return arr.length > 0 ? arr[0] : null; } K.query = _query; K.queryAll = _queryAll; function _get(val) { return K(val)[0]; } function _getDoc(node) { if (!node) { return document; } return node.ownerDocument || node.document || node; } function _getWin(node) { if (!node) { return window; } var doc = _getDoc(node); return doc.parentWindow || doc.defaultView; } function _setHtml(el, html) { if (el.nodeType != 1) { return; } var doc = _getDoc(el); try { el.innerHTML = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + html; var temp = doc.getElementById('__kindeditor_temp_tag__'); temp.parentNode.removeChild(temp); } catch(e) { K(el).empty(); K('@' + html, doc).each(function() { el.appendChild(this); }); } } function _hasClass(el, cls) { return _inString(cls, el.className, ' '); } function _setAttr(el, key, val) { if (_IE && _V < 8 && key.toLowerCase() == 'class') { key = 'className'; } el.setAttribute(key, '' + val); } function _removeAttr(el, key) { if (_IE && _V < 8 && key.toLowerCase() == 'class') { key = 'className'; } _setAttr(el, key, ''); el.removeAttribute(key); } function _getNodeName(node) { if (!node || !node.nodeName) { return ''; } return node.nodeName.toLowerCase(); } function _computedCss(el, key) { var self = this, win = _getWin(el), camelKey = _toCamel(key), val = ''; if (win.getComputedStyle) { var style = win.getComputedStyle(el, null); val = style[camelKey] || style.getPropertyValue(key) || el.style[camelKey]; } else if (el.currentStyle) { val = el.currentStyle[camelKey] || el.style[camelKey]; } return val; } function _hasVal(node) { return !!_VALUE_TAG_MAP[_getNodeName(node)]; } function _docElement(doc) { doc = doc || document; return _QUIRKS ? doc.body : doc.documentElement; } function _docHeight(doc) { var el = _docElement(doc); return Math.max(el.scrollHeight, el.clientHeight); } function _docWidth(doc) { var el = _docElement(doc); return Math.max(el.scrollWidth, el.clientWidth); } function _getScrollPos(doc) { doc = doc || document; var x, y; if (_IE || _NEWIE || _OPERA) { x = _docElement(doc).scrollLeft; y = _docElement(doc).scrollTop; } else { x = _getWin(doc).scrollX; y = _getWin(doc).scrollY; } return {x : x, y : y}; } function KNode(node) { this.init(node); } _extend(KNode, { init : function(node) { var self = this; node = _isArray(node) ? node : [node]; var length = 0; for (var i = 0, len = node.length; i < len; i++) { if (node[i]) { self[i] = node[i].constructor === KNode ? node[i][0] : node[i]; length++; } } self.length = length; self.doc = _getDoc(self[0]); self.name = _getNodeName(self[0]); self.type = self.length > 0 ? self[0].nodeType : null; self.win = _getWin(self[0]); }, each : function(fn) { var self = this; for (var i = 0; i < self.length; i++) { if (fn.call(self[i], i, self[i]) === false) { return self; } } return self; }, bind : function(type, fn) { this.each(function() { _bind(this, type, fn); }); return this; }, unbind : function(type, fn) { this.each(function() { _unbind(this, type, fn); }); return this; }, fire : function(type) { if (this.length < 1) { return this; } _fire(this[0], type); return this; }, hasAttr : function(key) { if (this.length < 1) { return false; } return !!_getAttr(this[0], key); }, attr : function(key, val) { var self = this; if (key === undefined) { return _getAttrList(self.outer()); } if (typeof key === 'object') { _each(key, function(k, v) { self.attr(k, v); }); return self; } if (val === undefined) { val = self.length < 1 ? null : _getAttr(self[0], key); return val === null ? '' : val; } self.each(function() { _setAttr(this, key, val); }); return self; }, removeAttr : function(key) { this.each(function() { _removeAttr(this, key); }); return this; }, get : function(i) { if (this.length < 1) { return null; } return this[i || 0]; }, eq : function(i) { if (this.length < 1) { return null; } return this[i] ? new KNode(this[i]) : null; }, hasClass : function(cls) { if (this.length < 1) { return false; } return _hasClass(this[0], cls); }, addClass : function(cls) { this.each(function() { if (!_hasClass(this, cls)) { this.className = _trim(this.className + ' ' + cls); } }); return this; }, removeClass : function(cls) { this.each(function() { if (_hasClass(this, cls)) { this.className = _trim(this.className.replace(new RegExp('(^|\\s)' + cls + '(\\s|$)'), ' ')); } }); return this; }, html : function(val) { var self = this; if (val === undefined) { if (self.length < 1 || self.type != 1) { return ''; } return _formatHtml(self[0].innerHTML); } self.each(function() { _setHtml(this, val); }); return self; }, text : function() { var self = this; if (self.length < 1) { return ''; } return _IE ? self[0].innerText : self[0].textContent; }, hasVal : function() { if (this.length < 1) { return false; } return _hasVal(this[0]); }, val : function(val) { var self = this; if (val === undefined) { if (self.length < 1) { return ''; } return self.hasVal() ? self[0].value : self.attr('value'); } else { self.each(function() { if (_hasVal(this)) { this.value = val; } else { _setAttr(this, 'value' , val); } }); return self; } }, css : function(key, val) { var self = this; if (key === undefined) { return _getCssList(self.attr('style')); } if (typeof key === 'object') { _each(key, function(k, v) { self.css(k, v); }); return self; } if (val === undefined) { if (self.length < 1) { return ''; } return self[0].style[_toCamel(key)] || _computedCss(self[0], key) || ''; } self.each(function() { this.style[_toCamel(key)] = val; }); return self; }, width : function(val) { var self = this; if (val === undefined) { if (self.length < 1) { return 0; } return self[0].offsetWidth; } return self.css('width', _addUnit(val)); }, height : function(val) { var self = this; if (val === undefined) { if (self.length < 1) { return 0; } return self[0].offsetHeight; } return self.css('height', _addUnit(val)); }, opacity : function(val) { this.each(function() { if (this.style.opacity === undefined) { this.style.filter = val == 1 ? '' : 'alpha(opacity=' + (val * 100) + ')'; } else { this.style.opacity = val == 1 ? '' : val; } }); return this; }, data : function(key, val) { var self = this; key = 'kindeditor_data_' + key; if (val === undefined) { if (self.length < 1) { return null; } return self[0][key]; } this.each(function() { this[key] = val; }); return self; }, pos : function() { var self = this, node = self[0], x = 0, y = 0; if (node) { if (node.getBoundingClientRect) { var box = node.getBoundingClientRect(), pos = _getScrollPos(self.doc); x = box.left + pos.x; y = box.top + pos.y; } else { while (node) { x += node.offsetLeft; y += node.offsetTop; node = node.offsetParent; } } } return {x : _round(x), y : _round(y)}; }, clone : function(bool) { if (this.length < 1) { return new KNode([]); } return new KNode(this[0].cloneNode(bool)); }, append : function(expr) { this.each(function() { if (this.appendChild) { this.appendChild(_get(expr)); } }); return this; }, appendTo : function(expr) { this.each(function() { _get(expr).appendChild(this); }); return this; }, before : function(expr) { this.each(function() { this.parentNode.insertBefore(_get(expr), this); }); return this; }, after : function(expr) { this.each(function() { if (this.nextSibling) { this.parentNode.insertBefore(_get(expr), this.nextSibling); } else { this.parentNode.appendChild(_get(expr)); } }); return this; }, replaceWith : function(expr) { var nodes = []; this.each(function(i, node) { _unbind(node); var newNode = _get(expr); node.parentNode.replaceChild(newNode, node); nodes.push(newNode); }); return K(nodes); }, empty : function() { var self = this; self.each(function(i, node) { var child = node.firstChild; while (child) { if (!node.parentNode) { return; } var next = child.nextSibling; child.parentNode.removeChild(child); child = next; } }); return self; }, remove : function(keepChilds) { var self = this; self.each(function(i, node) { if (!node.parentNode) { return; } _unbind(node); if (keepChilds) { var child = node.firstChild; while (child) { var next = child.nextSibling; node.parentNode.insertBefore(child, node); child = next; } } node.parentNode.removeChild(node); delete self[i]; }); self.length = 0; return self; }, show : function(val) { var self = this; if (val === undefined) { val = self._originDisplay || ''; } if (self.css('display') != 'none') { return self; } return self.css('display', val); }, hide : function() { var self = this; if (self.length < 1) { return self; } self._originDisplay = self[0].style.display; return self.css('display', 'none'); }, outer : function() { var self = this; if (self.length < 1) { return ''; } var div = self.doc.createElement('div'), html; div.appendChild(self[0].cloneNode(true)); html = _formatHtml(div.innerHTML); div = null; return html; }, isSingle : function() { return !!_SINGLE_TAG_MAP[this.name]; }, isInline : function() { return !!_INLINE_TAG_MAP[this.name]; }, isBlock : function() { return !!_BLOCK_TAG_MAP[this.name]; }, isStyle : function() { return !!_STYLE_TAG_MAP[this.name]; }, isControl : function() { return !!_CONTROL_TAG_MAP[this.name]; }, contains : function(otherNode) { if (this.length < 1) { return false; } return _contains(this[0], _get(otherNode)); }, parent : function() { if (this.length < 1) { return null; } var node = this[0].parentNode; return node ? new KNode(node) : null; }, children : function() { if (this.length < 1) { return new KNode([]); } var list = [], child = this[0].firstChild; while (child) { if (child.nodeType != 3 || _trim(child.nodeValue) !== '') { list.push(child); } child = child.nextSibling; } return new KNode(list); }, first : function() { var list = this.children(); return list.length > 0 ? list.eq(0) : null; }, last : function() { var list = this.children(); return list.length > 0 ? list.eq(list.length - 1) : null; }, index : function() { if (this.length < 1) { return -1; } var i = -1, sibling = this[0]; while (sibling) { i++; sibling = sibling.previousSibling; } return i; }, prev : function() { if (this.length < 1) { return null; } var node = this[0].previousSibling; return node ? new KNode(node) : null; }, next : function() { if (this.length < 1) { return null; } var node = this[0].nextSibling; return node ? new KNode(node) : null; }, scan : function(fn, order) { if (this.length < 1) { return; } order = (order === undefined) ? true : order; function walk(node) { var n = order ? node.firstChild : node.lastChild; while (n) { var next = order ? n.nextSibling : n.previousSibling; if (fn(n) === false) { return false; } if (walk(n) === false) { return false; } n = next; } } walk(this[0]); return this; } }); _each(('blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,' + 'mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,' + 'change,select,submit,keydown,keypress,keyup,error,contextmenu').split(','), function(i, type) { KNode.prototype[type] = function(fn) { return fn ? this.bind(type, fn) : this.fire(type); }; }); var _K = K; K = function(expr, root) { if (expr === undefined || expr === null) { return; } function newNode(node) { if (!node[0]) { node = []; } return new KNode(node); } if (typeof expr === 'string') { if (root) { root = _get(root); } var length = expr.length; if (expr.charAt(0) === '@') { expr = expr.substr(1); } if (expr.length !== length || /<.+>/.test(expr)) { var doc = root ? root.ownerDocument || root : document, div = doc.createElement('div'), list = []; div.innerHTML = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + expr; for (var i = 0, len = div.childNodes.length; i < len; i++) { var child = div.childNodes[i]; if (child.id == '__kindeditor_temp_tag__') { continue; } list.push(child); } return newNode(list); } return newNode(_queryAll(expr, root)); } if (expr && expr.constructor === KNode) { return expr; } if (expr.toArray) { expr = expr.toArray(); } if (_isArray(expr)) { return newNode(expr); } return newNode(_toArray(arguments)); }; _each(_K, function(key, val) { K[key] = val; }); K.NodeClass = KNode; window.KindEditor = K; var _START_TO_START = 0, _START_TO_END = 1, _END_TO_END = 2, _END_TO_START = 3, _BOOKMARK_ID = 0; function _updateCollapsed(range) { range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset); return range; } function _copyAndDelete(range, isCopy, isDelete) { var doc = range.doc, nodeList = []; function splitTextNode(node, startOffset, endOffset) { var length = node.nodeValue.length, centerNode; if (isCopy) { var cloneNode = node.cloneNode(true); if (startOffset > 0) { centerNode = cloneNode.splitText(startOffset); } else { centerNode = cloneNode; } if (endOffset < length) { centerNode.splitText(endOffset - startOffset); } } if (isDelete) { var center = node; if (startOffset > 0) { center = node.splitText(startOffset); range.setStart(node, startOffset); } if (endOffset < length) { var right = center.splitText(endOffset - startOffset); range.setEnd(right, 0); } nodeList.push(center); } return centerNode; } function removeNodes() { if (isDelete) { range.up().collapse(true); } for (var i = 0, len = nodeList.length; i < len; i++) { var node = nodeList[i]; if (node.parentNode) { node.parentNode.removeChild(node); } } } var copyRange = range.cloneRange().down(); var start = -1, incStart = -1, incEnd = -1, end = -1, ancestor = range.commonAncestor(), frag = doc.createDocumentFragment(); if (ancestor.nodeType == 3) { var textNode = splitTextNode(ancestor, range.startOffset, range.endOffset); if (isCopy) { frag.appendChild(textNode); } removeNodes(); return isCopy ? frag : range; } function extractNodes(parent, frag) { var node = parent.firstChild, nextNode; while (node) { var testRange = new KRange(doc).selectNode(node); start = testRange.compareBoundaryPoints(_START_TO_END, range); if (start >= 0 && incStart <= 0) { incStart = testRange.compareBoundaryPoints(_START_TO_START, range); } if (incStart >= 0 && incEnd <= 0) { incEnd = testRange.compareBoundaryPoints(_END_TO_END, range); } if (incEnd >= 0 && end <= 0) { end = testRange.compareBoundaryPoints(_END_TO_START, range); } if (end >= 0) { return false; } nextNode = node.nextSibling; if (start > 0) { if (node.nodeType == 1) { if (incStart >= 0 && incEnd <= 0) { if (isCopy) { frag.appendChild(node.cloneNode(true)); } if (isDelete) { nodeList.push(node); } } else { var childFlag; if (isCopy) { childFlag = node.cloneNode(false); frag.appendChild(childFlag); } if (extractNodes(node, childFlag) === false) { return false; } } } else if (node.nodeType == 3) { var textNode; if (node == copyRange.startContainer) { textNode = splitTextNode(node, copyRange.startOffset, node.nodeValue.length); } else if (node == copyRange.endContainer) { textNode = splitTextNode(node, 0, copyRange.endOffset); } else { textNode = splitTextNode(node, 0, node.nodeValue.length); } if (isCopy) { try { frag.appendChild(textNode); } catch(e) {} } } } node = nextNode; } } extractNodes(ancestor, frag); if (isDelete) { range.up().collapse(true); } for (var i = 0, len = nodeList.length; i < len; i++) { var node = nodeList[i]; if (node.parentNode) { node.parentNode.removeChild(node); } } return isCopy ? frag : range; } function _moveToElementText(range, el) { var node = el; while (node) { var knode = K(node); if (knode.name == 'marquee' || knode.name == 'select') { return; } node = node.parentNode; } try { range.moveToElementText(el); } catch(e) {} } function _getStartEnd(rng, isStart) { var doc = rng.parentElement().ownerDocument, pointRange = rng.duplicate(); pointRange.collapse(isStart); var parent = pointRange.parentElement(), nodes = parent.childNodes; if (nodes.length === 0) { return {node: parent.parentNode, offset: K(parent).index()}; } var startNode = doc, startPos = 0, cmp = -1; var testRange = rng.duplicate(); _moveToElementText(testRange, parent); for (var i = 0, len = nodes.length; i < len; i++) { var node = nodes[i]; cmp = testRange.compareEndPoints('StartToStart', pointRange); if (cmp === 0) { return {node: node.parentNode, offset: i}; } if (node.nodeType == 1) { var nodeRange = rng.duplicate(), dummy, knode = K(node), newNode = node; if (knode.isControl()) { dummy = doc.createElement('span'); knode.after(dummy); newNode = dummy; startPos += knode.text().replace(/\r\n|\n|\r/g, '').length; } _moveToElementText(nodeRange, newNode); testRange.setEndPoint('StartToEnd', nodeRange); if (cmp > 0) { startPos += nodeRange.text.replace(/\r\n|\n|\r/g, '').length; } else { startPos = 0; } if (dummy) { K(dummy).remove(); } } else if (node.nodeType == 3) { testRange.moveStart('character', node.nodeValue.length); startPos += node.nodeValue.length; } if (cmp < 0) { startNode = node; } } if (cmp < 0 && startNode.nodeType == 1) { return {node: parent, offset: K(parent.lastChild).index() + 1}; } if (cmp > 0) { while (startNode.nextSibling && startNode.nodeType == 1) { startNode = startNode.nextSibling; } } testRange = rng.duplicate(); _moveToElementText(testRange, parent); testRange.setEndPoint('StartToEnd', pointRange); startPos -= testRange.text.replace(/\r\n|\n|\r/g, '').length; if (cmp > 0 && startNode.nodeType == 3) { var prevNode = startNode.previousSibling; while (prevNode && prevNode.nodeType == 3) { startPos -= prevNode.nodeValue.length; prevNode = prevNode.previousSibling; } } return {node: startNode, offset: startPos}; } function _getEndRange(node, offset) { var doc = node.ownerDocument || node, range = doc.body.createTextRange(); if (doc == node) { range.collapse(true); return range; } if (node.nodeType == 1 && node.childNodes.length > 0) { var children = node.childNodes, isStart, child; if (offset === 0) { child = children[0]; isStart = true; } else { child = children[offset - 1]; isStart = false; } if (!child) { return range; } if (K(child).name === 'head') { if (offset === 1) { isStart = true; } if (offset === 2) { isStart = false; } range.collapse(isStart); return range; } if (child.nodeType == 1) { var kchild = K(child), span; if (kchild.isControl()) { span = doc.createElement('span'); if (isStart) { kchild.before(span); } else { kchild.after(span); } child = span; } _moveToElementText(range, child); range.collapse(isStart); if (span) { K(span).remove(); } return range; } node = child; offset = isStart ? 0 : child.nodeValue.length; } var dummy = doc.createElement('span'); K(node).before(dummy); _moveToElementText(range, dummy); range.moveStart('character', offset); K(dummy).remove(); return range; } function _toRange(rng) { var doc, range; function tr2td(start) { if (K(start.node).name == 'tr') { start.node = start.node.cells[start.offset]; start.offset = 0; } } if (_IERANGE) { if (rng.item) { doc = _getDoc(rng.item(0)); range = new KRange(doc); range.selectNode(rng.item(0)); return range; } doc = rng.parentElement().ownerDocument; var start = _getStartEnd(rng, true), end = _getStartEnd(rng, false); tr2td(start); tr2td(end); range = new KRange(doc); range.setStart(start.node, start.offset); range.setEnd(end.node, end.offset); return range; } var startContainer = rng.startContainer; doc = startContainer.ownerDocument || startContainer; range = new KRange(doc); range.setStart(startContainer, rng.startOffset); range.setEnd(rng.endContainer, rng.endOffset); return range; } function KRange(doc) { this.init(doc); } _extend(KRange, { init : function(doc) { var self = this; self.startContainer = doc; self.startOffset = 0; self.endContainer = doc; self.endOffset = 0; self.collapsed = true; self.doc = doc; }, commonAncestor : function() { function getParents(node) { var parents = []; while (node) { parents.push(node); node = node.parentNode; } return parents; } var parentsA = getParents(this.startContainer), parentsB = getParents(this.endContainer), i = 0, lenA = parentsA.length, lenB = parentsB.length, parentA, parentB; while (++i) { parentA = parentsA[lenA - i]; parentB = parentsB[lenB - i]; if (!parentA || !parentB || parentA !== parentB) { break; } } return parentsA[lenA - i + 1]; }, setStart : function(node, offset) { var self = this, doc = self.doc; self.startContainer = node; self.startOffset = offset; if (self.endContainer === doc) { self.endContainer = node; self.endOffset = offset; } return _updateCollapsed(this); }, setEnd : function(node, offset) { var self = this, doc = self.doc; self.endContainer = node; self.endOffset = offset; if (self.startContainer === doc) { self.startContainer = node; self.startOffset = offset; } return _updateCollapsed(this); }, setStartBefore : function(node) { return this.setStart(node.parentNode || this.doc, K(node).index()); }, setStartAfter : function(node) { return this.setStart(node.parentNode || this.doc, K(node).index() + 1); }, setEndBefore : function(node) { return this.setEnd(node.parentNode || this.doc, K(node).index()); }, setEndAfter : function(node) { return this.setEnd(node.parentNode || this.doc, K(node).index() + 1); }, selectNode : function(node) { return this.setStartBefore(node).setEndAfter(node); }, selectNodeContents : function(node) { var knode = K(node); if (knode.type == 3 || knode.isSingle()) { return this.selectNode(node); } var children = knode.children(); if (children.length > 0) { return this.setStartBefore(children[0]).setEndAfter(children[children.length - 1]); } return this.setStart(node, 0).setEnd(node, 0); }, collapse : function(toStart) { if (toStart) { return this.setEnd(this.startContainer, this.startOffset); } return this.setStart(this.endContainer, this.endOffset); }, compareBoundaryPoints : function(how, range) { var rangeA = this.get(), rangeB = range.get(); if (_IERANGE) { var arr = {}; arr[_START_TO_START] = 'StartToStart'; arr[_START_TO_END] = 'EndToStart'; arr[_END_TO_END] = 'EndToEnd'; arr[_END_TO_START] = 'StartToEnd'; var cmp = rangeA.compareEndPoints(arr[how], rangeB); if (cmp !== 0) { return cmp; } var nodeA, nodeB, nodeC, posA, posB; if (how === _START_TO_START || how === _END_TO_START) { nodeA = this.startContainer; posA = this.startOffset; } if (how === _START_TO_END || how === _END_TO_END) { nodeA = this.endContainer; posA = this.endOffset; } if (how === _START_TO_START || how === _START_TO_END) { nodeB = range.startContainer; posB = range.startOffset; } if (how === _END_TO_END || how === _END_TO_START) { nodeB = range.endContainer; posB = range.endOffset; } if (nodeA === nodeB) { var diff = posA - posB; return diff > 0 ? 1 : (diff < 0 ? -1 : 0); } nodeC = nodeB; while (nodeC && nodeC.parentNode !== nodeA) { nodeC = nodeC.parentNode; } if (nodeC) { return K(nodeC).index() >= posA ? -1 : 1; } nodeC = nodeA; while (nodeC && nodeC.parentNode !== nodeB) { nodeC = nodeC.parentNode; } if (nodeC) { return K(nodeC).index() >= posB ? 1 : -1; } nodeC = K(nodeB).next(); if (nodeC && nodeC.contains(nodeA)) { return 1; } nodeC = K(nodeA).next(); if (nodeC && nodeC.contains(nodeB)) { return -1; } } else { return rangeA.compareBoundaryPoints(how, rangeB); } }, cloneRange : function() { return new KRange(this.doc).setStart(this.startContainer, this.startOffset).setEnd(this.endContainer, this.endOffset); }, toString : function() { var rng = this.get(), str = _IERANGE ? rng.text : rng.toString(); return str.replace(/\r\n|\n|\r/g, ''); }, cloneContents : function() { return _copyAndDelete(this, true, false); }, deleteContents : function() { return _copyAndDelete(this, false, true); }, extractContents : function() { return _copyAndDelete(this, true, true); }, insertNode : function(node) { var self = this, sc = self.startContainer, so = self.startOffset, ec = self.endContainer, eo = self.endOffset, firstChild, lastChild, c, nodeCount = 1; if (node.nodeName.toLowerCase() === '#document-fragment') { firstChild = node.firstChild; lastChild = node.lastChild; nodeCount = node.childNodes.length; } if (sc.nodeType == 1) { c = sc.childNodes[so]; if (c) { sc.insertBefore(node, c); if (sc === ec) { eo += nodeCount; } } else { sc.appendChild(node); } } else if (sc.nodeType == 3) { if (so === 0) { sc.parentNode.insertBefore(node, sc); if (sc.parentNode === ec) { eo += nodeCount; } } else if (so >= sc.nodeValue.length) { if (sc.nextSibling) { sc.parentNode.insertBefore(node, sc.nextSibling); } else { sc.parentNode.appendChild(node); } } else { if (so > 0) { c = sc.splitText(so); } else { c = sc; } sc.parentNode.insertBefore(node, c); if (sc === ec) { ec = c; eo -= so; } } } if (firstChild) { self.setStartBefore(firstChild).setEndAfter(lastChild); } else { self.selectNode(node); } if (self.compareBoundaryPoints(_END_TO_END, self.cloneRange().setEnd(ec, eo)) >= 1) { return self; } return self.setEnd(ec, eo); }, surroundContents : function(node) { node.appendChild(this.extractContents()); return this.insertNode(node).selectNode(node); }, isControl : function() { var self = this, sc = self.startContainer, so = self.startOffset, ec = self.endContainer, eo = self.endOffset, rng; return sc.nodeType == 1 && sc === ec && so + 1 === eo && K(sc.childNodes[so]).isControl(); }, get : function(hasControlRange) { var self = this, doc = self.doc, node, rng; if (!_IERANGE) { rng = doc.createRange(); try { rng.setStart(self.startContainer, self.startOffset); rng.setEnd(self.endContainer, self.endOffset); } catch (e) {} return rng; } if (hasControlRange && self.isControl()) { rng = doc.body.createControlRange(); rng.addElement(self.startContainer.childNodes[self.startOffset]); return rng; } var range = self.cloneRange().down(); rng = doc.body.createTextRange(); rng.setEndPoint('StartToStart', _getEndRange(range.startContainer, range.startOffset)); rng.setEndPoint('EndToStart', _getEndRange(range.endContainer, range.endOffset)); return rng; }, html : function() { return K(this.cloneContents()).outer(); }, down : function() { var self = this; function downPos(node, pos, isStart) { if (node.nodeType != 1) { return; } var children = K(node).children(); if (children.length === 0) { return; } var left, right, child, offset; if (pos > 0) { left = children.eq(pos - 1); } if (pos < children.length) { right = children.eq(pos); } if (left && left.type == 3) { child = left[0]; offset = child.nodeValue.length; } if (right && right.type == 3) { child = right[0]; offset = 0; } if (!child) { return; } if (isStart) { self.setStart(child, offset); } else { self.setEnd(child, offset); } } downPos(self.startContainer, self.startOffset, true); downPos(self.endContainer, self.endOffset, false); return self; }, up : function() { var self = this; function upPos(node, pos, isStart) { if (node.nodeType != 3) { return; } if (pos === 0) { if (isStart) { self.setStartBefore(node); } else { self.setEndBefore(node); } } else if (pos == node.nodeValue.length) { if (isStart) { self.setStartAfter(node); } else { self.setEndAfter(node); } } } upPos(self.startContainer, self.startOffset, true); upPos(self.endContainer, self.endOffset, false); return self; }, enlarge : function(toBlock) { var self = this; self.up(); function enlargePos(node, pos, isStart) { var knode = K(node), parent; if (knode.type == 3 || _NOSPLIT_TAG_MAP[knode.name] || !toBlock && knode.isBlock()) { return; } if (pos === 0) { while (!knode.prev()) { parent = knode.parent(); if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) { break; } knode = parent; } if (isStart) { self.setStartBefore(knode[0]); } else { self.setEndBefore(knode[0]); } } else if (pos == knode.children().length) { while (!knode.next()) { parent = knode.parent(); if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) { break; } knode = parent; } if (isStart) { self.setStartAfter(knode[0]); } else { self.setEndAfter(knode[0]); } } } enlargePos(self.startContainer, self.startOffset, true); enlargePos(self.endContainer, self.endOffset, false); return self; }, shrink : function() { var self = this, child, collapsed = self.collapsed; while (self.startContainer.nodeType == 1 && (child = self.startContainer.childNodes[self.startOffset]) && child.nodeType == 1 && !K(child).isSingle()) { self.setStart(child, 0); } if (collapsed) { return self.collapse(collapsed); } while (self.endContainer.nodeType == 1 && self.endOffset > 0 && (child = self.endContainer.childNodes[self.endOffset - 1]) && child.nodeType == 1 && !K(child).isSingle()) { self.setEnd(child, child.childNodes.length); } return self; }, createBookmark : function(serialize) { var self = this, doc = self.doc, endNode, startNode = K('<span style="display:none;"></span>', doc)[0]; startNode.id = '__kindeditor_bookmark_start_' + (_BOOKMARK_ID++) + '__'; if (!self.collapsed) { endNode = startNode.cloneNode(true); endNode.id = '__kindeditor_bookmark_end_' + (_BOOKMARK_ID++) + '__'; } if (endNode) { self.cloneRange().collapse(false).insertNode(endNode).setEndBefore(endNode); } self.insertNode(startNode).setStartAfter(startNode); return { start : serialize ? '#' + startNode.id : startNode, end : endNode ? (serialize ? '#' + endNode.id : endNode) : null }; }, moveToBookmark : function(bookmark) { var self = this, doc = self.doc, start = K(bookmark.start, doc), end = bookmark.end ? K(bookmark.end, doc) : null; if (!start || start.length < 1) { return self; } self.setStartBefore(start[0]); start.remove(); if (end && end.length > 0) { self.setEndBefore(end[0]); end.remove(); } else { self.collapse(true); } return self; }, dump : function() { console.log('--------------------'); console.log(this.startContainer.nodeType == 3 ? this.startContainer.nodeValue : this.startContainer, this.startOffset); console.log(this.endContainer.nodeType == 3 ? this.endContainer.nodeValue : this.endContainer, this.endOffset); } }); function _range(mixed) { if (!mixed.nodeName) { return mixed.constructor === KRange ? mixed : _toRange(mixed); } return new KRange(mixed); } K.RangeClass = KRange; K.range = _range; K.START_TO_START = _START_TO_START; K.START_TO_END = _START_TO_END; K.END_TO_END = _END_TO_END; K.END_TO_START = _END_TO_START; function _nativeCommand(doc, key, val) { try { doc.execCommand(key, false, val); } catch(e) {} } function _nativeCommandValue(doc, key) { var val = ''; try { val = doc.queryCommandValue(key); } catch (e) {} if (typeof val !== 'string') { val = ''; } return val; } function _getSel(doc) { var win = _getWin(doc); return _IERANGE ? doc.selection : win.getSelection(); } function _getRng(doc) { var sel = _getSel(doc), rng; try { if (sel.rangeCount > 0) { rng = sel.getRangeAt(0); } else { rng = sel.createRange(); } } catch(e) {} if (_IERANGE && (!rng || (!rng.item && rng.parentElement().ownerDocument !== doc))) { return null; } return rng; } function _singleKeyMap(map) { var newMap = {}, arr, v; _each(map, function(key, val) { arr = key.split(','); for (var i = 0, len = arr.length; i < len; i++) { v = arr[i]; newMap[v] = val; } }); return newMap; } function _hasAttrOrCss(knode, map) { return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map); } function _hasAttrOrCssByKey(knode, map, mapKey) { mapKey = mapKey || knode.name; if (knode.type !== 1) { return false; } var newMap = _singleKeyMap(map); if (!newMap[mapKey]) { return false; } var arr = newMap[mapKey].split(','); for (var i = 0, len = arr.length; i < len; i++) { var key = arr[i]; if (key === '*') { return true; } var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key); var method = match[1] ? 'css' : 'attr'; key = match[2]; var val = match[3] || ''; if (val === '' && knode[method](key) !== '') { return true; } if (val !== '' && knode[method](key) === val) { return true; } } return false; } function _removeAttrOrCss(knode, map) { if (knode.type != 1) { return; } _removeAttrOrCssByKey(knode, map, '*'); _removeAttrOrCssByKey(knode, map); } function _removeAttrOrCssByKey(knode, map, mapKey) { mapKey = mapKey || knode.name; if (knode.type !== 1) { return; } var newMap = _singleKeyMap(map); if (!newMap[mapKey]) { return; } var arr = newMap[mapKey].split(','), allFlag = false; for (var i = 0, len = arr.length; i < len; i++) { var key = arr[i]; if (key === '*') { allFlag = true; break; } var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key); key = match[2]; if (match[1]) { key = _toCamel(key); if (knode[0].style[key]) { knode[0].style[key] = ''; } } else { knode.removeAttr(key); } } if (allFlag) { knode.remove(true); } } function _getInnerNode(knode) { var inner = knode; while (inner.first()) { inner = inner.first(); } return inner; } function _isEmptyNode(knode) { if (knode.type != 1 || knode.isSingle()) { return false; } return knode.html().replace(/<[^>]+>/g, '') === ''; } function _mergeWrapper(a, b) { a = a.clone(true); var lastA = _getInnerNode(a), childA = a, merged = false; while (b) { while (childA) { if (childA.name === b.name) { _mergeAttrs(childA, b.attr(), b.css()); merged = true; } childA = childA.first(); } if (!merged) { lastA.append(b.clone(false)); } merged = false; b = b.first(); } return a; } function _wrapNode(knode, wrapper) { wrapper = wrapper.clone(true); if (knode.type == 3) { _getInnerNode(wrapper).append(knode.clone(false)); knode.replaceWith(wrapper); return wrapper; } var nodeWrapper = knode, child; while ((child = knode.first()) && child.children().length == 1) { knode = child; } child = knode.first(); var frag = knode.doc.createDocumentFragment(); while (child) { frag.appendChild(child[0]); child = child.next(); } wrapper = _mergeWrapper(nodeWrapper, wrapper); if (frag.firstChild) { _getInnerNode(wrapper).append(frag); } nodeWrapper.replaceWith(wrapper); return wrapper; } function _mergeAttrs(knode, attrs, styles) { _each(attrs, function(key, val) { if (key !== 'style') { knode.attr(key, val); } }); _each(styles, function(key, val) { knode.css(key, val); }); } function _inPreElement(knode) { while (knode && knode.name != 'body') { if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) { return true; } knode = knode.parent(); } return false; } function KCmd(range) { this.init(range); } _extend(KCmd, { init : function(range) { var self = this, doc = range.doc; self.doc = doc; self.win = _getWin(doc); self.sel = _getSel(doc); self.range = range; }, selection : function(forceReset) { var self = this, doc = self.doc, rng = _getRng(doc); self.sel = _getSel(doc); if (rng) { self.range = _range(rng); if (K(self.range.startContainer).name == 'html') { self.range.selectNodeContents(doc.body).collapse(false); } return self; } if (forceReset) { self.range.selectNodeContents(doc.body).collapse(false); } return self; }, select : function(hasDummy) { hasDummy = _undef(hasDummy, true); var self = this, sel = self.sel, range = self.range.cloneRange().shrink(), sc = range.startContainer, so = range.startOffset, ec = range.endContainer, eo = range.endOffset, doc = _getDoc(sc), win = self.win, rng, hasU200b = false; if (hasDummy && sc.nodeType == 1 && range.collapsed) { if (_IERANGE) { var dummy = K('<span>&nbsp;</span>', doc); range.insertNode(dummy[0]); rng = doc.body.createTextRange(); try { rng.moveToElementText(dummy[0]); } catch(ex) {} rng.collapse(false); rng.select(); dummy.remove(); win.focus(); return self; } if (_WEBKIT) { var children = sc.childNodes; if (K(sc).isInline() || so > 0 && K(children[so - 1]).isInline() || children[so] && K(children[so]).isInline()) { range.insertNode(doc.createTextNode('\u200B')); hasU200b = true; } } } if (_IERANGE) { try { rng = range.get(true); rng.select(); } catch(e) {} } else { if (hasU200b) { range.collapse(false); } rng = range.get(true); sel.removeAllRanges(); sel.addRange(rng); if (doc !== document) { var pos = K(rng.endContainer).pos(); win.scrollTo(pos.x, pos.y); } } win.focus(); return self; }, wrap : function(val) { var self = this, doc = self.doc, range = self.range, wrapper; wrapper = K(val, doc); if (range.collapsed) { range.shrink(); range.insertNode(wrapper[0]).selectNodeContents(wrapper[0]); return self; } if (wrapper.isBlock()) { var copyWrapper = wrapper.clone(true), child = copyWrapper; while (child.first()) { child = child.first(); } child.append(range.extractContents()); range.insertNode(copyWrapper[0]).selectNode(copyWrapper[0]); return self; } range.enlarge(); var bookmark = range.createBookmark(), ancestor = range.commonAncestor(), isStart = false; K(ancestor).scan(function(node) { if (!isStart && node == bookmark.start) { isStart = true; return; } if (isStart) { if (node == bookmark.end) { return false; } var knode = K(node); if (_inPreElement(knode)) { return; } if (knode.type == 3 && _trim(node.nodeValue).length > 0) { var parent; while ((parent = knode.parent()) && parent.isStyle() && parent.children().length == 1) { knode = parent; } _wrapNode(knode, wrapper); } } }); range.moveToBookmark(bookmark); return self; }, split : function(isStart, map) { var range = this.range, doc = range.doc; var tempRange = range.cloneRange().collapse(isStart); var node = tempRange.startContainer, pos = tempRange.startOffset, parent = node.nodeType == 3 ? node.parentNode : node, needSplit = false, knode; while (parent && parent.parentNode) { knode = K(parent); if (map) { if (!knode.isStyle()) { break; } if (!_hasAttrOrCss(knode, map)) { break; } } else { if (_NOSPLIT_TAG_MAP[knode.name]) { break; } } needSplit = true; parent = parent.parentNode; } if (needSplit) { var dummy = doc.createElement('span'); range.cloneRange().collapse(!isStart).insertNode(dummy); if (isStart) { tempRange.setStartBefore(parent.firstChild).setEnd(node, pos); } else { tempRange.setStart(node, pos).setEndAfter(parent.lastChild); } var frag = tempRange.extractContents(), first = frag.firstChild, last = frag.lastChild; if (isStart) { tempRange.insertNode(frag); range.setStartAfter(last).setEndBefore(dummy); } else { parent.appendChild(frag); range.setStartBefore(dummy).setEndBefore(first); } var dummyParent = dummy.parentNode; if (dummyParent == range.endContainer) { var prev = K(dummy).prev(), next = K(dummy).next(); if (prev && next && prev.type == 3 && next.type == 3) { range.setEnd(prev[0], prev[0].nodeValue.length); } else if (!isStart) { range.setEnd(range.endContainer, range.endOffset - 1); } } dummyParent.removeChild(dummy); } return this; }, remove : function(map) { var self = this, doc = self.doc, range = self.range; range.enlarge(); if (range.startOffset === 0) { var ksc = K(range.startContainer), parent; while ((parent = ksc.parent()) && parent.isStyle() && parent.children().length == 1) { ksc = parent; } range.setStart(ksc[0], 0); ksc = K(range.startContainer); if (ksc.isBlock()) { _removeAttrOrCss(ksc, map); } var kscp = ksc.parent(); if (kscp && kscp.isBlock()) { _removeAttrOrCss(kscp, map); } } var sc, so; if (range.collapsed) { self.split(true, map); sc = range.startContainer; so = range.startOffset; if (so > 0) { var sb = K(sc.childNodes[so - 1]); if (sb && _isEmptyNode(sb)) { sb.remove(); range.setStart(sc, so - 1); } } var sa = K(sc.childNodes[so]); if (sa && _isEmptyNode(sa)) { sa.remove(); } if (_isEmptyNode(sc)) { range.startBefore(sc); sc.remove(); } range.collapse(true); return self; } self.split(true, map); self.split(false, map); var startDummy = doc.createElement('span'), endDummy = doc.createElement('span'); range.cloneRange().collapse(false).insertNode(endDummy); range.cloneRange().collapse(true).insertNode(startDummy); var nodeList = [], cmpStart = false; K(range.commonAncestor()).scan(function(node) { if (!cmpStart && node == startDummy) { cmpStart = true; return; } if (node == endDummy) { return false; } if (cmpStart) { nodeList.push(node); } }); K(startDummy).remove(); K(endDummy).remove(); sc = range.startContainer; so = range.startOffset; var ec = range.endContainer, eo = range.endOffset; if (so > 0) { var startBefore = K(sc.childNodes[so - 1]); if (startBefore && _isEmptyNode(startBefore)) { startBefore.remove(); range.setStart(sc, so - 1); if (sc == ec) { range.setEnd(ec, eo - 1); } } var startAfter = K(sc.childNodes[so]); if (startAfter && _isEmptyNode(startAfter)) { startAfter.remove(); if (sc == ec) { range.setEnd(ec, eo - 1); } } } var endAfter = K(ec.childNodes[range.endOffset]); if (endAfter && _isEmptyNode(endAfter)) { endAfter.remove(); } var bookmark = range.createBookmark(true); _each(nodeList, function(i, node) { _removeAttrOrCss(K(node), map); }); range.moveToBookmark(bookmark); return self; }, commonNode : function(map) { var range = this.range; var ec = range.endContainer, eo = range.endOffset, node = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1]; function find(node) { var child = node, parent = node; while (parent) { if (_hasAttrOrCss(K(parent), map)) { return K(parent); } parent = parent.parentNode; } while (child && (child = child.lastChild)) { if (_hasAttrOrCss(K(child), map)) { return K(child); } } return null; } var cNode = find(node); if (cNode) { return cNode; } if (node.nodeType == 1 || (ec.nodeType == 3 && eo === 0)) { var prev = K(node).prev(); if (prev) { return find(prev); } } return null; }, commonAncestor : function(tagName) { var range = this.range, sc = range.startContainer, so = range.startOffset, ec = range.endContainer, eo = range.endOffset, startNode = (sc.nodeType == 3 || so === 0) ? sc : sc.childNodes[so - 1], endNode = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1]; function find(node) { while (node) { if (node.nodeType == 1) { if (node.tagName.toLowerCase() === tagName) { return node; } } node = node.parentNode; } return null; } var start = find(startNode), end = find(endNode); if (start && end && start === end) { return K(start); } return null; }, state : function(key) { var self = this, doc = self.doc, bool = false; try { bool = doc.queryCommandState(key); } catch (e) {} return bool; }, val : function(key) { var self = this, doc = self.doc, range = self.range; function lc(val) { return val.toLowerCase(); } key = lc(key); var val = '', knode; if (key === 'fontfamily' || key === 'fontname') { val = _nativeCommandValue(doc, 'fontname'); val = val.replace(/['"]/g, ''); return lc(val); } if (key === 'formatblock') { val = _nativeCommandValue(doc, key); if (val === '') { knode = self.commonNode({'h1,h2,h3,h4,h5,h6,p,div,pre,address' : '*'}); if (knode) { val = knode.name; } } if (val === 'Normal') { val = 'p'; } return lc(val); } if (key === 'fontsize') { knode = self.commonNode({'*' : '.font-size'}); if (knode) { val = knode.css('font-size'); } return lc(val); } if (key === 'forecolor') { knode = self.commonNode({'*' : '.color'}); if (knode) { val = knode.css('color'); } val = _toHex(val); if (val === '') { val = 'default'; } return lc(val); } if (key === 'hilitecolor') { knode = self.commonNode({'*' : '.background-color'}); if (knode) { val = knode.css('background-color'); } val = _toHex(val); if (val === '') { val = 'default'; } return lc(val); } return val; }, toggle : function(wrapper, map) { var self = this; if (self.commonNode(map)) { self.remove(map); } else { self.wrap(wrapper); } return self.select(); }, bold : function() { return this.toggle('<strong></strong>', { span : '.font-weight=bold', strong : '*', b : '*' }); }, italic : function() { return this.toggle('<em></em>', { span : '.font-style=italic', em : '*', i : '*' }); }, underline : function() { return this.toggle('<u></u>', { span : '.text-decoration=underline', u : '*' }); }, strikethrough : function() { return this.toggle('<s></s>', { span : '.text-decoration=line-through', s : '*' }); }, forecolor : function(val) { return this.wrap('<span style="color:' + val + ';"></span>').select(); }, hilitecolor : function(val) { return this.wrap('<span style="background-color:' + val + ';"></span>').select(); }, fontsize : function(val) { return this.wrap('<span style="font-size:' + val + ';"></span>').select(); }, fontname : function(val) { return this.fontfamily(val); }, fontfamily : function(val) { return this.wrap('<span style="font-family:' + val + ';"></span>').select(); }, removeformat : function() { var map = { '*' : '.font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent' }, tags = _STYLE_TAG_MAP; _each(tags, function(key, val) { map[key] = '*'; }); this.remove(map); return this.select(); }, inserthtml : function(val, quickMode) { var self = this, range = self.range; if (val === '') { return self; } function pasteHtml(range, val) { val = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + val; var rng = range.get(); if (rng.item) { rng.item(0).outerHTML = val; } else { rng.pasteHTML(val); } var temp = range.doc.getElementById('__kindeditor_temp_tag__'); temp.parentNode.removeChild(temp); var newRange = _toRange(rng); range.setEnd(newRange.endContainer, newRange.endOffset); range.collapse(false); self.select(false); } function insertHtml(range, val) { var doc = range.doc, frag = doc.createDocumentFragment(); K('@' + val, doc).each(function() { frag.appendChild(this); }); range.deleteContents(); range.insertNode(frag); range.collapse(false); self.select(false); } if (_IERANGE && quickMode) { try { pasteHtml(range, val); } catch(e) { insertHtml(range, val); } return self; } insertHtml(range, val); return self; }, hr : function() { return this.inserthtml('<hr />'); }, print : function() { this.win.print(); return this; }, insertimage : function(url, title, width, height, border, align) { title = _undef(title, ''); border = _undef(border, 0); var html = '<img src="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" '; if (width) { html += 'width="' + _escape(width) + '" '; } if (height) { html += 'height="' + _escape(height) + '" '; } if (title) { html += 'title="' + _escape(title) + '" '; } if (align) { html += 'align="' + _escape(align) + '" '; } html += 'alt="' + _escape(title) + '" '; html += '/>'; return this.inserthtml(html); }, createlink : function(url, type) { var self = this, doc = self.doc, range = self.range; self.select(); var a = self.commonNode({ a : '*' }); if (a && !range.isControl()) { range.selectNode(a.get()); self.select(); } var html = '<a href="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" '; if (type) { html += ' target="' + _escape(type) + '"'; } if (range.collapsed) { html += '>' + _escape(url) + '</a>'; return self.inserthtml(html); } if (range.isControl()) { var node = K(range.startContainer.childNodes[range.startOffset]); html += '></a>'; node.after(K(html, doc)); node.next().append(node); range.selectNode(node[0]); return self.select(); } function setAttr(node, url, type) { K(node).attr('href', url).attr('data-ke-src', url); if (type) { K(node).attr('target', type); } else { K(node).removeAttr('target'); } } var sc = range.startContainer, so = range.startOffset, ec = range.endContainer, eo = range.endOffset; if (sc.nodeType == 1 && sc === ec && so + 1 === eo) { var child = sc.childNodes[so]; if (child.nodeName.toLowerCase() == 'a') { setAttr(child, url, type); return self; } } _nativeCommand(doc, 'createlink', '__kindeditor_temp_url__'); K('a[href="__kindeditor_temp_url__"]', doc).each(function() { setAttr(this, url, type); }); return self; }, unlink : function() { var self = this, doc = self.doc, range = self.range; self.select(); if (range.collapsed) { var a = self.commonNode({ a : '*' }); if (a) { range.selectNode(a.get()); self.select(); } _nativeCommand(doc, 'unlink', null); if (_WEBKIT && K(range.startContainer).name === 'img') { var parent = K(range.startContainer).parent(); if (parent.name === 'a') { parent.remove(true); } } } else { _nativeCommand(doc, 'unlink', null); } return self; } }); _each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,' + 'insertunorderedlist,indent,outdent,subscript,superscript').split(','), function(i, name) { KCmd.prototype[name] = function(val) { var self = this; self.select(); _nativeCommand(self.doc, name, val); if (_IERANGE && _inArray(name, 'justifyleft,justifycenter,justifyright,justifyfull'.split(',')) >= 0) { self.selection(); } if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) { self.selection(); } return self; }; }); _each('cut,copy,paste'.split(','), function(i, name) { KCmd.prototype[name] = function() { var self = this; if (!self.doc.queryCommandSupported(name)) { throw 'not supported'; } self.select(); _nativeCommand(self.doc, name, null); return self; }; }); function _cmd(mixed) { if (mixed.nodeName) { var doc = _getDoc(mixed); mixed = _range(doc).selectNodeContents(doc.body).collapse(false); } return new KCmd(mixed); } K.CmdClass = KCmd; K.cmd = _cmd; function _drag(options) { var moveEl = options.moveEl, moveFn = options.moveFn, clickEl = options.clickEl || moveEl, beforeDrag = options.beforeDrag, iframeFix = options.iframeFix === undefined ? true : options.iframeFix; var docs = [document]; if (iframeFix) { K('iframe').each(function() { var src = _formatUrl(this.src || '', 'absolute'); if (/^https?:\/\//.test(src)) { return; } var doc; try { doc = _iframeDoc(this); } catch(e) {} if (doc) { var pos = K(this).pos(); K(doc).data('pos-x', pos.x); K(doc).data('pos-y', pos.y); docs.push(doc); } }); } clickEl.mousedown(function(e) { e.stopPropagation(); var self = clickEl.get(), x = _removeUnit(moveEl.css('left')), y = _removeUnit(moveEl.css('top')), width = moveEl.width(), height = moveEl.height(), pageX = e.pageX, pageY = e.pageY; if (beforeDrag) { beforeDrag(); } function moveListener(e) { e.preventDefault(); var kdoc = K(_getDoc(e.target)); var diffX = _round((kdoc.data('pos-x') || 0) + e.pageX - pageX); var diffY = _round((kdoc.data('pos-y') || 0) + e.pageY - pageY); moveFn.call(clickEl, x, y, width, height, diffX, diffY); } function selectListener(e) { e.preventDefault(); } function upListener(e) { e.preventDefault(); K(docs).unbind('mousemove', moveListener) .unbind('mouseup', upListener) .unbind('selectstart', selectListener); if (self.releaseCapture) { self.releaseCapture(); } } K(docs).mousemove(moveListener) .mouseup(upListener) .bind('selectstart', selectListener); if (self.setCapture) { self.setCapture(); } }); } function KWidget(options) { this.init(options); } _extend(KWidget, { init : function(options) { var self = this; self.name = options.name || ''; self.doc = options.doc || document; self.win = _getWin(self.doc); self.x = _addUnit(options.x); self.y = _addUnit(options.y); self.z = options.z; self.width = _addUnit(options.width); self.height = _addUnit(options.height); self.div = K('<div style="display:block;"></div>'); self.options = options; self._alignEl = options.alignEl; if (self.width) { self.div.css('width', self.width); } if (self.height) { self.div.css('height', self.height); } if (self.z) { self.div.css({ position : 'absolute', left : self.x, top : self.y, 'z-index' : self.z }); } if (self.z && (self.x === undefined || self.y === undefined)) { self.autoPos(self.width, self.height); } if (options.cls) { self.div.addClass(options.cls); } if (options.shadowMode) { self.div.addClass('ke-shadow'); } if (options.css) { self.div.css(options.css); } if (options.src) { K(options.src).replaceWith(self.div); } else { K(self.doc.body).append(self.div); } if (options.html) { self.div.html(options.html); } if (options.autoScroll) { if (_IE && _V < 7 || _QUIRKS) { var scrollPos = _getScrollPos(); K(self.win).bind('scroll', function(e) { var pos = _getScrollPos(), diffX = pos.x - scrollPos.x, diffY = pos.y - scrollPos.y; self.pos(_removeUnit(self.x) + diffX, _removeUnit(self.y) + diffY, false); }); } else { self.div.css('position', 'fixed'); } } }, pos : function(x, y, updateProp) { var self = this; updateProp = _undef(updateProp, true); if (x !== null) { x = x < 0 ? 0 : _addUnit(x); self.div.css('left', x); if (updateProp) { self.x = x; } } if (y !== null) { y = y < 0 ? 0 : _addUnit(y); self.div.css('top', y); if (updateProp) { self.y = y; } } return self; }, autoPos : function(width, height) { var self = this, w = _removeUnit(width) || 0, h = _removeUnit(height) || 0, scrollPos = _getScrollPos(); if (self._alignEl) { var knode = K(self._alignEl), pos = knode.pos(), diffX = _round(knode[0].clientWidth / 2 - w / 2), diffY = _round(knode[0].clientHeight / 2 - h / 2); x = diffX < 0 ? pos.x : pos.x + diffX; y = diffY < 0 ? pos.y : pos.y + diffY; } else { var docEl = _docElement(self.doc); x = _round(scrollPos.x + (docEl.clientWidth - w) / 2); y = _round(scrollPos.y + (docEl.clientHeight - h) / 2); } if (!(_IE && _V < 7 || _QUIRKS)) { x -= scrollPos.x; y -= scrollPos.y; } return self.pos(x, y); }, remove : function() { var self = this; if (_IE && _V < 7 || _QUIRKS) { K(self.win).unbind('scroll'); } self.div.remove(); _each(self, function(i) { self[i] = null; }); return this; }, show : function() { this.div.show(); return this; }, hide : function() { this.div.hide(); return this; }, draggable : function(options) { var self = this; options = options || {}; options.moveEl = self.div; options.moveFn = function(x, y, width, height, diffX, diffY) { if ((x = x + diffX) < 0) { x = 0; } if ((y = y + diffY) < 0) { y = 0; } self.pos(x, y); }; _drag(options); return self; } }); function _widget(options) { return new KWidget(options); } K.WidgetClass = KWidget; K.widget = _widget; function _iframeDoc(iframe) { iframe = _get(iframe); return iframe.contentDocument || iframe.contentWindow.document; } var html, _direction = ''; if ((html = document.getElementsByTagName('html'))) { _direction = html[0].dir; } function _getInitHtml(themesPath, bodyClass, cssPath, cssData) { var arr = [ (_direction === '' ? '<html>' : '<html dir="' + _direction + '">'), '<head><meta charset="utf-8" /><title></title>', '<style>', 'html {margin:0;padding:0;}', 'body {margin:0;padding:5px;}', 'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}', 'body, p, div {word-wrap: break-word;}', 'p {margin:5px 0;}', 'table {border-collapse:collapse;}', 'img {border:0;}', 'noscript {display:none;}', 'table.ke-zeroborder td {border:1px dotted #AAA;}', 'img.ke-flash {', ' border:1px solid #AAA;', ' background-image:url(' + themesPath + 'common/flash.gif);', ' background-position:center center;', ' background-repeat:no-repeat;', ' width:100px;', ' height:100px;', '}', 'img.ke-rm {', ' border:1px solid #AAA;', ' background-image:url(' + themesPath + 'common/rm.gif);', ' background-position:center center;', ' background-repeat:no-repeat;', ' width:100px;', ' height:100px;', '}', 'img.ke-media {', ' border:1px solid #AAA;', ' background-image:url(' + themesPath + 'common/media.gif);', ' background-position:center center;', ' background-repeat:no-repeat;', ' width:100px;', ' height:100px;', '}', 'img.ke-anchor {', ' border:1px dashed #666;', ' width:16px;', ' height:16px;', '}', '.ke-script, .ke-noscript, .ke-display-none {', ' display:none;', ' font-size:0;', ' width:0;', ' height:0;', '}', '.ke-pagebreak {', ' border:1px dotted #AAA;', ' font-size:0;', ' height:2px;', '}', '</style>' ]; if (!_isArray(cssPath)) { cssPath = [cssPath]; } _each(cssPath, function(i, path) { if (path) { arr.push('<link href="' + path + '" rel="stylesheet" />'); } }); if (cssData) { arr.push('<style>' + cssData + '</style>'); } arr.push('</head><body ' + (bodyClass ? 'class="' + bodyClass + '"' : '') + '></body></html>'); return arr.join('\n'); } function _elementVal(knode, val) { if (knode.hasVal()) { if (val === undefined) { var html = knode.val(); html = html.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig, ''); return html; } return knode.val(val); } return knode.html(val); } function KEdit(options) { this.init(options); } _extend(KEdit, KWidget, { init : function(options) { var self = this; KEdit.parent.init.call(self, options); self.srcElement = K(options.srcElement); self.div.addClass('ke-edit'); self.designMode = _undef(options.designMode, true); self.beforeGetHtml = options.beforeGetHtml; self.beforeSetHtml = options.beforeSetHtml; self.afterSetHtml = options.afterSetHtml; var themesPath = _undef(options.themesPath, ''), bodyClass = options.bodyClass, cssPath = options.cssPath, cssData = options.cssData, isDocumentDomain = location.protocol != 'res:' && location.host.replace(/:\d+/, '') !== document.domain, srcScript = ('document.open();' + (isDocumentDomain ? 'document.domain="' + document.domain + '";' : '') + 'document.close();'), iframeSrc = _IE ? ' src="javascript:void(function(){' + encodeURIComponent(srcScript) + '}())"' : ''; self.iframe = K('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"' + iframeSrc + '></iframe>').css('width', '100%'); self.textarea = K('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css('width', '100%'); self.tabIndex = isNaN(parseInt(options.tabIndex, 10)) ? self.srcElement.attr('tabindex') : parseInt(options.tabIndex, 10); self.iframe.attr('tabindex', self.tabIndex); self.textarea.attr('tabindex', self.tabIndex); if (self.width) { self.setWidth(self.width); } if (self.height) { self.setHeight(self.height); } if (self.designMode) { self.textarea.hide(); } else { self.iframe.hide(); } function ready() { var doc = _iframeDoc(self.iframe); doc.open(); if (isDocumentDomain) { doc.domain = document.domain; } doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData)); doc.close(); self.win = self.iframe[0].contentWindow; self.doc = doc; var cmd = _cmd(doc); self.afterChange(function(e) { cmd.selection(); }); if (_WEBKIT) { K(doc).click(function(e) { if (K(e.target).name === 'img') { cmd.selection(true); cmd.range.selectNode(e.target); cmd.select(); } }); } if (_IE) { self._mousedownHandler = function() { var newRange = cmd.range.cloneRange(); newRange.shrink(); if (newRange.isControl()) { self.blur(); } }; K(document).mousedown(self._mousedownHandler); K(doc).keydown(function(e) { if (e.which == 8) { cmd.selection(); var rng = cmd.range; if (rng.isControl()) { rng.collapse(true); K(rng.startContainer.childNodes[rng.startOffset]).remove(); e.preventDefault(); } } }); } self.cmd = cmd; self.html(_elementVal(self.srcElement)); if (_IE) { doc.body.disabled = true; doc.body.contentEditable = true; doc.body.removeAttribute('disabled'); } else { doc.designMode = 'on'; } if (options.afterCreate) { options.afterCreate.call(self); } } if (isDocumentDomain) { self.iframe.bind('load', function(e) { self.iframe.unbind('load'); if (_IE) { ready(); } else { setTimeout(ready, 0); } }); } self.div.append(self.iframe); self.div.append(self.textarea); self.srcElement.hide(); !isDocumentDomain && ready(); }, setWidth : function(val) { var self = this; val = _addUnit(val); self.width = val; self.div.css('width', val); return self; }, setHeight : function(val) { var self = this; val = _addUnit(val); self.height = val; self.div.css('height', val); self.iframe.css('height', val); if ((_IE && _V < 8) || _QUIRKS) { val = _addUnit(_removeUnit(val) - 2); } self.textarea.css('height', val); return self; }, remove : function() { var self = this, doc = self.doc; K(doc.body).unbind(); K(doc).unbind(); K(self.win).unbind(); if (self._mousedownHandler) { K(document).unbind('mousedown', self._mousedownHandler); } _elementVal(self.srcElement, self.html()); self.srcElement.show(); doc.write(''); self.iframe.unbind(); self.textarea.unbind(); KEdit.parent.remove.call(self); }, html : function(val, isFull) { var self = this, doc = self.doc; if (self.designMode) { var body = doc.body; if (val === undefined) { if (isFull) { val = '<!doctype html><html>' + body.parentNode.innerHTML + '</html>'; } else { val = body.innerHTML; } if (self.beforeGetHtml) { val = self.beforeGetHtml(val); } if (_GECKO && val == '<br />') { val = ''; } return val; } if (self.beforeSetHtml) { val = self.beforeSetHtml(val); } if (_IE && _V >= 9) { val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); } K(body).html(val); if (self.afterSetHtml) { self.afterSetHtml(); } return self; } if (val === undefined) { return self.textarea.val(); } self.textarea.val(val); return self; }, design : function(bool) { var self = this, val; if (bool === undefined ? !self.designMode : bool) { if (!self.designMode) { val = self.html(); self.designMode = true; self.html(val); self.textarea.hide(); self.iframe.show(); } } else { if (self.designMode) { val = self.html(); self.designMode = false; self.html(val); self.iframe.hide(); self.textarea.show(); } } return self.focus(); }, focus : function() { var self = this; self.designMode ? self.win.focus() : self.textarea[0].focus(); return self; }, blur : function() { var self = this; if (_IE) { var input = K('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />', self.div); self.div.append(input); input[0].focus(); input.remove(); } else { self.designMode ? self.win.blur() : self.textarea[0].blur(); } return self; }, afterChange : function(fn) { var self = this, doc = self.doc, body = doc.body; K(doc).keyup(function(e) { if (!e.ctrlKey && !e.altKey && _CHANGE_KEY_MAP[e.which]) { fn(e); } }); K(doc).mouseup(fn).contextmenu(fn); K(self.win).blur(fn); function timeoutHandler(e) { setTimeout(function() { fn(e); }, 1); } K(body).bind('paste', timeoutHandler); K(body).bind('cut', timeoutHandler); return self; } }); function _edit(options) { return new KEdit(options); } K.EditClass = KEdit; K.edit = _edit; K.iframeDoc = _iframeDoc; function _selectToolbar(name, fn) { var self = this, knode = self.get(name); if (knode) { if (knode.hasClass('ke-disabled')) { return; } fn(knode); } } function KToolbar(options) { this.init(options); } _extend(KToolbar, KWidget, { init : function(options) { var self = this; KToolbar.parent.init.call(self, options); self.disableMode = _undef(options.disableMode, false); self.noDisableItemMap = _toMap(_undef(options.noDisableItems, [])); self._itemMap = {}; self.div.addClass('ke-toolbar').bind('contextmenu,mousedown,mousemove', function(e) { e.preventDefault(); }).attr('unselectable', 'on'); function find(target) { var knode = K(target); if (knode.hasClass('ke-outline')) { return knode; } if (knode.hasClass('ke-toolbar-icon')) { return knode.parent(); } } function hover(e, method) { var knode = find(e.target); if (knode) { if (knode.hasClass('ke-disabled')) { return; } if (knode.hasClass('ke-selected')) { return; } knode[method]('ke-on'); } } self.div.mouseover(function(e) { hover(e, 'addClass'); }) .mouseout(function(e) { hover(e, 'removeClass'); }) .click(function(e) { var knode = find(e.target); if (knode) { if (knode.hasClass('ke-disabled')) { return; } self.options.click.call(this, e, knode.attr('data-name')); } }); }, get : function(name) { if (this._itemMap[name]) { return this._itemMap[name]; } return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent()); }, select : function(name) { _selectToolbar.call(this, name, function(knode) { knode.addClass('ke-selected'); }); return self; }, unselect : function(name) { _selectToolbar.call(this, name, function(knode) { knode.removeClass('ke-selected').removeClass('ke-on'); }); return self; }, enable : function(name) { var self = this, knode = name.get ? name : self.get(name); if (knode) { knode.removeClass('ke-disabled'); knode.opacity(1); } return self; }, disable : function(name) { var self = this, knode = name.get ? name : self.get(name); if (knode) { knode.removeClass('ke-selected').addClass('ke-disabled'); knode.opacity(0.5); } return self; }, disableAll : function(bool, noDisableItems) { var self = this, map = self.noDisableItemMap, item; if (noDisableItems) { map = _toMap(noDisableItems); } if (bool === undefined ? !self.disableMode : bool) { K('span.ke-outline', self.div).each(function() { var knode = K(this), name = knode[0].getAttribute('data-name', 2); if (!map[name]) { self.disable(knode); } }); self.disableMode = true; } else { K('span.ke-outline', self.div).each(function() { var knode = K(this), name = knode[0].getAttribute('data-name', 2); if (!map[name]) { self.enable(knode); } }); self.disableMode = false; } return self; } }); function _toolbar(options) { return new KToolbar(options); } K.ToolbarClass = KToolbar; K.toolbar = _toolbar; function KMenu(options) { this.init(options); } _extend(KMenu, KWidget, { init : function(options) { var self = this; options.z = options.z || 811213; KMenu.parent.init.call(self, options); self.centerLineMode = _undef(options.centerLineMode, true); self.div.addClass('ke-menu').bind('click,mousedown', function(e){ e.stopPropagation(); }).attr('unselectable', 'on'); }, addItem : function(item) { var self = this; if (item.title === '-') { self.div.append(K('<div class="ke-menu-separator"></div>')); return; } var itemDiv = K('<div class="ke-menu-item" unselectable="on"></div>'), leftDiv = K('<div class="ke-inline-block ke-menu-item-left"></div>'), rightDiv = K('<div class="ke-inline-block ke-menu-item-right"></div>'), height = _addUnit(item.height), iconClass = _undef(item.iconClass, ''); self.div.append(itemDiv); if (height) { itemDiv.css('height', height); rightDiv.css('line-height', height); } var centerDiv; if (self.centerLineMode) { centerDiv = K('<div class="ke-inline-block ke-menu-item-center"></div>'); if (height) { centerDiv.css('height', height); } } itemDiv.mouseover(function(e) { K(this).addClass('ke-menu-item-on'); if (centerDiv) { centerDiv.addClass('ke-menu-item-center-on'); } }) .mouseout(function(e) { K(this).removeClass('ke-menu-item-on'); if (centerDiv) { centerDiv.removeClass('ke-menu-item-center-on'); } }) .click(function(e) { item.click.call(K(this)); e.stopPropagation(); }) .append(leftDiv); if (centerDiv) { itemDiv.append(centerDiv); } itemDiv.append(rightDiv); if (item.checked) { iconClass = 'ke-icon-checked'; } if (iconClass !== '') { leftDiv.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url ' + iconClass + '"></span>'); } rightDiv.html(item.title); return self; }, remove : function() { var self = this; if (self.options.beforeRemove) { self.options.beforeRemove.call(self); } K('.ke-menu-item', self.div[0]).unbind(); KMenu.parent.remove.call(self); return self; } }); function _menu(options) { return new KMenu(options); } K.MenuClass = KMenu; K.menu = _menu; function KColorPicker(options) { this.init(options); } _extend(KColorPicker, KWidget, { init : function(options) { var self = this; options.z = options.z || 811213; KColorPicker.parent.init.call(self, options); var colors = options.colors || [ ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] ]; self.selectedColor = (options.selectedColor || '').toLowerCase(); self._cells = []; self.div.addClass('ke-colorpicker').bind('click,mousedown', function(e){ e.stopPropagation(); }).attr('unselectable', 'on'); var table = self.doc.createElement('table'); self.div.append(table); table.className = 'ke-colorpicker-table'; table.cellPadding = 0; table.cellSpacing = 0; table.border = 0; var row = table.insertRow(0), cell = row.insertCell(0); cell.colSpan = colors[0].length; self._addAttr(cell, '', 'ke-colorpicker-cell-top'); for (var i = 0; i < colors.length; i++) { row = table.insertRow(i + 1); for (var j = 0; j < colors[i].length; j++) { cell = row.insertCell(j); self._addAttr(cell, colors[i][j], 'ke-colorpicker-cell'); } } }, _addAttr : function(cell, color, cls) { var self = this; cell = K(cell).addClass(cls); if (self.selectedColor === color.toLowerCase()) { cell.addClass('ke-colorpicker-cell-selected'); } cell.attr('title', color || self.options.noColor); cell.mouseover(function(e) { K(this).addClass('ke-colorpicker-cell-on'); }); cell.mouseout(function(e) { K(this).removeClass('ke-colorpicker-cell-on'); }); cell.click(function(e) { e.stop(); self.options.click.call(K(this), color); }); if (color) { cell.append(K('<div class="ke-colorpicker-cell-color" unselectable="on"></div>').css('background-color', color)); } else { cell.html(self.options.noColor); } K(cell).attr('unselectable', 'on'); self._cells.push(cell); }, remove : function() { var self = this; _each(self._cells, function() { this.unbind(); }); KColorPicker.parent.remove.call(self); return self; } }); function _colorpicker(options) { return new KColorPicker(options); } K.ColorPickerClass = KColorPicker; K.colorpicker = _colorpicker; function KUploadButton(options) { this.init(options); } _extend(KUploadButton, { init : function(options) { var self = this, button = K(options.button), fieldName = options.fieldName || 'file', url = options.url || '', title = button.val(), extraParams = options.extraParams || {}, cls = button[0].className || '', target = options.target || 'kindeditor_upload_iframe_' + new Date().getTime(); options.afterError = options.afterError || function(str) { alert(str); }; var hiddenElements = []; for(var k in extraParams){ hiddenElements.push('<input type="hidden" name="' + k + '" value="' + extraParams[k] + '" />'); } var html = [ '<div class="ke-inline-block ' + cls + '">', (options.target ? '' : '<iframe name="' + target + '" style="display:none;"></iframe>'), (options.form ? '<div class="ke-upload-area">' : '<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="' + target + '" action="' + url + '">'), '<span class="ke-button-common">', hiddenElements.join(''), '<input type="button" class="ke-button-common ke-button" value="' + title + '" />', '</span>', '<input type="file" class="ke-upload-file" name="' + fieldName + '" tabindex="-1" />', (options.form ? '</div>' : '</form>'), '</div>'].join(''); var div = K(html, button.doc); button.hide(); button.before(div); self.div = div; self.button = button; self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div); self.form = options.form ? K(options.form) : K('form', div); self.fileBox = K('.ke-upload-file', div); var width = options.width || K('.ke-button-common', div).width(); K('.ke-upload-area', div).width(width); self.options = options; }, submit : function() { var self = this, iframe = self.iframe; iframe.bind('load', function() { iframe.unbind(); var tempForm = document.createElement('form'); self.fileBox.before(tempForm); K(tempForm).append(self.fileBox); tempForm.reset(); K(tempForm).remove(true); var doc = K.iframeDoc(iframe), pre = doc.getElementsByTagName('pre')[0], str = '', data; if (pre) { str = pre.innerHTML; } else { str = doc.body.innerHTML; } str = _unescape(str); iframe[0].src = 'javascript:false'; try { data = K.json(str); } catch (e) { self.options.afterError.call(self, '<!doctype html><html>' + doc.body.parentNode.innerHTML + '</html>'); } if (data) { self.options.afterUpload.call(self, data); } }); self.form[0].submit(); return self; }, remove : function() { var self = this; if (self.fileBox) { self.fileBox.unbind(); } self.iframe.remove(); self.div.remove(); self.button.show(); return self; } }); function _uploadbutton(options) { return new KUploadButton(options); } K.UploadButtonClass = KUploadButton; K.uploadbutton = _uploadbutton; function _createButton(arg) { arg = arg || {}; var name = arg.name || '', span = K('<span class="ke-button-common ke-button-outer" title="' + name + '"></span>'), btn = K('<input class="ke-button-common ke-button" type="button" value="' + name + '" />'); if (arg.click) { btn.click(arg.click); } span.append(btn); return span; } function KDialog(options) { this.init(options); } _extend(KDialog, KWidget, { init : function(options) { var self = this; var shadowMode = _undef(options.shadowMode, true); options.z = options.z || 811213; options.shadowMode = false; options.autoScroll = _undef(options.autoScroll, true); KDialog.parent.init.call(self, options); var title = options.title, body = K(options.body, self.doc), previewBtn = options.previewBtn, yesBtn = options.yesBtn, noBtn = options.noBtn, closeBtn = options.closeBtn, showMask = _undef(options.showMask, true); self.div.addClass('ke-dialog').bind('click,mousedown', function(e){ e.stopPropagation(); }); var contentDiv = K('<div class="ke-dialog-content"></div>').appendTo(self.div); if (_IE && _V < 7) { self.iframeMask = K('<iframe src="about:blank" class="ke-dialog-shadow"></iframe>').appendTo(self.div); } else if (shadowMode) { K('<div class="ke-dialog-shadow"></div>').appendTo(self.div); } var headerDiv = K('<div class="ke-dialog-header"></div>'); contentDiv.append(headerDiv); headerDiv.html(title); self.closeIcon = K('<span class="ke-dialog-icon-close" title="' + closeBtn.name + '"></span>').click(closeBtn.click); headerDiv.append(self.closeIcon); self.draggable({ clickEl : headerDiv, beforeDrag : options.beforeDrag }); var bodyDiv = K('<div class="ke-dialog-body"></div>'); contentDiv.append(bodyDiv); bodyDiv.append(body); var footerDiv = K('<div class="ke-dialog-footer"></div>'); if (previewBtn || yesBtn || noBtn) { contentDiv.append(footerDiv); } _each([ { btn : previewBtn, name : 'preview' }, { btn : yesBtn, name : 'yes' }, { btn : noBtn, name : 'no' } ], function() { if (this.btn) { var button = _createButton(this.btn); button.addClass('ke-dialog-' + this.name); footerDiv.append(button); } }); if (self.height) { bodyDiv.height(_removeUnit(self.height) - headerDiv.height() - footerDiv.height()); } self.div.width(self.div.width()); self.div.height(self.div.height()); self.mask = null; if (showMask) { var docEl = _docElement(self.doc), docWidth = Math.max(docEl.scrollWidth, docEl.clientWidth), docHeight = Math.max(docEl.scrollHeight, docEl.clientHeight); self.mask = _widget({ x : 0, y : 0, z : self.z - 1, cls : 'ke-dialog-mask', width : docWidth, height : docHeight }); } self.autoPos(self.div.width(), self.div.height()); self.footerDiv = footerDiv; self.bodyDiv = bodyDiv; self.headerDiv = headerDiv; self.isLoading = false; }, setMaskIndex : function(z) { var self = this; self.mask.div.css('z-index', z); }, showLoading : function(msg) { msg = _undef(msg, ''); var self = this, body = self.bodyDiv; self.loading = K('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:' + Math.round(body.height() / 3) + 'px;">' + msg + '</div></div>') .width(body.width()).height(body.height()) .css('top', self.headerDiv.height() + 'px'); body.css('visibility', 'hidden').after(self.loading); self.isLoading = true; return self; }, hideLoading : function() { this.loading && this.loading.remove(); this.bodyDiv.css('visibility', 'visible'); this.isLoading = false; return this; }, remove : function() { var self = this; if (self.options.beforeRemove) { self.options.beforeRemove.call(self); } self.mask && self.mask.remove(); self.iframeMask && self.iframeMask.remove(); self.closeIcon.unbind(); K('input', self.div).unbind(); K('button', self.div).unbind(); self.footerDiv.unbind(); self.bodyDiv.unbind(); self.headerDiv.unbind(); K('iframe', self.div).each(function() { K(this).remove(); }); KDialog.parent.remove.call(self); return self; } }); function _dialog(options) { return new KDialog(options); } K.DialogClass = KDialog; K.dialog = _dialog; function _tabs(options) { var self = _widget(options), remove = self.remove, afterSelect = options.afterSelect, div = self.div, liList = []; div.addClass('ke-tabs') .bind('contextmenu,mousedown,mousemove', function(e) { e.preventDefault(); }); var ul = K('<ul class="ke-tabs-ul ke-clearfix"></ul>'); div.append(ul); self.add = function(tab) { var li = K('<li class="ke-tabs-li">' + tab.title + '</li>'); li.data('tab', tab); liList.push(li); ul.append(li); }; self.selectedIndex = 0; self.select = function(index) { self.selectedIndex = index; _each(liList, function(i, li) { li.unbind(); if (i === index) { li.addClass('ke-tabs-li-selected'); K(li.data('tab').panel).show(''); } else { li.removeClass('ke-tabs-li-selected').removeClass('ke-tabs-li-on') .mouseover(function() { K(this).addClass('ke-tabs-li-on'); }) .mouseout(function() { K(this).removeClass('ke-tabs-li-on'); }) .click(function() { self.select(i); }); K(li.data('tab').panel).hide(); } }); if (afterSelect) { afterSelect.call(self, index); } }; self.remove = function() { _each(liList, function() { this.remove(); }); ul.remove(); remove.call(self); }; return self; } K.tabs = _tabs; function _loadScript(url, fn) { var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), script = document.createElement('script'); head.appendChild(script); script.src = url; script.charset = 'utf-8'; script.onload = script.onreadystatechange = function() { if (!this.readyState || this.readyState === 'loaded') { if (fn) { fn(); } script.onload = script.onreadystatechange = null; head.removeChild(script); } }; } function _chopQuery(url) { var index = url.indexOf('?'); return index > 0 ? url.substr(0, index) : url; } function _loadStyle(url) { var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), link = document.createElement('link'), absoluteUrl = _chopQuery(_formatUrl(url, 'absolute')); var links = K('link[rel="stylesheet"]', head); for (var i = 0, len = links.length; i < len; i++) { if (_chopQuery(_formatUrl(links[i].href, 'absolute')) === absoluteUrl) { return; } } head.appendChild(link); link.href = url; link.rel = 'stylesheet'; } function _ajax(url, fn, method, param, dataType) { method = method || 'GET'; dataType = dataType || 'json'; var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); xhr.open(method, url, true); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { if (fn) { var data = _trim(xhr.responseText); if (dataType == 'json') { data = _json(data); } fn(data); } } }; if (method == 'POST') { var params = []; _each(param, function(key, val) { params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val)); }); try { xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } catch (e) {} xhr.send(params.join('&')); } else { xhr.send(null); } } K.loadScript = _loadScript; K.loadStyle = _loadStyle; K.ajax = _ajax; var _plugins = {}; function _plugin(name, fn) { if (name === undefined) { return _plugins; } if (!fn) { return _plugins[name]; } _plugins[name] = fn; } var _language = {}; function _parseLangKey(key) { var match, ns = 'core'; if ((match = /^(\w+)\.(\w+)$/.exec(key))) { ns = match[1]; key = match[2]; } return { ns : ns, key : key }; } function _lang(mixed, langType) { langType = langType === undefined ? K.options.langType : langType; if (typeof mixed === 'string') { if (!_language[langType]) { return 'no language'; } var pos = mixed.length - 1; if (mixed.substr(pos) === '.') { return _language[langType][mixed.substr(0, pos)]; } var obj = _parseLangKey(mixed); return _language[langType][obj.ns][obj.key]; } _each(mixed, function(key, val) { var obj = _parseLangKey(key); if (!_language[langType]) { _language[langType] = {}; } if (!_language[langType][obj.ns]) { _language[langType][obj.ns] = {}; } _language[langType][obj.ns][obj.key] = val; }); } function _getImageFromRange(range, fn) { if (range.collapsed) { return; } range = range.cloneRange().up(); var sc = range.startContainer, so = range.startOffset; if (!_WEBKIT && !range.isControl()) { return; } var img = K(sc.childNodes[so]); if (!img || img.name != 'img') { return; } if (fn(img)) { return img; } } function _bindContextmenuEvent() { var self = this, doc = self.edit.doc; K(doc).contextmenu(function(e) { if (self.menu) { self.hideMenu(); } if (!self.useContextmenu) { e.preventDefault(); return; } if (self._contextmenus.length === 0) { return; } var maxWidth = 0, items = []; _each(self._contextmenus, function() { if (this.title == '-') { items.push(this); return; } if (this.cond && this.cond()) { items.push(this); if (this.width && this.width > maxWidth) { maxWidth = this.width; } } }); while (items.length > 0 && items[0].title == '-') { items.shift(); } while (items.length > 0 && items[items.length - 1].title == '-') { items.pop(); } var prevItem = null; _each(items, function(i) { if (this.title == '-' && prevItem.title == '-') { delete items[i]; } prevItem = this; }); if (items.length > 0) { e.preventDefault(); var pos = K(self.edit.iframe).pos(), menu = _menu({ x : pos.x + e.clientX, y : pos.y + e.clientY, width : maxWidth, css : { visibility: 'hidden' }, shadowMode : self.shadowMode }); _each(items, function() { if (this.title) { menu.addItem(this); } }); var docEl = _docElement(menu.doc), menuHeight = menu.div.height(); if (e.clientY + menuHeight >= docEl.clientHeight - 100) { menu.pos(menu.x, _removeUnit(menu.y) - menuHeight); } menu.div.css('visibility', 'visible'); self.menu = menu; } }); } function _bindNewlineEvent() { var self = this, doc = self.edit.doc, newlineTag = self.newlineTag; if (_IE && newlineTag !== 'br') { return; } if (_GECKO && _V < 3 && newlineTag !== 'p') { return; } if (_OPERA && _V < 9) { return; } var brSkipTagMap = _toMap('h1,h2,h3,h4,h5,h6,pre,li'), pSkipTagMap = _toMap('p,h1,h2,h3,h4,h5,h6,pre,li,blockquote'); function getAncestorTagName(range) { var ancestor = K(range.commonAncestor()); while (ancestor) { if (ancestor.type == 1 && !ancestor.isStyle()) { break; } ancestor = ancestor.parent(); } return ancestor.name; } K(doc).keydown(function(e) { if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { return; } self.cmd.selection(); var tagName = getAncestorTagName(self.cmd.range); if (tagName == 'marquee' || tagName == 'select') { return; } if (newlineTag === 'br' && !brSkipTagMap[tagName]) { e.preventDefault(); self.insertHtml('<br />' + (_IE && _V < 9 ? '' : '\u200B')); return; } if (!pSkipTagMap[tagName]) { _nativeCommand(doc, 'formatblock', '<p>'); } }); K(doc).keyup(function(e) { if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { return; } if (newlineTag == 'br') { return; } if (_GECKO) { var root = self.cmd.commonAncestor('p'); var a = self.cmd.commonAncestor('a'); if (a && a.text() == '') { a.remove(true); self.cmd.range.selectNodeContents(root[0]).collapse(true); self.cmd.select(); } return; } self.cmd.selection(); var tagName = getAncestorTagName(self.cmd.range); if (tagName == 'marquee' || tagName == 'select') { return; } if (!pSkipTagMap[tagName]) { _nativeCommand(doc, 'formatblock', '<p>'); } var div = self.cmd.commonAncestor('div'); if (div) { var p = K('<p></p>'), child = div[0].firstChild; while (child) { var next = child.nextSibling; p.append(child); child = next; } div.before(p); div.remove(); self.cmd.range.selectNodeContents(p[0]); self.cmd.select(); } }); } function _bindTabEvent() { var self = this, doc = self.edit.doc; K(doc).keydown(function(e) { if (e.which == 9) { e.preventDefault(); if (self.afterTab) { self.afterTab.call(self, e); return; } var cmd = self.cmd, range = cmd.range; range.shrink(); if (range.collapsed && range.startContainer.nodeType == 1) { range.insertNode(K('@&nbsp;', doc)[0]); cmd.select(); } self.insertHtml('&nbsp;&nbsp;&nbsp;&nbsp;'); } }); } function _bindFocusEvent() { var self = this; K(self.edit.textarea[0], self.edit.win).focus(function(e) { if (self.afterFocus) { self.afterFocus.call(self, e); } }).blur(function(e) { if (self.afterBlur) { self.afterBlur.call(self, e); } }); } function _removeBookmarkTag(html) { return _trim(html.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, '')); } function _removeTempTag(html) { return html.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig, ''); } function _addBookmarkToStack(stack, bookmark) { if (stack.length === 0) { stack.push(bookmark); return; } var prev = stack[stack.length - 1]; if (_removeBookmarkTag(bookmark.html) !== _removeBookmarkTag(prev.html)) { stack.push(bookmark); } } function _undoToRedo(fromStack, toStack) { var self = this, edit = self.edit, body = edit.doc.body, range, bookmark; if (fromStack.length === 0) { return self; } if (edit.designMode) { range = self.cmd.range; bookmark = range.createBookmark(true); bookmark.html = body.innerHTML; } else { bookmark = { html : body.innerHTML }; } _addBookmarkToStack(toStack, bookmark); var prev = fromStack.pop(); if (_removeBookmarkTag(bookmark.html) === _removeBookmarkTag(prev.html) && fromStack.length > 0) { prev = fromStack.pop(); } if (edit.designMode) { edit.html(prev.html); if (prev.start) { range.moveToBookmark(prev); self.select(); } } else { K(body).html(_removeBookmarkTag(prev.html)); } return self; } function KEditor(options) { var self = this; self.options = {}; function setOption(key, val) { if (KEditor.prototype[key] === undefined) { self[key] = val; } self.options[key] = val; } _each(options, function(key, val) { setOption(key, options[key]); }); _each(K.options, function(key, val) { if (self[key] === undefined) { setOption(key, val); } }); var se = K(self.srcElement || '<textarea/>'); if (!self.width) { self.width = se[0].style.width || se.width(); } if (!self.height) { self.height = se[0].style.height || se.height(); } setOption('width', _undef(self.width, self.minWidth)); setOption('height', _undef(self.height, self.minHeight)); setOption('width', _addUnit(self.width)); setOption('height', _addUnit(self.height)); if (_MOBILE && (!_IOS || _V < 534)) { self.designMode = false; } self.srcElement = se; self.initContent = ''; self.plugin = {}; self.isCreated = false; self._handlers = {}; self._contextmenus = []; self._undoStack = []; self._redoStack = []; self._firstAddBookmark = true; self.menu = self.contextmenu = null; self.dialogs = []; } KEditor.prototype = { lang : function(mixed) { return _lang(mixed, this.langType); }, loadPlugin : function(name, fn) { var self = this; if (_plugins[name]) { if (!_isFunction(_plugins[name])) { setTimeout(function() { self.loadPlugin(name, fn); }, 100); return self; } _plugins[name].call(self, KindEditor); if (fn) { fn.call(self); } return self; } _plugins[name] = 'loading'; _loadScript(self.pluginsPath + name + '/' + name + '.js?ver=' + encodeURIComponent(K.DEBUG ? _TIME : _VERSION), function() { setTimeout(function() { if (_plugins[name]) { self.loadPlugin(name, fn); } }, 0); }); return self; }, handler : function(key, fn) { var self = this; if (!self._handlers[key]) { self._handlers[key] = []; } if (_isFunction(fn)) { self._handlers[key].push(fn); return self; } _each(self._handlers[key], function() { fn = this.call(self, fn); }); return fn; }, clickToolbar : function(name, fn) { var self = this, key = 'clickToolbar' + name; if (fn === undefined) { if (self._handlers[key]) { return self.handler(key); } self.loadPlugin(name, function() { self.handler(key); }); return self; } return self.handler(key, fn); }, updateState : function() { var self = this; _each(('justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,' + 'subscript,superscript,bold,italic,underline,strikethrough').split(','), function(i, name) { self.cmd.state(name) ? self.toolbar.select(name) : self.toolbar.unselect(name); }); return self; }, addContextmenu : function(item) { this._contextmenus.push(item); return this; }, afterCreate : function(fn) { return this.handler('afterCreate', fn); }, beforeRemove : function(fn) { return this.handler('beforeRemove', fn); }, beforeGetHtml : function(fn) { return this.handler('beforeGetHtml', fn); }, beforeSetHtml : function(fn) { return this.handler('beforeSetHtml', fn); }, afterSetHtml : function(fn) { return this.handler('afterSetHtml', fn); }, create : function() { var self = this, fullscreenMode = self.fullscreenMode; if (self.isCreated) { return self; } if (self.srcElement.data('kindeditor')) { return self; } self.srcElement.data('kindeditor', 'true'); if (fullscreenMode) { _docElement().style.overflow = 'hidden'; } else { _docElement().style.overflow = ''; } var width = fullscreenMode ? _docElement().clientWidth + 'px' : self.width, height = fullscreenMode ? _docElement().clientHeight + 'px' : self.height; if ((_IE && _V < 8) || _QUIRKS) { height = _addUnit(_removeUnit(height) + 2); } var container = self.container = K(self.layout); if (fullscreenMode) { K(document.body).append(container); } else { self.srcElement.before(container); } var toolbarDiv = K('.toolbar', container), editDiv = K('.edit', container), statusbar = self.statusbar = K('.statusbar', container); container.removeClass('container') .addClass('ke-container ke-container-' + self.themeType).css('width', width); if (fullscreenMode) { container.css({ position : 'absolute', left : 0, top : 0, 'z-index' : 811211 }); if (!_GECKO) { self._scrollPos = _getScrollPos(); } window.scrollTo(0, 0); K(document.body).css({ 'height' : '1px', 'overflow' : 'hidden' }); K(document.body.parentNode).css('overflow', 'hidden'); self._fullscreenExecuted = true; } else { if (self._fullscreenExecuted) { K(document.body).css({ 'height' : '', 'overflow' : '' }); K(document.body.parentNode).css('overflow', ''); } if (self._scrollPos) { window.scrollTo(self._scrollPos.x, self._scrollPos.y); } } var htmlList = []; K.each(self.items, function(i, name) { if (name == '|') { htmlList.push('<span class="ke-inline-block ke-separator"></span>'); } else if (name == '/') { htmlList.push('<div class="ke-hr"></div>'); } else { htmlList.push('<span class="ke-outline" data-name="' + name + '" title="' + self.lang(name) + '" unselectable="on">'); htmlList.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-' + name + '" unselectable="on"></span></span>'); } }); var toolbar = self.toolbar = _toolbar({ src : toolbarDiv, html : htmlList.join(''), noDisableItems : self.noDisableItems, click : function(e, name) { e.stop(); if (self.menu) { var menuName = self.menu.name; self.hideMenu(); if (menuName === name) { return; } } self.clickToolbar(name); } }); var editHeight = _removeUnit(height) - toolbar.div.height(); var edit = self.edit = _edit({ height : editHeight > 0 && _removeUnit(height) > self.minHeight ? editHeight : self.minHeight, src : editDiv, srcElement : self.srcElement, designMode : self.designMode, themesPath : self.themesPath, bodyClass : self.bodyClass, cssPath : self.cssPath, cssData : self.cssData, beforeGetHtml : function(html) { html = self.beforeGetHtml(html); html = _removeBookmarkTag(_removeTempTag(html)); return _formatHtml(html, self.filterMode ? self.htmlTags : null, self.urlType, self.wellFormatMode, self.indentChar); }, beforeSetHtml : function(html) { html = _formatHtml(html, self.filterMode ? self.htmlTags : null, '', false); return self.beforeSetHtml(html); }, afterSetHtml : function() { self.edit = edit = this; self.afterSetHtml(); }, afterCreate : function() { self.edit = edit = this; self.cmd = edit.cmd; self._docMousedownFn = function(e) { if (self.menu) { self.hideMenu(); } }; K(edit.doc, document).mousedown(self._docMousedownFn); _bindContextmenuEvent.call(self); _bindNewlineEvent.call(self); _bindTabEvent.call(self); _bindFocusEvent.call(self); edit.afterChange(function(e) { if (!edit.designMode) { return; } self.updateState(); self.addBookmark(); if (self.options.afterChange) { self.options.afterChange.call(self); } }); edit.textarea.keyup(function(e) { if (!e.ctrlKey && !e.altKey && _INPUT_KEY_MAP[e.which]) { if (self.options.afterChange) { self.options.afterChange.call(self); } } }); if (self.readonlyMode) { self.readonly(); } self.isCreated = true; if (self.initContent === '') { self.initContent = self.html(); } if (self._undoStack.length > 0) { var prev = self._undoStack.pop(); if (prev.start) { self.html(prev.html); edit.cmd.range.moveToBookmark(prev); self.select(); } } self.afterCreate(); if (self.options.afterCreate) { self.options.afterCreate.call(self); } } }); statusbar.removeClass('statusbar').addClass('ke-statusbar') .append('<span class="ke-inline-block ke-statusbar-center-icon"></span>') .append('<span class="ke-inline-block ke-statusbar-right-icon"></span>'); if (self._fullscreenResizeHandler) { K(window).unbind('resize', self._fullscreenResizeHandler); self._fullscreenResizeHandler = null; } function initResize() { if (statusbar.height() === 0) { setTimeout(initResize, 100); return; } self.resize(width, height, false); } initResize(); if (fullscreenMode) { self._fullscreenResizeHandler = function(e) { if (self.isCreated) { self.resize(_docElement().clientWidth, _docElement().clientHeight, false); } }; K(window).bind('resize', self._fullscreenResizeHandler); toolbar.select('fullscreen'); statusbar.first().css('visibility', 'hidden'); statusbar.last().css('visibility', 'hidden'); } else { if (_GECKO) { K(window).bind('scroll', function(e) { self._scrollPos = _getScrollPos(); }); } if (self.resizeType > 0) { _drag({ moveEl : container, clickEl : statusbar, moveFn : function(x, y, width, height, diffX, diffY) { height += diffY; self.resize(null, height); } }); } else { statusbar.first().css('visibility', 'hidden'); } if (self.resizeType === 2) { _drag({ moveEl : container, clickEl : statusbar.last(), moveFn : function(x, y, width, height, diffX, diffY) { width += diffX; height += diffY; self.resize(width, height); } }); } else { statusbar.last().css('visibility', 'hidden'); } } return self; }, remove : function() { var self = this; if (!self.isCreated) { return self; } self.beforeRemove(); self.srcElement.data('kindeditor', ''); if (self.menu) { self.hideMenu(); } _each(self.dialogs, function() { self.hideDialog(); }); K(document).unbind('mousedown', self._docMousedownFn); self.toolbar.remove(); self.edit.remove(); self.statusbar.last().unbind(); self.statusbar.unbind(); self.container.remove(); self.container = self.toolbar = self.edit = self.menu = null; self.dialogs = []; self.isCreated = false; return self; }, resize : function(width, height, updateProp) { var self = this; updateProp = _undef(updateProp, true); if (width) { if (!/%/.test(width)) { width = _removeUnit(width); width = width < self.minWidth ? self.minWidth : width; } self.container.css('width', _addUnit(width)); if (updateProp) { self.width = _addUnit(width); } } if (height) { height = _removeUnit(height); editHeight = _removeUnit(height) - self.toolbar.div.height() - self.statusbar.height(); editHeight = editHeight < self.minHeight ? self.minHeight : editHeight; self.edit.setHeight(editHeight); if (updateProp) { self.height = _addUnit(height); } } return self; }, select : function() { this.isCreated && this.cmd.select(); return this; }, html : function(val) { var self = this; if (val === undefined) { return self.isCreated ? self.edit.html() : _elementVal(self.srcElement); } self.isCreated ? self.edit.html(val) : _elementVal(self.srcElement, val); if (self.isCreated) { self.cmd.selection(); } return self; }, fullHtml : function() { return this.isCreated ? this.edit.html(undefined, true) : ''; }, text : function(val) { var self = this; if (val === undefined) { return _trim(self.html().replace(/<(?!img|embed|video).*?>/ig, '').replace(/&nbsp;/ig, ' ')); } else { return self.html(_escape(val)); } }, isEmpty : function() { return _trim(this.text().replace(/\r\n|\n|\r/, '')) === ''; }, isDirty : function() { return _trim(this.initContent.replace(/\r\n|\n|\r|t/g, '')) !== _trim(this.html().replace(/\r\n|\n|\r|t/g, '')); }, selectedHtml : function() { var val = this.isCreated ? this.cmd.range.html() : ''; val = _removeBookmarkTag(_removeTempTag(val)); return val; }, count : function(mode) { var self = this; mode = (mode || 'html').toLowerCase(); if (mode === 'html') { return self.html().length; } if (mode === 'text') { return self.text().replace(/<(?:img|embed|video).*?>/ig, 'K').replace(/\r\n|\n|\r/g, '').length; } return 0; }, exec : function(key) { key = key.toLowerCase(); var self = this, cmd = self.cmd, changeFlag = _inArray(key, 'selectall,copy,paste,print'.split(',')) < 0; if (changeFlag) { self.addBookmark(false); } cmd[key].apply(cmd, _toArray(arguments, 1)); if (changeFlag) { self.updateState(); self.addBookmark(false); if (self.options.afterChange) { self.options.afterChange.call(self); } } return self; }, insertHtml : function(val, quickMode) { if (!this.isCreated) { return this; } val = this.beforeSetHtml(val); this.exec('inserthtml', val, quickMode); return this; }, appendHtml : function(val) { this.html(this.html() + val); if (this.isCreated) { var cmd = this.cmd; cmd.range.selectNodeContents(cmd.doc.body).collapse(false); cmd.select(); } return this; }, sync : function() { _elementVal(this.srcElement, this.html()); return this; }, focus : function() { this.isCreated ? this.edit.focus() : this.srcElement[0].focus(); return this; }, blur : function() { this.isCreated ? this.edit.blur() : this.srcElement[0].blur(); return this; }, addBookmark : function(checkSize) { checkSize = _undef(checkSize, true); var self = this, edit = self.edit, body = edit.doc.body, html = _removeTempTag(body.innerHTML), bookmark; if (checkSize && self._undoStack.length > 0) { var prev = self._undoStack[self._undoStack.length - 1]; if (Math.abs(html.length - _removeBookmarkTag(prev.html).length) < self.minChangeSize) { return self; } } if (edit.designMode && !self._firstAddBookmark) { var range = self.cmd.range; bookmark = range.createBookmark(true); bookmark.html = _removeTempTag(body.innerHTML); range.moveToBookmark(bookmark); } else { bookmark = { html : html }; } self._firstAddBookmark = false; _addBookmarkToStack(self._undoStack, bookmark); return self; }, undo : function() { return _undoToRedo.call(this, this._undoStack, this._redoStack); }, redo : function() { return _undoToRedo.call(this, this._redoStack, this._undoStack); }, fullscreen : function(bool) { this.fullscreenMode = (bool === undefined ? !this.fullscreenMode : bool); this.addBookmark(false); return this.remove().create(); }, readonly : function(isReadonly) { isReadonly = _undef(isReadonly, true); var self = this, edit = self.edit, doc = edit.doc; if (self.designMode) { self.toolbar.disableAll(isReadonly, []); } else { _each(self.noDisableItems, function() { self.toolbar[isReadonly ? 'disable' : 'enable'](this); }); } if (_IE) { doc.body.contentEditable = !isReadonly; } else { doc.designMode = isReadonly ? 'off' : 'on'; } edit.textarea[0].disabled = isReadonly; }, createMenu : function(options) { var self = this, name = options.name, knode = self.toolbar.get(name), pos = knode.pos(); options.x = pos.x; options.y = pos.y + knode.height(); options.z = self.options.zIndex; options.shadowMode = _undef(options.shadowMode, self.shadowMode); if (options.selectedColor !== undefined) { options.cls = 'ke-colorpicker-' + self.themeType; options.noColor = self.lang('noColor'); self.menu = _colorpicker(options); } else { options.cls = 'ke-menu-' + self.themeType; options.centerLineMode = false; self.menu = _menu(options); } return self.menu; }, hideMenu : function() { this.menu.remove(); this.menu = null; return this; }, hideContextmenu : function() { this.contextmenu.remove(); this.contextmenu = null; return this; }, createDialog : function(options) { var self = this, name = options.name; options.z = self.options.zIndex; options.shadowMode = _undef(options.shadowMode, self.shadowMode); options.closeBtn = _undef(options.closeBtn, { name : self.lang('close'), click : function(e) { self.hideDialog(); if (_IE && self.cmd) { self.cmd.select(); } } }); options.noBtn = _undef(options.noBtn, { name : self.lang(options.yesBtn ? 'no' : 'close'), click : function(e) { self.hideDialog(); if (_IE && self.cmd) { self.cmd.select(); } } }); if (self.dialogAlignType != 'page') { options.alignEl = self.container; } options.cls = 'ke-dialog-' + self.themeType; if (self.dialogs.length > 0) { var firstDialog = self.dialogs[0], parentDialog = self.dialogs[self.dialogs.length - 1]; firstDialog.setMaskIndex(parentDialog.z + 2); options.z = parentDialog.z + 3; options.showMask = false; } var dialog = _dialog(options); self.dialogs.push(dialog); return dialog; }, hideDialog : function() { var self = this; if (self.dialogs.length > 0) { self.dialogs.pop().remove(); } if (self.dialogs.length > 0) { var firstDialog = self.dialogs[0], parentDialog = self.dialogs[self.dialogs.length - 1]; firstDialog.setMaskIndex(parentDialog.z - 1); } return self; }, errorDialog : function(html) { var self = this; var dialog = self.createDialog({ width : 750, title : self.lang('uploadError'), body : '<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"></iframe></div>' }); var iframe = K('iframe', dialog.div), doc = K.iframeDoc(iframe); doc.open(); doc.write(html); doc.close(); K(doc.body).css('background-color', '#FFF'); iframe[0].contentWindow.focus(); return self; } }; function _editor(options) { return new KEditor(options); } _instances = []; function _create(expr, options) { options = options || {}; options.basePath = _undef(options.basePath, K.basePath); options.themesPath = _undef(options.themesPath, options.basePath + 'themes/'); options.langPath = _undef(options.langPath, options.basePath + 'lang/'); options.pluginsPath = _undef(options.pluginsPath, options.basePath + 'plugins/'); if (_undef(options.loadStyleMode, K.options.loadStyleMode)) { var themeType = _undef(options.themeType, K.options.themeType); _loadStyle(options.themesPath + 'default/default.css'); _loadStyle(options.themesPath + themeType + '/' + themeType + '.css'); } function create(editor) { _each(_plugins, function(name, fn) { if (_isFunction(fn)) { fn.call(editor, KindEditor); } }); return editor.create(); } var knode = K(expr); if (!knode || knode.length === 0) { return; } if (knode.length > 1) { knode.each(function() { _create(this, options); }); return _instances[0]; } options.srcElement = knode[0]; var editor = new KEditor(options); _instances.push(editor); if (_language[editor.langType]) { return create(editor); } _loadScript(editor.langPath + editor.langType + '.js?ver=' + encodeURIComponent(K.DEBUG ? _TIME : _VERSION), function() { create(editor); }); return editor; } function _eachEditor(expr, fn) { K(expr).each(function(i, el) { K.each(_instances, function(j, editor) { if (editor && editor.srcElement[0] == el) { fn.call(editor, j); return false; } }); }); } K.remove = function(expr) { _eachEditor(expr, function(i) { this.remove(); _instances.splice(i, 1); }); }; K.sync = function(expr) { _eachEditor(expr, function() { this.sync(); }); }; K.html = function(expr, val) { _eachEditor(expr, function() { this.html(val); }); }; K.insertHtml = function(expr, val) { _eachEditor(expr, function() { this.insertHtml(val); }); }; K.appendHtml = function(expr, val) { _eachEditor(expr, function() { this.appendHtml(val); }); }; if (_IE && _V < 7) { _nativeCommand(document, 'BackgroundImageCache', true); } K.EditorClass = KEditor; K.editor = _editor; K.create = _create; K.instances = _instances; K.plugin = _plugin; K.lang = _lang; _plugin('core', function(K) { var self = this, shortcutKeys = { undo : 'Z', redo : 'Y', bold : 'B', italic : 'I', underline : 'U', print : 'P', selectall : 'A' }; self.afterSetHtml(function() { if (self.options.afterChange) { self.options.afterChange.call(self); } }); self.afterCreate(function() { if (self.syncType != 'form') { return; } var el = K(self.srcElement), hasForm = false; while ((el = el.parent())) { if (el.name == 'form') { hasForm = true; break; } } if (hasForm) { el.bind('submit', function(e) { self.sync(); K(window).bind('unload', function() { self.edit.textarea.remove(); }); }); var resetBtn = K('[type="reset"]', el); resetBtn.click(function() { self.html(self.initContent); self.cmd.selection(); }); self.beforeRemove(function() { el.unbind(); resetBtn.unbind(); }); } }); self.clickToolbar('source', function() { if (self.edit.designMode) { self.toolbar.disableAll(true); self.edit.design(false); self.toolbar.select('source'); } else { self.toolbar.disableAll(false); self.edit.design(true); self.toolbar.unselect('source'); if (_GECKO) { setTimeout(function() { self.cmd.selection(); }, 0); } else { self.cmd.selection(); } } self.designMode = self.edit.designMode; }); self.afterCreate(function() { if (!self.designMode) { self.toolbar.disableAll(true).select('source'); } }); self.clickToolbar('fullscreen', function() { self.fullscreen(); }); if (self.fullscreenShortcut) { var loaded = false; self.afterCreate(function() { K(self.edit.doc, self.edit.textarea).keyup(function(e) { if (e.which == 27) { setTimeout(function() { self.fullscreen(); }, 0); } }); if (loaded) { if (_IE && !self.designMode) { return; } self.focus(); } if (!loaded) { loaded = true; } }); } _each('undo,redo'.split(','), function(i, name) { if (shortcutKeys[name]) { self.afterCreate(function() { _ctrl(this.edit.doc, shortcutKeys[name], function() { self.clickToolbar(name); }); }); } self.clickToolbar(name, function() { self[name](); }); }); self.clickToolbar('formatblock', function() { var blocks = self.lang('formatblock.formatBlock'), heights = { h1 : 28, h2 : 24, h3 : 18, H4 : 14, p : 12 }, curVal = self.cmd.val('formatblock'), menu = self.createMenu({ name : 'formatblock', width : self.langType == 'en' ? 200 : 150 }); _each(blocks, function(key, val) { var style = 'font-size:' + heights[key] + 'px;'; if (key.charAt(0) === 'h') { style += 'font-weight:bold;'; } menu.addItem({ title : '<span style="' + style + '" unselectable="on">' + val + '</span>', height : heights[key] + 12, checked : (curVal === key || curVal === val), click : function() { self.select().exec('formatblock', '<' + key + '>').hideMenu(); } }); }); }); self.clickToolbar('fontname', function() { var curVal = self.cmd.val('fontname'), menu = self.createMenu({ name : 'fontname', width : 150 }); _each(self.lang('fontname.fontName'), function(key, val) { menu.addItem({ title : '<span style="font-family: ' + key + ';" unselectable="on">' + val + '</span>', checked : (curVal === key.toLowerCase() || curVal === val.toLowerCase()), click : function() { self.exec('fontname', key).hideMenu(); } }); }); }); self.clickToolbar('fontsize', function() { var curVal = self.cmd.val('fontsize'), menu = self.createMenu({ name : 'fontsize', width : 150 }); _each(self.fontSizeTable, function(i, val) { menu.addItem({ title : '<span style="font-size:' + val + ';" unselectable="on">' + val + '</span>', height : _removeUnit(val) + 12, checked : curVal === val, click : function() { self.exec('fontsize', val).hideMenu(); } }); }); }); _each('forecolor,hilitecolor'.split(','), function(i, name) { self.clickToolbar(name, function() { self.createMenu({ name : name, selectedColor : self.cmd.val(name) || 'default', colors : self.colorTable, click : function(color) { self.exec(name, color).hideMenu(); } }); }); }); _each(('cut,copy,paste').split(','), function(i, name) { self.clickToolbar(name, function() { self.focus(); try { self.exec(name, null); } catch(e) { alert(self.lang(name + 'Error')); } }); }); self.clickToolbar('about', function() { var html = '<div style="margin:20px;">' + '<div>KindEditor ' + _VERSION + '</div>' + '<div>Copyright &copy; <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div>' + '</div>'; self.createDialog({ name : 'about', width : 350, title : self.lang('about'), body : html }); }); self.plugin.getSelectedLink = function() { return self.cmd.commonAncestor('a'); }; self.plugin.getSelectedImage = function() { return _getImageFromRange(self.edit.cmd.range, function(img) { return !/^ke-\w+$/i.test(img[0].className); }); }; self.plugin.getSelectedFlash = function() { return _getImageFromRange(self.edit.cmd.range, function(img) { return img[0].className == 'ke-flash'; }); }; self.plugin.getSelectedMedia = function() { return _getImageFromRange(self.edit.cmd.range, function(img) { return img[0].className == 'ke-media' || img[0].className == 'ke-rm'; }); }; self.plugin.getSelectedAnchor = function() { return _getImageFromRange(self.edit.cmd.range, function(img) { return img[0].className == 'ke-anchor'; }); }; _each('link,image,flash,media,anchor'.split(','), function(i, name) { var uName = name.charAt(0).toUpperCase() + name.substr(1); _each('edit,delete'.split(','), function(j, val) { self.addContextmenu({ title : self.lang(val + uName), click : function() { self.loadPlugin(name, function() { self.plugin[name][val](); self.hideMenu(); }); }, cond : self.plugin['getSelected' + uName], width : 150, iconClass : val == 'edit' ? 'ke-icon-' + name : undefined }); }); self.addContextmenu({ title : '-' }); }); self.plugin.getSelectedTable = function() { return self.cmd.commonAncestor('table'); }; self.plugin.getSelectedRow = function() { return self.cmd.commonAncestor('tr'); }; self.plugin.getSelectedCell = function() { return self.cmd.commonAncestor('td'); }; _each(('prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,' + 'rowsplit,colsplit,coldelete,rowdelete,insert,delete').split(','), function(i, val) { var cond = _inArray(val, ['prop', 'delete']) < 0 ? self.plugin.getSelectedCell : self.plugin.getSelectedTable; self.addContextmenu({ title : self.lang('table' + val), click : function() { self.loadPlugin('table', function() { self.plugin.table[val](); self.hideMenu(); }); }, cond : cond, width : 170, iconClass : 'ke-icon-table' + val }); }); self.addContextmenu({ title : '-' }); _each(('selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,' + 'insertunorderedlist,indent,outdent,subscript,superscript,hr,print,' + 'bold,italic,underline,strikethrough,removeformat,unlink').split(','), function(i, name) { if (shortcutKeys[name]) { self.afterCreate(function() { _ctrl(this.edit.doc, shortcutKeys[name], function() { self.cmd.selection(); self.clickToolbar(name); }); }); } self.clickToolbar(name, function() { self.focus().exec(name, null); }); }); self.afterCreate(function() { var doc = self.edit.doc, cmd, bookmark, div, cls = '__kindeditor_paste__', pasting = false; function movePastedData() { cmd.range.moveToBookmark(bookmark); cmd.select(); if (_WEBKIT) { K('div.' + cls, div).each(function() { K(this).after('<br />').remove(true); }); K('span.Apple-style-span', div).remove(true); K('span.Apple-tab-span', div).remove(true); K('span[style]', div).each(function() { if (K(this).css('white-space') == 'nowrap') { K(this).remove(true); } }); K('meta', div).remove(); } var html = div[0].innerHTML; div.remove(); if (html === '') { return; } if (_WEBKIT) { html = html.replace(/(<br>)\1/ig, '$1'); } if (self.pasteType === 2) { html = html.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig, ''); if (/schemas-microsoft-com|worddocument|mso-\w+/i.test(html)) { html = _clearMsWord(html, self.filterMode ? self.htmlTags : K.options.htmlTags); } else { html = _formatHtml(html, self.filterMode ? self.htmlTags : null); html = self.beforeSetHtml(html); } } if (self.pasteType === 1) { html = html.replace(/&nbsp;/ig, ' '); html = html.replace(/\n\s*\n/g, '\n'); html = html.replace(/<br[^>]*>/ig, '\n'); html = html.replace(/<\/p><p[^>]*>/ig, '\n'); html = html.replace(/<[^>]+>/g, ''); html = html.replace(/ {2}/g, ' &nbsp;'); if (self.newlineTag == 'p') { if (/\n/.test(html)) { html = html.replace(/^/, '<p>').replace(/$/, '<br /></p>').replace(/\n/g, '<br /></p><p>'); } } else { html = html.replace(/\n/g, '<br />$&'); } } self.insertHtml(html, true); } K(doc.body).bind('paste', function(e){ if (self.pasteType === 0) { e.stop(); return; } if (pasting) { return; } pasting = true; K('div.' + cls, doc).remove(); cmd = self.cmd.selection(); bookmark = cmd.range.createBookmark(); div = K('<div class="' + cls + '"></div>', doc).css({ position : 'absolute', width : '1px', height : '1px', overflow : 'hidden', left : '-1981px', top : K(bookmark.start).pos().y + 'px', 'white-space' : 'nowrap' }); K(doc.body).append(div); if (_IE) { var rng = cmd.range.get(true); rng.moveToElementText(div[0]); rng.select(); rng.execCommand('paste'); e.preventDefault(); } else { cmd.range.selectNodeContents(div[0]); cmd.select(); } setTimeout(function() { movePastedData(); pasting = false; }, 0); }); }); self.beforeGetHtml(function(html) { if (_IE && _V <= 8) { html = html.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig, function(full, tag) { return unescape(tag); }); html = html.replace(/(<input)((?:\s+[^>]*)?>)/ig, function($0, $1, $2) { if (!/\s+type="[^"]+"/i.test($0)) { return $1 + ' type="text"' + $2; } return $0; }); } return html.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig, function($0, $1, $2, $3) { return $1 + _unescape($2).replace(/\s+/g, ' ') + $3; }) .replace(/<img[^>]*class="?ke-(flash|rm)"?[^>]*>/ig, function(full) { var imgAttrs = _getAttrList(full); var styles = _getCssList(imgAttrs.style || ''); var attrs = _mediaAttrs(imgAttrs['data-ke-tag']); var width = _undef(styles.width, ''); var height = _undef(styles.height, ''); if (/px/i.test(width)) { width = _removeUnit(width); } if (/px/i.test(height)) { height = _removeUnit(height); } attrs.width = _undef(imgAttrs.width, width); attrs.height = _undef(imgAttrs.height, height); return _mediaEmbed(attrs); }) //add by tinfu .replace(/<img[^>]*class="?ke-(media)"?[^>]*>/ig, function(full) { var imgAttrs = _getAttrList(full); var styles = _getCssList(imgAttrs.style || ''); var attrs = _mediaAttrs(imgAttrs['data-ke-tag']); var width = _undef(styles.width, ''); var height = _undef(styles.height, ''); if (/px/i.test(width)) { width = _removeUnit(width); } if (/px/i.test(height)) { height = _removeUnit(height); } attrs.width = _undef(imgAttrs.width, width); attrs.height = _undef(imgAttrs.height, height); return _videoEmbed(attrs); }) //add by tinfu .replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) { var imgAttrs = _getAttrList(full); return '<a name="' + unescape(imgAttrs['data-ke-name']) + '"></a>'; }) .replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig, function(full, attr, code) { return '<script' + unescape(attr) + '>' + unescape(code) + '</script>'; }) .replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig, function(full, attr, code) { return '<noscript' + unescape(attr) + '>' + unescape(code) + '</noscript>'; }) .replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig, function(full, start, src, end) { full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, function($0, $1, $2) { return $1 + _unescape(src) + $2; }); full = full.replace(/\s+data-ke-src="[^"]*"/i, ''); return full; }) .replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) { return start + end; }); }); self.beforeSetHtml(function(html) { if (_IE && _V <= 8) { html = html.replace(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig, function(full) { var attrs = _getAttrList(full); var styles = _getCssList(attrs.style || ''); if (styles.display == 'none') { return '<div class="ke-display-none" data-ke-input-tag="' + escape(full) + '"></div>'; } return full; }); } // console.log(html); return html.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig, function(full) { var attrs = _getAttrList(full); attrs.src = _undef(attrs.src, ''); attrs.width = _undef(attrs.width, 0); attrs.height = _undef(attrs.height, 0); return _mediaImg(self.themesPath + 'common/blank.gif', attrs); }) //add by tinfu .replace(/<div[^>]*>[^<]*<script[^>]*src="([^"]+)">(<\/script>[^<]*<\/div>)?/ig, function(full) { var attrs = _getAttrList(full); attrs.src = _undef(attrs.src, ''); attrs.width = _undef(attrs.width, 0); attrs.height = _undef(attrs.height, 0); return _mediaImg(self.themesPath + 'common/blank.gif', attrs); }) //add by tinfu .replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig, function(full) { var attrs = _getAttrList(full); if (attrs.href !== undefined) { return full; } return '<img class="ke-anchor" src="' + self.themesPath + 'common/anchor.gif" data-ke-name="' + escape(attrs.name) + '" />'; }) .replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig, function(full, attr, code) { return '<div class="ke-script" data-ke-script-attr="' + escape(attr) + '">' + escape(code) + '</div>'; }) .replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/ig, function(full, attr, code) { return '<div class="ke-noscript" data-ke-noscript-attr="' + escape(attr) + '">' + escape(code) + '</div>'; }) .replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig, function(full, start, key, src, end) { if (full.match(/\sdata-ke-src="[^"]*"/i)) { return full; } full = start + key + '="' + src + '"' + ' data-ke-src="' + _escape(src) + '"' + end; return full; }) .replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) { return start + 'data-ke-' + end; }) .replace(/<table[^>]*\s+border="0"[^>]*>/ig, function(full) { if (full.indexOf('ke-zeroborder') >= 0) { return full; } return _addClassToTag(full, 'ke-zeroborder'); }); }); }); })(window);
tinfuChan/kindeditor
kindeditor.js
JavaScript
lgpl-2.1
162,683
/** ** Execbox.cc - Execute a command-line program and display its output. ** ** Written: 10/02/02 - JSF **/ /* Copyright (C) 2002 The Exult Team 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include "execbox.h" #include <iostream> /* Debugging only */ #include <string> #include <cstring> #include <cstdlib> using std::cout; using std::endl; #ifndef WIN32 #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #include <unistd.h> #include <signal.h> #include <sys/wait.h> /* * Create. */ Exec_process::Exec_process ( ) : child_stdin(-1), child_stdout(-1), child_stderr(-1), child_pid(-1), stdout_tag(-1), stderr_tag(-1), reader(0) { } /* * Clean up. */ Exec_process::~Exec_process ( ) { kill_child(); } /* * End process and close pipes. */ void Exec_process::kill_child ( ) { if (child_pid > 0) kill(child_pid, SIGINT); if (child_stdin >= 0) close(child_stdin); if (child_stdout >= 0) close(child_stdout); if (child_stderr >= 0) close(child_stderr); if (stdout_tag >= 0) gdk_input_remove(stdout_tag); if (stderr_tag >= 0) gdk_input_remove(stderr_tag); child_pid = child_stdin = child_stdout = child_stderr = stdout_tag = stderr_tag = -1; } /* * Read from child & call client routine. */ static void Read_from_child ( gpointer data, // ->Exex_process gint id, // Pipe ID. GdkInputCondition condition ) { Exec_process *ex = (Exec_process *) data; ex->read_from_child(id); } void Exec_process::read_from_child ( int id // Pipe to read from. ) { char buf[1024]; int len; while ((len = read(id, buf, sizeof(buf))) > 0) if (reader) (*reader)(buf, len, 0, reader_data); int exit_code; if (!check_child(exit_code)) // Child done? { kill_child(); // Clean up. if (reader) // Tell client. (*reader)(0, 0, exit_code, reader_data); } } /* * Close a pipe. */ inline void Close_pipe ( int p[2] ) { if (p[0] >= 0) close(p[0]); if (p[1] >= 0) close(p[1]); } /* * Close 3 sets of pipes. */ static void Close_pipes ( int p0[2], int p1[2], int p2[2] ) { Close_pipe(p0); Close_pipe(p1); Close_pipe(p2); } /* * Execute a new process. * * Output: False if failed. */ bool Exec_process::exec ( const char *file, // PATH will be searched. char *argv[], // Args. 1st is filename, last is 0. Reader_fun rfun, // Called when child writes, exits. void *udata // User_data for rfun. ) { reader = rfun; // Store callback. reader_data = udata; // Pipes for talking to child: int stdin_pipe[2], stdout_pipe[2], stderr_pipe[2]; stdin_pipe[0] = stdin_pipe[1] = stdout_pipe[0] = stdout_pipe[1] = stderr_pipe[0] = stderr_pipe[1] = -1; kill_child(); // Kill running process. // Create pipes. if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0 || pipe(stderr_pipe) != 0) { // Error. Close_pipes(stdin_pipe, stdout_pipe, stderr_pipe); return false; } child_pid = fork(); // Split in two. if (child_pid == -1) // Failed? { Close_pipes(stdin_pipe, stdout_pipe, stderr_pipe); return false; } if (child_pid == 0) // Are we the child? { close(0); // Want to read from the pipe. dup(stdin_pipe[0]); Close_pipe(stdin_pipe); // Done with these. close(1); // Write to stdout through pipe. dup(stdout_pipe[1]); Close_pipe(stdout_pipe); close(2); // Write to stderr through pipe. dup(stderr_pipe[1]); Close_pipe(stderr_pipe); execvp(file, argv); // Become the new command. exit(-1); // Gets here if exec failed. } // HERE, we're the parent. child_stdin = stdin_pipe[1]; // Writing here goes to child stdin. close(stdin_pipe[0]); child_stdout = stdout_pipe[0]; // This gets child's stdout. close(stdout_pipe[1]); child_stderr = stderr_pipe[0]; close(stderr_pipe[1]); cout << "Child_stdout is " << child_stdout << ", Child_stderr is " << child_stderr << endl; stdout_tag = gdk_input_add(child_stdout, GDK_INPUT_READ, Read_from_child, this); stderr_tag = gdk_input_add(child_stderr, GDK_INPUT_READ, Read_from_child, this); return true; } /* * See if child is still alive. * * Output: True if child is still running. * If false, exit code is returned in 'exit_code'. */ bool Exec_process::check_child ( int& exit_code // Exit code returned. ) { if (child_pid < 0) return false; // No child. int status; // Don't wait. int ret = waitpid(child_pid, &status, WNOHANG); if (ret != child_pid) return true; // Still running. else { cout << "Exec_box: Child done." << endl; exit_code = WIFEXITED(status) ? WEXITSTATUS(status) : -1; return false; } } #endif /* * Create. */ Exec_box::Exec_box ( GtkTextView *b, GtkStatusbar *s, Exec_done_fun dfun, // Called when child exits. gpointer udata // Passed to dfun. ) : box(b), status(s), done_fun(dfun), user_data(udata) { executor = new Exec_process; status_ctx = gtk_statusbar_get_context_id(status, "execstatus"); // Keep one msg. always on stack. gtk_statusbar_push(status, status_ctx, ""); } /* * Close. */ Exec_box::~Exec_box ( ) { delete executor; // Kills child. } /* * Show status. */ void Exec_box::show_status ( const char *msg ) { gtk_statusbar_pop(status, status_ctx); gtk_statusbar_push(status, status_ctx, msg); } /* * Read from child & display in the text box. */ static void Exec_callback ( char *data, // Data read, or NULL. int datalen, // Length, or 0 if child exited. int exit_code, // Exit code if datalen = 0. void *user_data // ->Exex_box ) { Exec_box *box = (Exec_box *) user_data; box->read_from_child(data, datalen, exit_code); } void Exec_box::read_from_child ( char *data, // Data read, or NULL. int datalen, // Length, or 0 if child exited. int exit_code // Exit code if datalen = 0. ) { if (datalen > 0) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); gtk_text_buffer_insert_at_cursor(buffer,data,datalen); return; } if (exit_code == 0) // Child is done, so check result. show_status("Done: Success"); else show_status("Done: Errors occurred"); if (done_fun) done_fun(exit_code, this, user_data); } /* * Add a message to the box. */ void Exec_box::add_message ( const char *txt ) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); gtk_text_buffer_insert_at_cursor(buffer,txt,strlen(txt)); } /* * Execute a new process. * * Output: False if failed. */ bool Exec_box::exec ( const char *file, // PATH will be searched. char *argv[] // Args. 1st is filename, last is 0. ) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); gtk_text_buffer_set_text(buffer, "", 0); // Clear out old text if (!executor->exec(file, argv, Exec_callback, this)) return false; return true; } /* * End process. */ void Exec_box::kill_child ( ) { executor->kill_child(); }
twinaphex/sdcell
appport/exult/mapedit/execbox.cc
C++
lgpl-2.1
7,516
// $HeadURL: // /cvsroot/deegree/src/org/deegree/ogcwebservices/csw/capabilities/CatalogCapabilitiesDocument.java,v // 1.22 2004/08/05 15:40:08 ap Exp $ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ Copyright (C) 2001-2009 by: Department of Geography, University of Bonn and lat/lon GmbH 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 Contact information: lat/lon GmbH Aennchenstr. 19, 53177 Bonn Germany http://lat-lon.de/ Department of Geography, University of Bonn Prof. Dr. Klaus Greve Postfach 1147, 53001 Bonn Germany http://www.geographie.uni-bonn.de/deegree/ e-mail: info@deegree.org ----------------------------------------------------------------------------*/ package org.deegree.ogcwebservices.wass.common; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.List; import org.deegree.datatypes.Code; import org.deegree.datatypes.xlink.SimpleLink; import org.deegree.framework.xml.XMLParsingException; import org.deegree.framework.xml.XMLTools; import org.deegree.i18n.Messages; import org.deegree.model.metadata.iso19115.Keywords; import org.deegree.ogcbase.CommonNamespaces; import org.deegree.ogcwebservices.getcapabilities.DCPType; import org.deegree.ogcwebservices.getcapabilities.InvalidCapabilitiesException; import org.deegree.ogcwebservices.getcapabilities.ServiceIdentification; import org.deegree.ogcwebservices.getcapabilities.ServiceProvider; import org.deegree.owscommon.OWSCommonCapabilitiesDocument; import org.deegree.owscommon.OWSDomainType; import org.deegree.owscommon.OWSMetadata; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.SAXException; /** * The owscapabilities 1.0 specification parser. This class is able to parse the changes made in the * ows capabilites specifications 1.0. * * * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a> * @author last edited by: $Author$ * * @version $Revision$, $Date$ */ public abstract class OWSCapabilitiesBaseDocument_1_0 extends OWSCommonCapabilitiesDocument { private static final long serialVersionUID = -3518136831402464466L; private static final String PRE = CommonNamespaces.OWS_PREFIX + ":"; /** * Creates an empty document loaded from the template given. * * @param template * the location/name of the template * @throws IOException * @throws SAXException */ public void createEmptyDocument( String template ) throws IOException, SAXException { URL url = OWSCapabilitiesBaseDocument_1_0.class.getResource( template ); if ( url == null ) { throw new IOException( Messages.getMessage( "WASS_ERROR_RESOURCE_NOT_FOUND", template ) ); } load( url ); } /** * Returns the class representation for the <code>ServiceIdentification</code> section of the * document, according to the ows 1.0 spec. * * @return class representation for the <code>ServiceIdentification</code> section * @throws XMLParsingException */ public ServiceIdentification parseServiceIdentification() throws XMLParsingException { Element element = (Element) XMLTools.getRequiredNode( getRootElement(), PRE + "ServiceIdentification", nsContext ); // 'ServiceType' element (mandatory) Element serviceTypeElement = (Element) XMLTools.getRequiredNode( element, PRE + "ServiceType", nsContext ); Code serviceType = null; try { String codeSpace = XMLTools.getAttrValue( serviceTypeElement, null, "codeSpace", null ); URI uri = codeSpace != null ? new URI( codeSpace ) : null; serviceType = new Code( XMLTools.getStringValue( serviceTypeElement ), uri ); } catch ( URISyntaxException e ) { String s = XMLTools.getAttrValue( serviceTypeElement, null, "codeSpace", null ); throw new XMLParsingException( Messages.getMessage( "WASS_ERROR_CODESPACE_NOT_URI", new Object[] { s, OWSNS.toString() } ) ); } // 'ServiceTypeVersion' elements (mandatory) String[] serviceTypeVersions = XMLTools.getRequiredNodeAsStrings( element, PRE + "ServiceTypeVersion", nsContext, ",;" ); // 'Title' element (optional) String title = XMLTools.getNodeAsString( element, PRE + "Title", nsContext, Messages.getMessage( "WASS_NO_TITLE" ) ); // 'Abstract' element (optional) String serviceAbstract = XMLTools.getNodeAsString( element, PRE + "Abstract", nsContext, Messages.getMessage( "WASS_NO_ABSTRACT_DOCUMENTATION" ) ); // 'Keywords' elements (optional) List<Node> keywordsList = XMLTools.getNodes( element, PRE + "Keywords", nsContext ); Keywords[] keywords = getKeywords( keywordsList ); // 'Fees' element (optional) String fees = XMLTools.getNodeAsString( element, PRE + "Fees", nsContext, null ); // 'AccessConstraints' elements (optional) String[] accessConstraints = XMLTools.getNodesAsStrings( element, PRE + "AccessConstraints", nsContext ); ServiceIdentification serviceIdentification = new ServiceIdentification( serviceType, serviceTypeVersions, title, serviceAbstract, keywords, fees, accessConstraints ); return serviceIdentification; } /** * Wrapper to make it consistent. * * @return the ServiceProvider representation * @throws XMLParsingException */ public ServiceProvider parseServiceProvider() throws XMLParsingException { return getServiceProvider(); } /** * @return the OperationsMetada representation * @throws XMLParsingException * @throws InvalidCapabilitiesException * @throws URISyntaxException */ public OperationsMetadata_1_0 parseOperationsMetadata() throws XMLParsingException, InvalidCapabilitiesException, URISyntaxException { Element root = (Element) XMLTools.getRequiredNode( getRootElement(), PRE + "OperationsMetadata", nsContext ); ArrayList<Operation_1_0> operations = new ArrayList<Operation_1_0>(); List<Node> nl = XMLTools.getRequiredNodes( root, PRE + "Operation", nsContext ); for ( int i = 0; i < nl.size(); ++i ) { operations.add( parseOperation( (Element) nl.get( i ) ) ); } List<Node> parameterList = XMLTools.getNodes( root, PRE + "Parameter", nsContext ); OWSDomainType[] parameters = new OWSDomainType[parameterList.size()]; for ( int i = 0; i < parameters.length; i++ ) { parameters[i] = parseOWSDomainType_1_0( (Element) parameterList.get( i ) ); } List<Node> constraintList = XMLTools.getNodes( root, PRE + "Constraint", nsContext ); OWSDomainType[] constraints = new OWSDomainType[constraintList.size()]; for ( int i = 0; i < constraints.length; i++ ) { constraints[i] = parseOWSDomainType_1_0( (Element) constraintList.get( i ) ); } String extendedCapabilities = XMLTools.getNodeAsString( root, PRE + "ExtendedCapabilities", nsContext, null ); // find the !not specified in the gdinrw! describeuser Operation_1_0 describeUser = null; // and find the GetCapabilities operation too. Operation_1_0 getCapa = null; for ( int i = 0; i < operations.size(); ++i ) { if ( operations.get( i ).getName().equalsIgnoreCase( "describeUser" ) ) { describeUser = operations.get( i ); } if ( operations.get( i ).getName().equalsIgnoreCase( "GetCapabilities" ) ) { getCapa = operations.get( i ); } } if ( getCapa == null ) { throw new InvalidCapabilitiesException( Messages.getMessage( "WASS_ERROR_CAPABILITIES_MISSING_REQUIRED_OPERATION", "GetCapabilities" ) ); } if ( describeUser == null ) { throw new InvalidCapabilitiesException( Messages.getMessage( "WASS_ERROR_CAPABILITIES_MISSING_REQUIRED_OPERATION", "DescribeUser" ) ); } OperationsMetadata_1_0 om = new OperationsMetadata_1_0( operations.toArray( new Operation_1_0[operations.size()] ), parameters, constraints, extendedCapabilities, describeUser, getCapa ); return om; } /** * @param root * the root node of the Operation xml fragment. * @return The operation representation 1.0 conform * @throws XMLParsingException * @throws URISyntaxException */ @SuppressWarnings("unchecked") public Operation_1_0 parseOperation( Element root ) throws XMLParsingException, URISyntaxException { DCPType[] dcps = getDCPs( XMLTools.getRequiredElements( root, PRE + "DCP", nsContext ) ); String name = XMLTools.getAttrValue( root, null, "name", null ); List parameterList = XMLTools.getNodes( root, PRE + "Parameter", nsContext ); OWSDomainType[] parameters = new OWSDomainType[parameterList.size()]; for ( int i = 0; i < parameters.length; i++ ) { parameters[i] = parseOWSDomainType_1_0( (Element) parameterList.get( i ) ); } List constraintList = XMLTools.getNodes( root, PRE + "Constraint", nsContext ); OWSDomainType[] constraints = new OWSDomainType[constraintList.size()]; for ( int i = 0; i < constraints.length; i++ ) { constraints[i] = parseOWSDomainType_1_0( (Element) constraintList.get( i ) ); } List metadata = XMLTools.getNodes( root, PRE + "Metadata", nsContext ); ArrayList<OWSMetadata> metadatas = new ArrayList<OWSMetadata>(); for ( int i = 0; i < metadata.size(); ++i ) { metadatas.add( parseOWSMetadata( (Element) metadata.get( i ), name ) ); } Operation_1_0 operation = new Operation_1_0( name, dcps, parameters, constraints, (OWSMetadata[]) metadata.toArray( new OWSMetadata[metadata.size()] ) ); return operation; } private OWSMetadata parseOWSMetadata( Element root, String name ) throws XMLParsingException, URISyntaxException { SimpleLink link = parseSimpleLink( root ); URI about = new URI( XMLTools.getAttrValue( root, null, "about", null ) ); // TODO: find out real name OWSMetadata md = new OWSMetadata( about, link, name ); return md; } /** * @param element * The element to get the Domaintype from. * @return the OWSDomainType representation. * @throws XMLParsingException * */ private OWSDomainType parseOWSDomainType_1_0( Element element ) throws XMLParsingException { return getOWSDomainType( null, element ); } /** * @param nameSpace * The namespace of the supportedauthenticationlist should be wss or was * @return ArrayList<SupportedAuthenticationMethod> * @throws XMLParsingException * @throws MalformedURLException */ public ArrayList<SupportedAuthenticationMethod> parseSupportedAuthenticationMethods( String nameSpace ) throws XMLParsingException, MalformedURLException { Element capability = (Element) XMLTools.getRequiredNode( getRootElement(), nameSpace + ":Capability", nsContext ); Element methodList = (Element) XMLTools.getRequiredNode( capability, nameSpace + ":SupportedAuthenticationMethodList", nsContext ); ArrayList<SupportedAuthenticationMethod> result = new AuthenticationDocument().parseSupportedAuthenticationMethodList( methodList ); return result; } }
lat-lon/deegree2-base
deegree2-core/src/main/java/org/deegree/ogcwebservices/wass/common/OWSCapabilitiesBaseDocument_1_0.java
Java
lgpl-2.1
14,509
#!/usr/bin/env python # # rpclib - Copyright (C) Rpclib contributors. # # 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 # # # Most of the service tests are performed through the interop tests. # import datetime import unittest from lxml import etree from rpclib.application import Application from rpclib.auxproc.thread import ThreadAuxProc from rpclib.auxproc.sync import SyncAuxProc from rpclib.decorator import rpc from rpclib.decorator import srpc from rpclib.interface.wsdl import Wsdl11 from rpclib.model.complex import Array from rpclib.model.complex import ComplexModel from rpclib.model.primitive import DateTime from rpclib.model.primitive import Float from rpclib.model.primitive import Integer from rpclib.model.primitive import String from rpclib.protocol.soap import Soap11 from rpclib.protocol.http import HttpRpc from rpclib.server.null import NullServer from rpclib.server.wsgi import WsgiApplication from rpclib.service import ServiceBase Application.transport = 'test' class Address(ComplexModel): __namespace__ = "TestService" street = String city = String zip = Integer since = DateTime laditude = Float longitude = Float class Person(ComplexModel): __namespace__ = "TestService" name = String birthdate = DateTime age = Integer addresses = Array(Address) titles = Array(String) class Request(ComplexModel): __namespace__ = "TestService" param1 = String param2 = Integer class Response(ComplexModel): __namespace__ = "TestService" param1 = Float class TypeNS1(ComplexModel): __namespace__ = "TestService.NS1" s = String i = Integer class TypeNS2(ComplexModel): __namespace__ = "TestService.NS2" d = DateTime f = Float class MultipleNamespaceService(ServiceBase): @rpc(TypeNS1, TypeNS2) def a(ctx, t1, t2): return "OK" class TestService(ServiceBase): @rpc(String, _returns=String) def aa(ctx, s): return s @rpc(String, Integer, _returns=DateTime) def a(ctx, s, i): return datetime.datetime.now() @rpc(Person, String, Address, _returns=Address) def b(ctx, p, s, a): return Address() @rpc(Person, isAsync=True) def d(ctx, Person): pass @rpc(Person, isCallback=True) def e(ctx, Person): pass @rpc(String, String, String, _returns=String, _in_variable_names={'_from': 'from', '_self': 'self', '_import': 'import'}, _out_variable_name="return") def f(ctx, _from, _self, _import): return '1234' class MultipleReturnService(ServiceBase): @rpc(String, _returns=(String, String, String)) def multi(ctx, s): return s, 'a', 'b' class TestSingle(unittest.TestCase): def setUp(self): self.app = Application([TestService], 'tns', Soap11(), Soap11()) self.app.transport = 'null.rpclib' self.srv = TestService() wsdl = Wsdl11(self.app.interface) wsdl.build_interface_document('URL') self.wsdl_str = wsdl.get_interface_document() self.wsdl_doc = etree.fromstring(self.wsdl_str) def test_portypes(self): porttype = self.wsdl_doc.find('{http://schemas.xmlsoap.org/wsdl/}portType') self.assertEquals( len(self.srv.public_methods), len(porttype.getchildren())) def test_override_param_names(self): for n in ['self', 'import', 'return', 'from']: assert n in self.wsdl_str, '"%s" not in self.wsdl_str' class TestMultiple(unittest.TestCase): def setUp(self): self.app = Application([MultipleReturnService], 'tns', Soap11(), Soap11()) self.app.transport = 'none' self.wsdl = Wsdl11(self.app.interface) self.wsdl.build_interface_document('URL') def test_multiple_return(self): message_class = list(MultipleReturnService.public_methods.values())[0].out_message message = message_class() self.assertEquals(len(message._type_info), 3) sent_xml = etree.Element('test') self.app.out_protocol.to_parent_element(message_class, ('a', 'b', 'c'), MultipleReturnService.get_tns(), sent_xml) sent_xml = sent_xml[0] print(etree.tostring(sent_xml, pretty_print=True)) response_data = self.app.out_protocol.from_element(message_class, sent_xml) self.assertEquals(len(response_data), 3) self.assertEqual(response_data[0], 'a') self.assertEqual(response_data[1], 'b') self.assertEqual(response_data[2], 'c') class MultipleMethods1(ServiceBase): @srpc(String) def multi(s): return "%r multi 1" % s class MultipleMethods2(ServiceBase): @srpc(String) def multi(s): return "%r multi 2" % s class TestMultipleMethods(unittest.TestCase): def test_single_method(self): try: app = Application([MultipleMethods1,MultipleMethods2], 'tns', Soap11(), Soap11()) except ValueError: pass else: raise Exception('must fail.') def test_simple_aux_nullserver(self): data = [] class Service(ServiceBase): @srpc(String) def call(s): data.append(s) class AuxService(ServiceBase): __aux__ = SyncAuxProc() @srpc(String) def call(s): data.append(s) app = Application([Service, AuxService], 'tns', Soap11(), Soap11()) server = NullServer(app) server.service.call("hey") assert data == ['hey', 'hey'] def test_simple_aux_wsgi(self): data = [] class Service(ServiceBase): @srpc(String, _returns=String) def call(s): data.append(s) class AuxService(ServiceBase): __aux__ = SyncAuxProc() @srpc(String, _returns=String) def call(s): data.append(s) def start_response(code, headers): print code, headers app = Application([Service, AuxService], 'tns', HttpRpc(), HttpRpc()) server = WsgiApplication(app) server({ 'QUERY_STRING': 's=hey', 'PATH_INFO': '/call', 'REQUEST_METHOD': 'GET', }, start_response, "http://null") assert data == ['hey', 'hey'] def test_thread_aux_wsgi(self): import logging logging.basicConfig(level=logging.DEBUG) data = set() class Service(ServiceBase): @srpc(String, _returns=String) def call(s): data.add(s) class AuxService(ServiceBase): __aux__ = ThreadAuxProc() @srpc(String, _returns=String) def call(s): data.add(s + "aux") def start_response(code, headers): print code, headers app = Application([Service, AuxService], 'tns', HttpRpc(), HttpRpc()) server = WsgiApplication(app) server({ 'QUERY_STRING': 's=hey', 'PATH_INFO': '/call', 'REQUEST_METHOD': 'GET', }, start_response, "http://null") import time time.sleep(1) assert data == set(['hey', 'heyaux']) def test_mixing_primary_and_aux_methods(self): try: class Service(ServiceBase): @srpc(String, _returns=String, _aux=ThreadAuxProc()) def call(s): pass @srpc(String, _returns=String) def mall(s): pass except Exception: pass else: raise Exception("must fail with 'Exception: you can't mix aux and non-aux methods in a single service definition.'") if __name__ == '__main__': unittest.main()
martijnvermaat/rpclib
src/rpclib/test/test_service.py
Python
lgpl-2.1
8,487
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2) on Tue Jul 15 17:22:49 MEST 2003 --> <TITLE> Overview (Java Management Extensions 1.2.1 API Specification) </TITLE> <META NAME="keywords" CONTENT="Overview, <h2>Java<sup><font size=-2>TM</font></sup> Management Extensions (JMX<sup><font size=-2>TM</font></sup>) API Specification <p> Version 1.2.1 <br>&nbsp;</h2>"> <LINK REL="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title = "Overview (Java Management Extensions 1.2.1 API Specification)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp; </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp; </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp; <SCRIPT type="text/javascript"> <!-- if (window == top) { document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H1> <h2>Java<sup><font size=-2>TM</font></sup> Management Extensions (JMX<sup><font size=-2>TM</font></sup>) API Specification <p> Version 1.2.1 <br>&nbsp;</h2> </H1> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>JMX 1.2.1 Specification Packages</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/package-summary.html">javax.management</A></B></TD> <TD>Provides the <B>core JMX classes</B>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/loading/package-summary.html">javax.management.loading</A></B></TD> <TD>Provides the classes which implement <B>advanced dynamic loading</B>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/modelmbean/package-summary.html">javax.management.modelmbean</A></B></TD> <TD>Provides the definition of the <B>ModelMBean classes</B>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/monitor/package-summary.html">javax.management.monitor</A></B></TD> <TD>Provides the definition of the <B>monitor classes</B>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/openmbean/package-summary.html">javax.management.openmbean</A></B> </TD> <TD>Provides the <B>open data types</B> and <B>open mbean descriptors</B> classes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/relation/package-summary.html">javax.management.relation</A></B> </TD> <TD>Provides the definition of the <B>Relation service</B>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="20%"><B><A HREF="javax/management/timer/package-summary.html">javax.management.timer</A></B></TD> <TD>Provides the definition of the <B>Timer MBean</B>.</TD> </TR> </TABLE> <P> &nbsp; <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp; </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp; </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Maintenance Release</b> <br> <font size="-1">jmx-1.2.1-b14 2003.07.15_17:22:05_MEST</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp; <SCRIPT type="text/javascript"> <!-- if (window == top) { document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size="-1">Copyright 1999-2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.</font> </BODY> </HTML>
cacheonix/cacheonix-core
3rdparty/jmx-1.2.1-ri/doc/api/overview-summary.html
HTML
lgpl-2.1
8,818
/* * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net> * Distributed under the terms of either: * - the common development and distribution license (CDDL), v1.0; or * - the GNU Lesser General Public License, v2.1 or later */ package winstone.cluster; import java.net.*; import java.io.*; import winstone.Logger; import winstone.WinstoneSession; /** * Contains all the logic for reading in sessions * * @author <a href="mailto:rick_knowles@hotmail.com">Rick Knowles</a> * @version $Id$ */ public class ClusterSessionSearch implements Runnable { final int TIMEOUT = 2000; public static final byte SESSION_CHECK_TYPE = (byte) '1'; public static final String SESSION_NOT_FOUND = "NOTFOUND"; public static final String SESSION_FOUND = "FOUND"; public static final String SESSION_RECEIVED = "OK"; private boolean isFinished; // private boolean interrupted; private WinstoneSession result; private String searchWebAppHostname; private String searchWebAppPrefix; private String searchId; private String searchAddressPort; private int controlPort; /** * Sets up for a threaded search */ public ClusterSessionSearch(String webAppPrefix, String hostName, String sessionId, String ipPort, int controlPort) { this.isFinished = false; this.searchWebAppHostname = hostName; this.searchWebAppPrefix = webAppPrefix; // this.interrupted = false; this.searchId = sessionId; this.searchAddressPort = ipPort; this.result = null; this.controlPort = controlPort; // Start the search thread Thread searchThread = new Thread(this); searchThread.setDaemon(true); searchThread.start(); } /** * Actually implements the search */ public void run() { try { int colonPos = this.searchAddressPort.indexOf(':'); String ipAddress = this.searchAddressPort.substring(0, colonPos); String port = this.searchAddressPort.substring(colonPos + 1); Socket controlConnection = new Socket(ipAddress, Integer.parseInt(port)); controlConnection.setSoTimeout(TIMEOUT); OutputStream out = controlConnection.getOutputStream(); out.write(SESSION_CHECK_TYPE); out.flush(); ObjectOutputStream outControl = new ObjectOutputStream(out); outControl.writeInt(this.controlPort); outControl.writeUTF(this.searchId); outControl.writeUTF(this.searchWebAppHostname); outControl.writeUTF(this.searchWebAppPrefix); outControl.flush(); InputStream in = controlConnection.getInputStream(); ObjectInputStream inSession = new ObjectInputStream(in); String reply = inSession.readUTF(); if ((reply != null) && reply.equals(SESSION_FOUND)) { WinstoneSession session = (WinstoneSession) inSession .readObject(); outControl.writeUTF(SESSION_RECEIVED); this.result = session; } outControl.close(); inSession.close(); out.close(); in.close(); controlConnection.close(); } catch (Throwable err) { Logger.log(Logger.WARNING, SimpleCluster.CLUSTER_RESOURCES, "ClusterSessionSearch.Error", err); } this.isFinished = true; } public boolean isFinished() { return this.isFinished; } public WinstoneSession getResult() { return this.result; } public void destroy() { // this.interrupted = true; } public String getAddressPort() { return this.searchAddressPort; } }
cdauth/winstone
src/java/winstone/cluster/ClusterSessionSearch.java
Java
lgpl-2.1
3,821
<?php /*"****************************************************************************************************** * (c) 2004-2006 by MulchProductions, www.mulchprod.de * * (c) 2007-2016 by Kajona, www.kajona.de * * Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt * ********************************************************************************************************/ namespace Kajona\System\System\Db; use Kajona\System\System\Database; use Kajona\System\System\Db\Schema\Table; use Kajona\System\System\Db\Schema\TableColumn; use Kajona\System\System\Db\Schema\TableIndex; use Kajona\System\System\Db\Schema\TableKey; use Kajona\System\System\DbConnectionParams; use Kajona\System\System\DbDatatypes; use Kajona\System\System\Exception; use Kajona\System\System\Logger; use Kajona\System\System\StringUtil; use mysqli; use mysqli_stmt; /** * db-driver for MySQL using the php-mysqli-interface * * @package module_system */ class DbMysqli extends DbBase { /** @var mysqli */ private $linkDB; //DB-Link /** @var DbConnectionParams */ private $objCfg; private $strDumpBin = "mysqldump"; //Binary to dump db (if not in path, add the path here) private $strRestoreBin = "mysql"; //Binary to dump db (if not in path, add the path here) private $strErrorMessage = ""; /** * @inheritdoc */ public function dbconnect(DbConnectionParams $objParams) { if ($objParams->getIntPort() == "" || $objParams->getIntPort() == 0) { $objParams->setIntPort(3306); } //save connection-details $this->objCfg = $objParams; $this->linkDB = @new mysqli($this->objCfg->getStrHost(), $this->objCfg->getStrUsername(), $this->objCfg->getStrPass(), $this->objCfg->getStrDbName(), $this->objCfg->getIntPort()); if ($this->linkDB !== false) { if (@$this->linkDB->select_db($this->objCfg->getStrDbName())) { //erst ab mysql-client-bib > 4 //mysqli_set_charset($this->linkDB, "utf8"); $this->_pQuery("SET NAMES 'utf8'", array()); $this->_pQuery("SET CHARACTER SET utf8", array()); $this->_pQuery("SET character_set_connection ='utf8'", array()); $this->_pQuery("SET character_set_database ='utf8'", array()); $this->_pQuery("SET character_set_server ='utf8'", array()); return true; } else { throw new Exception("Error selecting database", Exception::$level_FATALERROR); } } else { throw new Exception("Error connecting to database", Exception::$level_FATALERROR); } } /** * Closes the connection to the database * * @return void */ public function dbclose() { $this->linkDB->close(); } /** * Sends a prepared statement to the database. All params must be represented by the ? char. * The params themself are stored using the second params using the matching order. * * @param string $strQuery * @param array $arrParams * * @return bool * @since 3.4 */ public function _pQuery($strQuery, $arrParams) { $objStatement = $this->getPreparedStatement($strQuery); $bitReturn = false; if ($objStatement !== false) { $strTypes = ""; foreach ($arrParams as $strOneParam) { if (is_float($strOneParam)) { $strTypes .= "d"; } elseif (is_int($strOneParam)) { $strTypes .= "i"; } else { $strTypes .= "s"; } } if (count($arrParams) > 0) { $arrParams = array_merge(array($strTypes), $arrParams); call_user_func_array(array($objStatement, 'bind_param'), $this->refValues($arrParams)); } $intCount = 0; while ($intCount < 3) { $bitReturn = $objStatement->execute(); if ($bitReturn === false && $objStatement->errno == 1213) { // in case we have a dead lock wait a bit and retry the query $intCount++; sleep(2); } else { break; } } $this->intAffectedRows = $objStatement->affected_rows; } return $bitReturn; } /** * This method is used to retrieve an array of resultsets from the database using * a prepared statement. * * @param string $strQuery * @param array $arrParams * * @since 3.4 * @return array|bool */ public function getPArray($strQuery, $arrParams) { $objStatement = $this->getPreparedStatement($strQuery); $arrReturn = array(); if ($objStatement !== false) { $strTypes = ""; foreach ($arrParams as $strOneParam) { $strTypes .= "s"; } if (count($arrParams) > 0) { $arrParams = array_merge(array($strTypes), $arrParams); call_user_func_array(array($objStatement, 'bind_param'), $this->refValues($arrParams)); } if (!$objStatement->execute()) { return false; } //should remain here due to the bug http://bugs.php.net/bug.php?id=47928 $objStatement->store_result(); $objMetadata = $objStatement->result_metadata(); $arrParams = array(); $arrRow = array(); while ($objField = $objMetadata->fetch_field()) { $arrParams[] = &$arrRow[$objField->name]; } call_user_func_array(array($objStatement, 'bind_result'), $arrParams); while ($objStatement->fetch()) { $arrSingleRow = array(); foreach ($arrRow as $key => $val) { $arrSingleRow[$key] = $val; } $arrReturn[] = $arrSingleRow; } $objStatement->free_result(); } else { return false; } return $arrReturn; } /** * @inheritDoc */ public function insertOrUpdate($strTable, $arrColumns, $arrValues, $arrPrimaryColumns) { $arrPlaceholder = array(); $arrMappedColumns = array(); $arrKeyValuePairs = array(); foreach ($arrColumns as $strOneCol) { $arrPlaceholder[] = "?"; $arrMappedColumns[] = $this->encloseColumnName($strOneCol); $arrKeyValuePairs[] = $this->encloseColumnName($strOneCol)." = ?"; } $strQuery = "INSERT INTO ".$this->encloseTableName($strTable)." (".implode(", ", $arrMappedColumns).") VALUES (".implode(", ", $arrPlaceholder).") ON DUPLICATE KEY UPDATE ".implode(", ", $arrKeyValuePairs); return $this->_pQuery($strQuery, array_merge($arrValues, $arrValues)); } /** * Returns the last error reported by the database. * Is being called after unsuccessful queries * * @return string */ public function getError() { $strError = $this->strErrorMessage." ".$this->linkDB->error; $this->strErrorMessage = ""; return $strError; } /** * Returns ALL tables in the database currently connected to * * @return mixed */ public function getTables() { $arrTemp = $this->getPArray("SHOW TABLE STATUS", array()); foreach ($arrTemp as $intKey => $arrOneTemp) { $arrTemp[$intKey]["name"] = $arrTemp[$intKey]["Name"]; } return $arrTemp; } /** * Fetches the full table information as retrieved from the rdbms * @param $tableName * @return Table */ public function getTableInformation(string $tableName): Table { $table = new Table($tableName); //fetch all columns $columnInfo = $this->getPArray("SHOW COLUMNS FROM {$tableName}", []) ?: []; foreach ($columnInfo as $arrOneColumn) { $col = new TableColumn($arrOneColumn["Field"]); $col->setInternalType($this->getCoreTypeForDbType($arrOneColumn)); $col->setDatabaseType($this->getDatatype($col->getInternalType())); $col->setNullable($arrOneColumn["Null"] == "YES"); $table->addColumn($col); } //fetch all indexes $indexes = $this->getPArray("SHOW INDEX FROM {$tableName} WHERE Key_name != 'PRIMARY'", []) ?: []; $indexAggr = []; foreach ($indexes as $indexInfo) { $indexAggr[$indexInfo["Key_name"]] = $indexAggr[$indexInfo["Key_name"]] ?? []; $indexAggr[$indexInfo["Key_name"]][] = $indexInfo["Column_name"]; } foreach ($indexAggr as $key => $desc) { $index = new TableIndex($key); $index->setDescription(implode(", ", $desc)); $table->addIndex($index); } //fetch all keys $keys = $this->getPArray("SHOW KEYS FROM {$tableName} WHERE Key_name = 'PRIMARY'", []) ?: []; foreach ($keys as $keyInfo) { $key = new TableKey($keyInfo['Column_name']); $table->addPrimaryKey($key); } return $table; } /** * Tries to convert a column provided by the database back to the Kajona internal type constant * @param $infoSchemaRow * @return null|string */ private function getCoreTypeForDbType($infoSchemaRow) { if ($infoSchemaRow["Type"] == "int(11)") { return DbDatatypes::STR_TYPE_INT; } elseif ($infoSchemaRow["Type"] == "bigint(20)") { return DbDatatypes::STR_TYPE_LONG; } elseif ($infoSchemaRow["Type"] == "double") { return DbDatatypes::STR_TYPE_DOUBLE; } elseif ($infoSchemaRow["Type"] == "varchar(10)") { return DbDatatypes::STR_TYPE_CHAR10; } elseif ($infoSchemaRow["Type"] == "varchar(20)") { return DbDatatypes::STR_TYPE_CHAR20; } elseif ($infoSchemaRow["Type"] == "varchar(100)") { return DbDatatypes::STR_TYPE_CHAR100; } elseif ($infoSchemaRow["Type"] == "varchar(254)") { return DbDatatypes::STR_TYPE_CHAR254; } elseif ($infoSchemaRow["Type"] == "varchar(500)") { return DbDatatypes::STR_TYPE_CHAR500; } elseif ($infoSchemaRow["Type"] == "text") { return DbDatatypes::STR_TYPE_TEXT; } elseif ($infoSchemaRow["Type"] == "longtext") { return DbDatatypes::STR_TYPE_LONGTEXT; } return null; } /** * Returns the db-specific datatype for the kajona internal datatype. * * @param string $strType * * @return string */ public function getDatatype($strType) { $strReturn = ""; if ($strType == DbDatatypes::STR_TYPE_INT) { $strReturn .= " INT "; } elseif ($strType == DbDatatypes::STR_TYPE_LONG) { $strReturn .= " BIGINT "; } elseif ($strType == DbDatatypes::STR_TYPE_DOUBLE) { $strReturn .= " DOUBLE "; } elseif ($strType == DbDatatypes::STR_TYPE_CHAR10) { $strReturn .= " VARCHAR( 10 ) "; } elseif ($strType == DbDatatypes::STR_TYPE_CHAR20) { $strReturn .= " VARCHAR( 20 ) "; } elseif ($strType == DbDatatypes::STR_TYPE_CHAR100) { $strReturn .= " VARCHAR( 100 ) "; } elseif ($strType == DbDatatypes::STR_TYPE_CHAR254) { $strReturn .= " VARCHAR( 254 ) "; } elseif ($strType == DbDatatypes::STR_TYPE_CHAR500) { $strReturn .= " VARCHAR( 500 ) "; } elseif ($strType == DbDatatypes::STR_TYPE_TEXT) { $strReturn .= " TEXT "; } elseif ($strType == DbDatatypes::STR_TYPE_LONGTEXT) { $strReturn .= " LONGTEXT "; } else { $strReturn .= " VARCHAR( 254 ) "; } return $strReturn; } /** * Used to send a create table statement to the database * By passing the query through this method, the driver can * add db-specific commands. * The array of fields should have the following structure * $array[string columnName] = array(string datatype, boolean isNull [, default (only if not null)]) * whereas datatype is one of the following: * int * long * double * char10 * char20 * char100 * char254 * char500 * text * longtext * * @param string $strName * @param array $arrFields array of fields / columns * @param array $arrKeys array of primary keys * * @return bool */ public function createTable($strName, $arrFields, $arrKeys) { $strQuery = ""; //build the mysql code $strQuery .= "CREATE TABLE IF NOT EXISTS `".$strName."` ( \n"; //loop the fields foreach ($arrFields as $strFieldName => $arrColumnSettings) { $strQuery .= " `".$strFieldName."` "; $strQuery .= $this->getDatatype($arrColumnSettings[0]); //any default? if (isset($arrColumnSettings[2])) { $strQuery .= "DEFAULT ".$arrColumnSettings[2]." "; } //nullable? if ($arrColumnSettings[1] === true) { $strQuery .= " NULL , \n"; } else { $strQuery .= " NOT NULL , \n"; } } //primary keys $strQuery .= " PRIMARY KEY ( `".implode("` , `", $arrKeys)."` ) \n"; $strQuery .= ") "; $strQuery .= " ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_unicode_ci;"; return $this->_pQuery($strQuery, array()); } /** * @inheritdoc */ public function createIndex($strTable, $strName, $arrColumns, $bitUnique = false) { return $this->_pQuery("ALTER TABLE ".$this->encloseTableName($strTable)." ADD ".($bitUnique ? "UNIQUE" : "")." INDEX ".$strName." (" . implode(",", $arrColumns) . ")", []); } /** * @inheritdoc */ public function hasIndex($strTable, $strName): bool { $arrIndex = $this->getPArray("SHOW INDEX FROM {$strTable} WHERE Key_name = ?", [$strName]); return count($arrIndex) > 0; } /** * @inheritDoc */ public function deleteIndex(string $table, string $index): bool { return $this->_pQuery("DROP INDEX {$index} ON {$table}", []); } /** * Starts a transaction * * @return void */ public function transactionBegin() { //Autocommit 0 setzten $strQuery = "SET AUTOCOMMIT = 0"; $strQuery2 = "BEGIN"; $this->_pQuery($strQuery, array()); $this->_pQuery($strQuery2, array()); } /** * Ends a successful operation by Commiting the transaction * * @return void */ public function transactionCommit() { $str_pQuery = "COMMIT"; $str_pQuery2 = "SET AUTOCOMMIT = 1"; $this->_pQuery($str_pQuery, array()); $this->_pQuery($str_pQuery2, array()); } /** * Ends a non-successful transaction by using a rollback * * @return void */ public function transactionRollback() { $strQuery = "ROLLBACK"; $strQuery2 = "SET AUTOCOMMIT = 1"; $this->_pQuery($strQuery, array()); $this->_pQuery($strQuery2, array()); } /** * @return array|mixed */ public function getDbInfo() { $arrReturn = array(); $arrReturn["dbserver"] = "MySQL ".$this->linkDB->server_info; $arrReturn["server version"] = $this->linkDB->server_version; $arrReturn["dbclient"] = $this->linkDB->client_info; $arrReturn["client version"] = $this->linkDB->client_version; $arrReturn["dbconnection"] = $this->linkDB->host_info; $arrReturn["protocol version"] = $this->linkDB->protocol_version; $arrReturn["thread id"] = $this->linkDB->thread_id; return $arrReturn; } /** * Allows the db-driver to add database-specific surrounding to column-names. * E.g. needed by the mysql-drivers * * @param string $strColumn * * @return string */ public function encloseColumnName($strColumn) { return "`".$strColumn."`"; } /** * Allows the db-driver to add database-specific surrounding to table-names. * * @param string $strTable * * @return string */ public function encloseTableName($strTable) { return "`".$strTable."`"; } //--- DUMP & RESTORE ------------------------------------------------------------------------------------ /** * Dumps the current db * * @param string $strFilename * @param array $arrTables * * @return bool */ public function dbExport(&$strFilename, $arrTables) { $strFilename = _realpath_.$strFilename; $strTables = implode(" ", $arrTables); $strParamPass = ""; if ($this->objCfg->getStrPass() != "") { $strParamPass = " -p\"".$this->objCfg->getStrPass()."\""; } if ($this->handlesDumpCompression()) { $strFilename .= ".gz"; $strCommand = $this->strDumpBin." -h".$this->objCfg->getStrHost()." -u".$this->objCfg->getStrUsername().$strParamPass." -P".$this->objCfg->getIntPort()." ".$this->objCfg->getStrDbName()." ".$strTables." | gzip > \"".$strFilename."\""; } else { $strCommand = $this->strDumpBin." -h".$this->objCfg->getStrHost()." -u".$this->objCfg->getStrUsername().$strParamPass." -P".$this->objCfg->getIntPort()." ".$this->objCfg->getStrDbName()." ".$strTables." > \"".$strFilename."\""; } //Now do a systemfork $intTemp = ""; system($strCommand, $intTemp); if ($intTemp == 0) { Logger::getInstance(Logger::DBLOG)->info($this->strDumpBin." exited with code ".$intTemp); } else { Logger::getInstance(Logger::DBLOG)->warning($this->strDumpBin." exited with code ".$intTemp); } return $intTemp == 0; } /** * Imports the given db-dump to the database * * @param string $strFilename * * @return bool */ public function dbImport($strFilename) { $strFilename = _realpath_.$strFilename; $strParamPass = ""; if ($this->objCfg->getStrPass() != "") { $strParamPass = " -p\"".$this->objCfg->getStrPass()."\""; } if ($this->handlesDumpCompression() && StringUtil::endsWith($strFilename, ".gz")) { $strCommand = " gunzip -c \"".$strFilename."\" | ".$this->strRestoreBin." -h".$this->objCfg->getStrHost()." -u".$this->objCfg->getStrUsername().$strParamPass." -P".$this->objCfg->getIntPort()." ".$this->objCfg->getStrDbName().""; } else { $strCommand = $this->strRestoreBin." -h".$this->objCfg->getStrHost()." -u".$this->objCfg->getStrUsername().$strParamPass." -P".$this->objCfg->getIntPort()." ".$this->objCfg->getStrDbName()." < \"".$strFilename."\""; } $intTemp = ""; system($strCommand, $intTemp); if ($intTemp == 0) { Logger::getInstance(Logger::DBLOG)->info($this->strDumpBin." exited with code ".$intTemp); } else { Logger::getInstance(Logger::DBLOG)->warning($this->strDumpBin." exited with code ".$intTemp); } return $intTemp == 0; } /** * Converts a simple array into a an array of references. * Required for PHP > 5.3 * * @param array $arrValues * * @return array */ private function refValues($arrValues) { if (strnatcmp(phpversion(), '5.3') >= 0) { //Reference is required for PHP 5.3+ $refs = array(); foreach ($arrValues as $key => $value) { $refs[$key] = &$arrValues[$key]; } return $refs; } return $arrValues; } /** * Prepares a statement or uses an instance from the cache * * @param string $strQuery * * @return mysqli_stmt */ private function getPreparedStatement($strQuery) { $strName = md5($strQuery); if (isset($this->arrStatementsCache[$strName])) { return $this->arrStatementsCache[$strName]; } if (count($this->arrStatementsCache) > 300) { /** @var mysqli_stmt $objOneEntry */ foreach ($this->arrStatementsCache as $objOneEntry) { $objOneEntry->close(); } $this->arrStatementsCache = array(); } $objStatement = $this->linkDB->stmt_init(); if (!$objStatement->prepare($strQuery)) { $this->strErrorMessage = $objStatement->error; return false; } $this->arrStatementsCache[$strName] = $objStatement; return $objStatement; } /** * @param string $strValue * * @return mixed */ public function escape($strValue) { return str_replace("\\", "\\\\", $strValue); } }
artemeon/core
module_system/system/db/DbMysqli.php
PHP
lgpl-2.1
21,518
/// LCM release major version - the X in version X.Y.Z #define LCM_VERSION_MAJOR 1 /// LCM release minor version - the Y in version X.Y.Z #define LCM_VERSION_MINOR 3 /// LCM release patch version - the Z in version X.Y.Z #define LCM_VERSION_PATCH 95 /// LCM ABI version #define LCM_ABI_VERSION 1 // Old symbols provided for compatibility #define LCM_MAJOR_VERSION LCM_VERSION_MAJOR #define LCM_MINOR_VERSION LCM_VERSION_MINOR #define LCM_MICRO_VERSION LCM_VERSION_PATCH
adeschamps/lcm
lcm/lcm_version.h
C
lgpl-2.1
475
/* * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. * * 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; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef InlineBox_h #define InlineBox_h #include "RenderBoxModelObject.h" #include "TextDirection.h" namespace WebCore { class HitTestRequest; class HitTestResult; class RootInlineBox; // InlineBox represents a rectangle that occurs on a line. It corresponds to // some RenderObject (i.e., it represents a portion of that RenderObject). class InlineBox { public: InlineBox(RenderObject* obj) : m_next(0) , m_prev(0) , m_parent(0) , m_renderer(obj) , m_logicalWidth(0) #ifndef NDEBUG , m_hasBadParent(false) #endif { } InlineBox(RenderObject* obj, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed, bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent) : m_next(next) , m_prev(prev) , m_parent(parent) , m_renderer(obj) , m_topLeft(topLeft) , m_logicalWidth(logicalWidth) , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal) #ifndef NDEBUG , m_hasBadParent(false) #endif { } virtual ~InlineBox(); virtual void destroy(RenderArena*); virtual void deleteLine(RenderArena*); virtual void extractLine(); virtual void attachLine(); virtual bool isLineBreak() const { return false; } virtual void adjustPosition(float dx, float dy); void adjustLogicalPosition(float deltaLogicalLeft, float deltaLogicalTop) { if (isHorizontal()) adjustPosition(deltaLogicalLeft, deltaLogicalTop); else adjustPosition(deltaLogicalTop, deltaLogicalLeft); } void adjustLineDirectionPosition(float delta) { if (isHorizontal()) adjustPosition(delta, 0); else adjustPosition(0, delta); } void adjustBlockDirectionPosition(float delta) { if (isHorizontal()) adjustPosition(0, delta); else adjustPosition(delta, 0); } virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom); virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestPoint& pointInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom); // Overloaded new operator. void* operator new(size_t, RenderArena*); // Overridden to prevent the normal delete from being called. void operator delete(void*, size_t); private: // The normal operator new is disallowed. void* operator new(size_t) throw(); public: #ifndef NDEBUG void showTreeForThis() const; void showLineTreeForThis() const; virtual void showBox(int = 0) const; virtual void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const InlineBox* = 0, const char* = 0, const RenderObject* = 0, int = 0) const; virtual const char* boxName() const; #endif bool isText() const { return m_bitfields.isText(); } void setIsText(bool isText) { m_bitfields.setIsText(isText); } virtual bool isInlineFlowBox() const { return false; } virtual bool isInlineTextBox() const { return false; } virtual bool isRootInlineBox() const { return false; } #if ENABLE(SVG) virtual bool isSVGInlineTextBox() const { return false; } virtual bool isSVGInlineFlowBox() const { return false; } virtual bool isSVGRootInlineBox() const { return false; } #endif bool hasVirtualLogicalHeight() const { return m_bitfields.hasVirtualLogicalHeight(); } void setHasVirtualLogicalHeight() { m_bitfields.setHasVirtualLogicalHeight(true); } virtual float virtualLogicalHeight() const { ASSERT_NOT_REACHED(); return 0; } bool isHorizontal() const { return m_bitfields.isHorizontal(); } void setIsHorizontal(bool isHorizontal) { m_bitfields.setIsHorizontal(isHorizontal); } virtual FloatRect calculateBoundaries() const { ASSERT_NOT_REACHED(); return FloatRect(); } bool isConstructed() { return m_bitfields.constructed(); } virtual void setConstructed() { m_bitfields.setConstructed(true); } void setExtracted(bool extracted = true) { m_bitfields.setExtracted(extracted); } void setFirstLineStyleBit(bool firstLine) { m_bitfields.setFirstLine(firstLine); } bool isFirstLineStyle() const { return m_bitfields.firstLine(); } void remove(); InlineBox* nextOnLine() const { return m_next; } InlineBox* prevOnLine() const { return m_prev; } void setNextOnLine(InlineBox* next) { ASSERT(m_parent || !next); m_next = next; } void setPrevOnLine(InlineBox* prev) { ASSERT(m_parent || !prev); m_prev = prev; } bool nextOnLineExists() const; virtual bool isLeaf() const { return true; } InlineBox* nextLeafChild() const; InlineBox* prevLeafChild() const; // Helper functions for editing and hit-testing code. // FIXME: These two functions should be moved to RenderedPosition once the code to convert between // Position and inline box, offset pair is moved to RenderedPosition. InlineBox* nextLeafChildIgnoringLineBreak() const; InlineBox* prevLeafChildIgnoringLineBreak() const; RenderObject* renderer() const { return m_renderer; } InlineFlowBox* parent() const { ASSERT(!m_hasBadParent); return m_parent; } void setParent(InlineFlowBox* par) { m_parent = par; } const RootInlineBox* root() const; RootInlineBox* root(); // x() is the left side of the box in the containing block's coordinate system. void setX(float x) { m_topLeft.setX(x); } float x() const { return m_topLeft.x(); } float left() const { return m_topLeft.x(); } // y() is the top side of the box in the containing block's coordinate system. void setY(float y) { m_topLeft.setY(y); } float y() const { return m_topLeft.y(); } float top() const { return m_topLeft.y(); } const FloatPoint& topLeft() const { return m_topLeft; } float width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); } float height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); } FloatSize size() const { return FloatSize(width(), height()); } float right() const { return left() + width(); } float bottom() const { return top() + height(); } // The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line. float logicalLeft() const { return isHorizontal() ? m_topLeft.x() : m_topLeft.y(); } float logicalRight() const { return logicalLeft() + logicalWidth(); } void setLogicalLeft(float left) { if (isHorizontal()) setX(left); else setY(left); } int pixelSnappedLogicalLeft() const { return logicalLeft(); } int pixelSnappedLogicalRight() const { return ceilf(logicalRight()); } int pixelSnappedLogicalTop() const { return logicalTop(); } int pixelSnappedLogicalBottom() const { return ceilf(logicalBottom()); } // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line. float logicalTop() const { return isHorizontal() ? m_topLeft.y() : m_topLeft.x(); } float logicalBottom() const { return logicalTop() + logicalHeight(); } void setLogicalTop(float top) { if (isHorizontal()) setY(top); else setX(top); } // The logical width is our extent in the line's overall inline direction, i.e., width for horizontal text and height for vertical text. void setLogicalWidth(float w) { m_logicalWidth = w; } float logicalWidth() const { return m_logicalWidth; } // The logical height is our extent in the block flow direction, i.e., height for horizontal text and width for vertical text. float logicalHeight() const; FloatRect logicalFrameRect() const { return isHorizontal() ? FloatRect(m_topLeft.x(), m_topLeft.y(), m_logicalWidth, logicalHeight()) : FloatRect(m_topLeft.y(), m_topLeft.x(), m_logicalWidth, logicalHeight()); } virtual LayoutUnit baselinePosition(FontBaseline baselineType) const; virtual LayoutUnit lineHeight() const; virtual int caretMinOffset() const; virtual int caretMaxOffset() const; unsigned char bidiLevel() const { return m_bitfields.bidiEmbeddingLevel(); } void setBidiLevel(unsigned char level) { m_bitfields.setBidiEmbeddingLevel(level); } TextDirection direction() const { return bidiLevel() % 2 ? RTL : LTR; } bool isLeftToRightDirection() const { return direction() == LTR; } int caretLeftmostOffset() const { return isLeftToRightDirection() ? caretMinOffset() : caretMaxOffset(); } int caretRightmostOffset() const { return isLeftToRightDirection() ? caretMaxOffset() : caretMinOffset(); } virtual void clearTruncation() { } bool isDirty() const { return m_bitfields.dirty(); } void markDirty(bool dirty = true) { m_bitfields.setDirty(dirty); } virtual void dirtyLineBoxes(); virtual RenderObject::SelectionState selectionState(); virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) const; // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool&); #ifndef NDEBUG void setHasBadParent(); #endif int expansion() const { return m_bitfields.expansion(); } bool visibleToHitTesting() const { return renderer()->style()->visibility() == VISIBLE && renderer()->style()->pointerEvents() != PE_NONE; } EVerticalAlign verticalAlign() const { return renderer()->style(m_bitfields.firstLine())->verticalAlign(); } // Use with caution! The type is not checked! RenderBoxModelObject* boxModelObject() const { if (!m_renderer->isText()) return toRenderBoxModelObject(m_renderer); return 0; } FloatPoint locationIncludingFlipping(); void flipForWritingMode(FloatRect&); FloatPoint flipForWritingMode(const FloatPoint&); void flipForWritingMode(LayoutRect&); LayoutPoint flipForWritingMode(const LayoutPoint&); bool knownToHaveNoOverflow() const { return m_bitfields.knownToHaveNoOverflow(); } void clearKnownToHaveNoOverflow(); bool dirOverride() const { return m_bitfields.dirOverride(); } void setDirOverride(bool dirOverride) { m_bitfields.setDirOverride(dirOverride); } private: InlineBox* m_next; // The next element on the same line as us. InlineBox* m_prev; // The previous element on the same line as us. InlineFlowBox* m_parent; // The box that contains us. public: RenderObject* m_renderer; FloatPoint m_topLeft; float m_logicalWidth; #define ADD_BOOLEAN_BITFIELD(name, Name) \ private:\ unsigned m_##name : 1;\ public:\ bool name() const { return m_##name; }\ void set##Name(bool name) { m_##name = name; }\ class InlineBoxBitfields { public: InlineBoxBitfields(bool firstLine = false, bool constructed = false, bool dirty = false, bool extracted = false, bool isHorizontal = true) : m_firstLine(firstLine) , m_constructed(constructed) , m_bidiEmbeddingLevel(0) , m_dirty(dirty) , m_extracted(extracted) , m_hasVirtualLogicalHeight(false) , m_isHorizontal(isHorizontal) , m_endsWithBreak(false) , m_hasSelectedChildrenOrCanHaveLeadingExpansion(false) , m_knownToHaveNoOverflow(true) , m_hasEllipsisBoxOrHyphen(false) , m_dirOverride(false) , m_isText(false) , m_determinedIfNextOnLineExists(false) , m_nextOnLineExists(false) , m_expansion(0) { } // Some of these bits are actually for subclasses and moved here to compact the structures. // for this class ADD_BOOLEAN_BITFIELD(firstLine, FirstLine); ADD_BOOLEAN_BITFIELD(constructed, Constructed); private: unsigned m_bidiEmbeddingLevel : 6; // The maximium bidi level is 62: http://unicode.org/reports/tr9/#Explicit_Levels_and_Directions public: unsigned char bidiEmbeddingLevel() const { return m_bidiEmbeddingLevel; } void setBidiEmbeddingLevel(unsigned char bidiEmbeddingLevel) { m_bidiEmbeddingLevel = bidiEmbeddingLevel; } ADD_BOOLEAN_BITFIELD(dirty, Dirty); ADD_BOOLEAN_BITFIELD(extracted, Extracted); ADD_BOOLEAN_BITFIELD(hasVirtualLogicalHeight, HasVirtualLogicalHeight); ADD_BOOLEAN_BITFIELD(isHorizontal, IsHorizontal); // for RootInlineBox ADD_BOOLEAN_BITFIELD(endsWithBreak, EndsWithBreak); // Whether the line ends with a <br>. // shared between RootInlineBox and InlineTextBox ADD_BOOLEAN_BITFIELD(hasSelectedChildrenOrCanHaveLeadingExpansion, HasSelectedChildrenOrCanHaveLeadingExpansion); ADD_BOOLEAN_BITFIELD(knownToHaveNoOverflow, KnownToHaveNoOverflow); ADD_BOOLEAN_BITFIELD(hasEllipsisBoxOrHyphen, HasEllipsisBoxOrHyphen); // for InlineTextBox ADD_BOOLEAN_BITFIELD(dirOverride, DirOverride); ADD_BOOLEAN_BITFIELD(isText, IsText); // Whether or not this object represents text with a non-zero height. Includes non-image list markers, text boxes. private: mutable unsigned m_determinedIfNextOnLineExists : 1; public: bool determinedIfNextOnLineExists() const { return m_determinedIfNextOnLineExists; } void setDeterminedIfNextOnLineExists(bool determinedIfNextOnLineExists) const { m_determinedIfNextOnLineExists = determinedIfNextOnLineExists; } private: mutable unsigned m_nextOnLineExists : 1; public: bool nextOnLineExists() const { return m_nextOnLineExists; } void setNextOnLineExists(bool nextOnLineExists) const { m_nextOnLineExists = nextOnLineExists; } private: signed m_expansion : 12; // for justified text public: signed expansion() const { return m_expansion; } void setExpansion(signed expansion) { m_expansion = expansion; } }; #undef ADD_BOOLEAN_BITFIELD private: InlineBoxBitfields m_bitfields; protected: // For RootInlineBox bool endsWithBreak() const { return m_bitfields.endsWithBreak(); } void setEndsWithBreak(bool endsWithBreak) { m_bitfields.setEndsWithBreak(endsWithBreak); } bool hasEllipsisBox() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } bool hasSelectedChildren() const { return m_bitfields.hasSelectedChildrenOrCanHaveLeadingExpansion(); } void setHasSelectedChildren(bool hasSelectedChildren) { m_bitfields.setHasSelectedChildrenOrCanHaveLeadingExpansion(hasSelectedChildren); } void setHasEllipsisBox(bool hasEllipsisBox) { m_bitfields.setHasEllipsisBoxOrHyphen(hasEllipsisBox); } // For InlineTextBox bool hasHyphen() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } void setHasHyphen(bool hasHyphen) { m_bitfields.setHasEllipsisBoxOrHyphen(hasHyphen); } bool canHaveLeadingExpansion() const { return m_bitfields.hasSelectedChildrenOrCanHaveLeadingExpansion(); } void setCanHaveLeadingExpansion(bool canHaveLeadingExpansion) { m_bitfields.setHasSelectedChildrenOrCanHaveLeadingExpansion(canHaveLeadingExpansion); } signed expansion() { return m_bitfields.expansion(); } void setExpansion(signed expansion) { m_bitfields.setExpansion(expansion); } // For InlineFlowBox and InlineTextBox bool extracted() const { return m_bitfields.extracted(); } #ifndef NDEBUG private: bool m_hasBadParent; #endif }; #ifdef NDEBUG inline InlineBox::~InlineBox() { } #endif #ifndef NDEBUG inline void InlineBox::setHasBadParent() { m_hasBadParent = true; } #endif } // namespace WebCore #ifndef NDEBUG // Outside the WebCore namespace for ease of invocation from gdb. void showTree(const WebCore::InlineBox*); void showLineTree(const WebCore::InlineBox*); #endif #endif // InlineBox_h
youfoh/webkit-efl
Source/WebCore/rendering/InlineBox.h
C
lgpl-2.1
17,097
/** * @file CaListOf.h * @brief Definition of the CaListOf class. * @author DEVISER * * <!-------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more * information about SBML, and the latest version of libSBML. * * Copyright (C) 2013-2016 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK * 3. University of Heidelberg, Heidelberg, Germany * * Copyright (C) 2009-2013 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK * * Copyright (C) 2006-2008 by the California Institute of Technology, * Pasadena, CA, USA * * Copyright (C) 2002-2005 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. Japan Science and Technology Agency, Japan * * 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. A copy of the license agreement is provided in the * file named "LICENSE.txt" included with this software distribution and also * available online as http://sbml.org/software/libsbml/license.html * ------------------------------------------------------------------------ --> * * @class * @sbmlbrief{} TODO:Definition of the CaListOf class. */ #ifndef CaListOf_h #define CaListOf_h #include <omex/common/extern.h> #include <omex/common/combinefwd.h> #include <omex/CaTypeCodes.h> #ifdef __cplusplus #include <vector> #include <algorithm> #include <functional> #include <omex/CaBase.h> LIBCOMBINE_CPP_NAMESPACE_BEGIN class CaVisitor; /** @cond doxygenLibomexInternal */ /** * Used by CaListOf::get() to lookup an CaBase based by its id. */ #ifndef SWIG template<class CNAME> struct CaIdEq : public std::unary_function<CaBase*, bool> { const std::string& id; CaIdEq (const std::string& id) : id(id) { } bool operator() (CaBase* sb) { return static_cast <CNAME*> (sb)->getId() == id; } }; #endif /* SWIG */ /** @endcond */ class LIBCOMBINE_EXTERN CaListOf : public CaBase { public: /** * Creates a new CaListOf object. * * @param level the OMEX Level; if not assigned, defaults to the * value of OMEX_DEFAULT_LEVEL. * * @param version the Version within the OMEX Level; if not assigned, * defaults to the value of OMEX_DEFAULT_VERSION. */ CaListOf (unsigned int level = OMEX_DEFAULT_LEVEL, unsigned int version = OMEX_DEFAULT_VERSION); /** * Creates a new CaListOf with a given CaNamespaces object. * * @param omexns the set of OMEX namespaces that this CaListOf should * contain. */ CaListOf (CaNamespaces* omexns); /** * Destroys this CaListOf and the items inside it. */ virtual ~CaListOf (); /** * Copy constructor; creates a copy of this CaListOf. * * @param orig the CaListOf instance to copy. */ CaListOf (const CaListOf& orig); /** * Assignment operator for CaListOf. */ CaListOf& operator=(const CaListOf& rhs); /** @cond doxygenLibomexInternal */ /** * Accepts the given CaVisitor. * * @param v the CaVisitor instance to be used. * * @return the result of calling <code>v.visit()</code>, which indicates * whether the Visitor would like to visit the next item in the * list. */ virtual bool accept (CaVisitor& v) const; /** @endcond */ /** * Creates and returns a deep copy of this CaListOf object. * * @return the (deep) copy of this CaListOf object. */ virtual CaListOf* clone () const; /** * Adds an item to the end of this CaListOf's list of items. * * This method makes a clone of the @p item handed to it. This means that * when the CaListOf object is destroyed, the original items will not be * destroyed. For a method with an alternative ownership behavior, see the * CaListOf::appendAndOwn(@if java CaBase@endif) method. * * @param item the item to be added to the list. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see appendAndOwn(CaBase* disownedItem) * @see appendFrom(const CaListOf* list) */ int append (const CaBase* item); /** * Adds an item to the end of this CaListOf's list of items. * * This method does not clone the @p disownedItem handed to it; instead, it assumes * ownership of it. This means that when the CaListOf is destroyed, the item * will be destroyed along with it. For a method with an alternative * ownership behavior, see the CaListOf::append(CaBase* item) method. * * @param disownedItem the item to be added to the list. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see append(const CaBase* item) * @see appendFrom(const CaListOf* list) */ int appendAndOwn (CaBase* disownedItem); /** * Adds a clone of a list of items to this CaListOf's list. * * Note that because this clones the objects handed to it, the original * items will not be destroyed when this CaListOf object is destroyed. * * @param list a list of items to be added. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see append(const CaBase* item) * @see appendAndOwn(CaBase* disownedItem) */ virtual int appendFrom (const CaListOf* list); /** * Inserts an item at a given position in this CaListOf's list of items. * * This variant of the method makes a clone of the @p item handed to it. * This means that when the CaListOf is destroyed, the original @p item will * <em>not</em> be destroyed. * * @param location the location in the list where to insert the item. * @param item the item to be inserted to the list. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see insertAndOwn(int location, CaBase* item) */ int insert (int location, const CaBase* item); /** * Inserts an item at a given position in this CaListOf's list of items. * * This variant of the method does not make a clone of the @p disownedItem handed to it. * This means that when the CaListOf is destroyed, the original @p item * <em>will</em> be destroyed. * * @param location the location where to insert the item * @param disownedItem the item to be inserted to the list * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see insert(int location, const CaBase* item) */ int insertAndOwn(int location, CaBase* disownedItem); /** * Get an item from the list. * * @param n the index number of the item to get. * * @return the <em>n</em>th item in this CaListOf items, or a null pointer if * the index number @p n refers to a nonexistent position in this list. * * @see size() */ virtual const CaBase* get (unsigned int n) const; /** * Get an item from the list. * * @param n the index number of the item to get. * * @return the <em>n</em>th item in this CaListOf items, or a null pointer if * the index number @p n refers to a nonexistent position in this list. * * @see size() */ virtual CaBase* get (unsigned int n); /** * Returns the first child element it can find with a specific "id" * attribute value, or @c NULL if no such object is found. * * @param id string representing the "id" attribute value of the * object to find. * * @return pointer to the first element found with the given identifier. */ virtual CaBase* getElementBySId(const std::string& id); /** * Returns the first child element found with the given meta-identifier. * * @param metaid string representing the "metaid" attribute of the object * to find. * * @return the first element found with the given @p metaid, or @c NULL if * no such object is found. */ virtual CaBase* getElementByMetaId(const std::string& metaid); /** * Returns a List of all child CaBase objects. * * The values returned include all children of the objects in this CaListOf * list, nested to an arbitrary depth. * * @return a List of pointers to all child objects. */ virtual List* getAllElements(); /** * Removes all items in this CaListOf object. * * If parameter @p doDelete is @c true (default), all items in this CaListOf * object are deleted and cleared, and thus the caller doesn't have to * delete those items. Otherwise, all items are cleared only from this * CaListOf object; the caller is still responsible for deleting the actual * items. (In the latter case, callers are advised to store pointers to * all items elsewhere before calling this function.) * * @param doDelete if @c true (default), all items are deleted and cleared. * Otherwise, all items are just cleared and not deleted. * * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif@~ */ void clear (bool doDelete = true); /** * Removes all items in this CaListOf object and deletes its properties too. * * This performs a call to clear() with an argument of @c true (thus removing * all the child objects in the list), followed by calls to various libCombine * <code>unset<em>Foo</em></code> methods to delete everything else: CVTerm * objects, model history objects, etc. * * @if cpp Implementations of subclasses of CaListOf may need to override * this method if different handling of child objects is needed.@endif@~ * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} */ virtual int removeFromParentAndDelete(); /** * Removes the <em>n</em>th item from this CaListOf list of items and returns * it. * * The caller owns the returned item and is responsible for deleting it. * * @param n the index of the item to remove * * @see size() */ virtual CaBase* remove (unsigned int n); /** * Returns number of items in this CaListOf list. * * @return the number of items in this CaListOf items. */ unsigned int size () const; /** @cond doxygenLibomexInternal */ /** * Sets the parent CaOmexManifest of this OMEX object. * * @param d the CaOmexManifest that should become the parent of this * CaListOf. */ virtual void setCaOmexManifest (CaOmexManifest* d); /** @endcond */ /** @cond doxygenLibomexInternal */ /** * Sets this OMEX object to child OMEX objects (if any). * (Creates a child-parent relationship by the parent) * * Subclasses must override this function if they define * one ore more child elements. * Basically, this function needs to be called in * constructor, copy constructor and assignment operator. * * @if cpp * @see setCaOmexManifest() * @see enablePackageInternal() * @endif */ virtual void connectToChild (); /** @endcond */ /** * Returns the libCombine type code for this object, namely, * @omexconstant{OMEX_LIST_OF, CaTypeCode_t}. * * @copydetails doc_what_are_typecodes * * @return the OMEX type code for this object: * @omexconstant{OMEX_LIST_OF, CaTypeCode_t} (default). * * @note The various CaListOf classes mostly differ from each other in what they * contain. Hence, one must call getItemTypeCode() to fully determine the * class of this OMEX object. * * @see getItemTypeCode() * @see getElementName() */ virtual int getTypeCode () const; /** * Get the type code of the objects contained in this CaListOf. * * Classes that inherit from the CaListOf class should override this method * to return the OMEX type code for the objects contained in this CaListOf. * If they do not, this method will return * @omexconstant{OMEX_UNKNOWN, CaTypeCode_t} * * @return The CaListOf base class contains no OMEX objects, and therefore * this method returns @omexconstant{OMEX_UNKNOWN, CaTypeCode_t}. * * @see getElementName() * @see getPackageName() */ virtual int getItemTypeCode () const; /** * Returns the XML element name of this object, which for CaListOf, is * always @c "listOf". * * @return the XML name of this element. */ virtual const std::string& getElementName () const; /** @cond doxygenLibomexInternal */ /** * Subclasses should override this method to write out their contained * OMEX objects as XML elements. Be sure to call your parents * implementation of this method as well. */ virtual void writeElements (XMLOutputStream& stream) const; /** @endcond */ protected: /** @cond doxygenLibomexInternal */ typedef std::vector<CaBase*> ListItem; typedef std::vector<CaBase*>::iterator ListItemIter; /** * Subclasses should override this method to get the list of * expected attributes. * This function is invoked from corresponding readAttributes() * function. */ virtual void addExpectedAttributes(ExpectedAttributes& attributes); /** * Subclasses should override this method to read values from the given * XMLAttributes set into their specific fields. Be sure to call your * parents implementation of this method as well. */ virtual void readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes); /** * Subclasses should override this method to write their XML attributes * to the XMLOutputStream. Be sure to call your parents implementation * of this method as well. For example: * * CaBase::writeAttributes(stream); * stream.writeAttribute( "id" , mId ); * stream.writeAttribute( "name", mName ); * ... */ virtual void writeAttributes (XMLOutputStream& stream) const; virtual bool isValidTypeForList(CaBase * item); ListItem mItems; /** @endcond */ }; LIBCOMBINE_CPP_NAMESPACE_END #endif /* __cplusplus */ #ifndef SWIG LIBCOMBINE_CPP_NAMESPACE_BEGIN BEGIN_C_DECLS /** * Creates a new instance of a CaListOf_t structure. * * @param level an unsigned int, the OMEX Level to assign to this * CaListOf_t structure. * * @param version an unsigned int, the OMEX Version to assign to this * CaListOf_t structure. * * @return a pointer to the newly-created CaListOf_t structure. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN CaListOf_t * CaListOf_create (unsigned int level, unsigned int version); /** * Frees the given CaListOf_t structure. * * This function assumes each item in the list is derived from CaBase_t. * * @param lo the CaListOf_t structure to be freed. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN void CaListOf_free (CaListOf_t *lo); /** * Creates a deep copy of the given CaListOf_t structure. * * @param lo the CaListOf_t structure to be copied. * * @return a (deep) copy of the given CaListOf_t structure, or a null * pointer if a failure occurred. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN CaListOf_t * CaListOf_clone (const CaListOf_t *lo); /** * Adds a copy of a given item to the end of a CaListOf_t list. * * @param lo the CaListOf_t structure to which the @p item should be appended. * @param item the item to append to the list. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see CaListOf_appendAndOwn() * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_append (CaListOf_t *lo, const CaBase_t *item); /** * Adds the given item to the end of a CaListOf_t list. * * @param lo the CaListOf_t structure to which the @p disownedItem should be appended. * @param disownedItem the item to append to the list. * * Unlike CaListOf_append(), this function does not copy the @p disownedItem. * The given @p lo list will contain the original item. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @see CaListOf_append() * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_appendAndOwn (CaListOf_t *lo, CaBase_t *disownedItem); /** * Adds clones a list of items from one list to another. * * @param lo the CaListOf_t list to which @p list will be appended. * @param list the list of items to append to @p lo. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_appendFrom (CaListOf_t *lo, CaListOf_t *list); /** * Inserts a copy of an item into a CaListOf_t list at a given position. * * @param lo the list into which @p item will be inserted. * @param location the starting index for the @p item in the @p lo list. * @param item the item to append to insert into @p lo. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_insert (CaListOf_t *lo, int location, const CaBase_t *item); /** * Inserts an item into a CaListOf_t list at a given position. * * Unlike CaListOf_insert(), this function does not clone @p disownedItem before * inserting it into @p lo, which means that @p lo becomes the owner. * * @param lo the list into which @p disownedItem will be inserted. * @param location the starting index for the @p disownedItem in the @p lo list. * @param disownedItem the item to append to insert into @p lo. * * @copydetails doc_returns_success_code * @li @omexconstant{LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t} * @li @omexconstant{LIBCOMBINE_INVALID_OBJECT, OperationReturnValues_t} * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_insertAndOwn (CaListOf_t *lo, int location, CaBase_t *disownedItem); /** * Returns the <em>n</em>th item of a given list. * * @param lo the list from which to retrieve the item. * @param n the index of the item to retrieve. * * @return the <em>n</em>th item in this CaListOf items, or a null pointer if * the index number @p n refers to a nonexistent position in @p lo. * * @see CaListOf_size() * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN CaBase_t * CaListOf_get (CaListOf_t *lo, unsigned int n); /** * Removes all items in this CaListOf_t structure. * * If @p doDelete is true (non-zero), all items in this CaListOf_t structure * are both deleted and cleared, and thus the caller doesn't have to delete * those items. Otherwise, if @p doDelete is false (zero), all items are * only cleared from this CaListOf_t structure and the caller is responsible * for deleting all items. (In the latter case, callers are advised to store * pointers to all items elsewhere before calling this function.) * * @param lo the CaListOf_t structure to clear * @param doDelete whether to delete the items. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN void CaListOf_clear (CaListOf_t *lo, int doDelete); /** * Removes the <em>n</em>th item from this CaListOf_t list and returns it. * * The caller owns the returned item and is responsible for deleting it. * * @param lo the list from which the item should be removed. * @param n the index number of the item to remove. * * @return the item removed, or a null pointer if no item existed at the * index @p n. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN CaBase_t * CaListOf_remove (CaListOf_t *lo, unsigned int n); /** * Returns the number of items in this CaListOf_t items. * * @param lo the CaListOf_t structure to count. * * @return the number of items in @p lo. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN unsigned int CaListOf_size (const CaListOf_t *lo); /** * Get the type code of the objects contained in the given CaListOf_t * structure. * * @copydetails doc_what_are_typecodes * * @param lo the CaListOf_t whose item type codes are sought. * * @return the type code corresponding to the objects in @p lo, * or @omexconstant{OMEX_UNKNOWN, CaTypeCode_t}. * * @memberof CaListOf_t */ LIBCOMBINE_EXTERN int CaListOf_getItemTypeCode (const CaListOf_t *lo); END_C_DECLS LIBCOMBINE_CPP_NAMESPACE_END #endif /* !SWIG */ #endif /* CaListOf_h */
hovo1990/deviser
generator/tests/test_other_library/test-code/CaListOf.h
C
lgpl-2.1
21,366
/** * Copyright (c) 2010-present Abixen Systems. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.abixen.platform.core.util.impl; import com.abixen.platform.core.model.enumtype.UserGender; import com.abixen.platform.core.model.enumtype.UserLanguage; import com.abixen.platform.core.model.enumtype.UserState; import com.abixen.platform.core.model.impl.Role; import com.abixen.platform.core.model.impl.User; import com.abixen.platform.core.util.EntityBuilder; import com.abixen.platform.core.util.UserBuilder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import java.util.Date; import java.util.HashSet; import java.util.Set; public class UserBuilderImpl extends EntityBuilder<User> implements UserBuilder { @Override protected void initProduct() { this.product = new User(); } @Override protected User assembleProduct() { return this.product; } public UserBuilder credentials(String username, String password) { this.product.setUsername(username); PasswordEncoder encoder = new BCryptPasswordEncoder(); this.product.setPassword(encoder.encode(password)); this.product.setHashKey(encoder.encode(username + password + new Date())); this.product.setState(UserState.CREATED); return this; } @Override public UserBuilder screenName(String screenName) { this.product.setScreenName(screenName); return this; } public UserBuilder personalData(String firstName, String middleName, String lastName) { this.product.setFirstName(firstName); this.product.setMiddleName(middleName); this.product.setLastName(lastName); return this; } @Override public UserBuilder additionalData(Date birthday, String jobTitle, UserLanguage language, UserGender gender) { this.product.setBirthday(birthday); this.product.setJobTitle(jobTitle); this.product.setSelectedLanguage(language); this.product.setGender(gender); return this; } public UserBuilder roles(Role... roles) { Set<Role> rolesSet = new HashSet<>(); for (Role role : roles) { rolesSet.add(role); } this.product.setRoles(rolesSet); return this; } public UserBuilder registrationIp(String registrationIp) { this.product.setRegistrationIp(registrationIp); return this; } }
adamturski/abixen-platform
abixen-platform-core/src/main/java/com/abixen/platform/core/util/impl/UserBuilderImpl.java
Java
lgpl-2.1
3,022
//-------------------------------------------------------------------------- // Code generated by the SmartSoft MDSD Toolchain Version 0.10.2 // The SmartSoft Toolchain has been developed by: // // ZAFH Servicerobotic Ulm // Christian Schlegel (schlegel@hs-ulm.de) // University of Applied Sciences // Prittwitzstr. 10 // 89075 Ulm (Germany) // // Information about the SmartSoft MDSD Toolchain is available at: // smart-robotics.sourceforge.net // // Please do not modify this file. It will be re-generated // running the code generator. //-------------------------------------------------------------------------- #ifndef _CURQUERYHANDLERCORE_HH #define _CURQUERYHANDLERCORE_HH #include "smartSoft.hh" // include communication objects #include <CommBasicObjects/commMobileLaserScan.hh> #include <CommNavigationObjects/commGridMap.hh> #include <CommNavigationObjects/commGridMapRequest.hh> #include <CommNavigationObjects/commMapperParameter.hh> class CurQueryHandlerCore: public CHS::QueryServerHandler< CommNavigationObjects::CommGridMapRequest, CommNavigationObjects::CommGridMap> { public: void handleQuery(CHS::QueryServer< CommNavigationObjects::CommGridMapRequest, CommNavigationObjects::CommGridMap> & server, const CHS::QueryId id, const CommNavigationObjects::CommGridMapRequest & request) throw() { } ; }; #endif
carlos22/SmartSoftCorba
src/components/SmartMapperGridMap/src/gen/CurQueryHandlerCore.hh
C++
lgpl-2.1
1,355
/* * GRIDGAIN - OPEN CLOUD PLATFORM. * COPYRIGHT (C) 2005-2008 GRIDGAIN SYSTEMS. ALL RIGHTS RESERVED. * * 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 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 */ package org.gridgain.grid.test.junit4; import java.util.*; import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.resources.*; /** * TODO: add file description. * * @author 2005-2009 Copyright (C) GridGain Systems. All Rights Reserved. * @version 2.1.1 */ /*@HIDE_FROM_JAVADOC@*/public class GridJunit4Task extends GridSystemTask<GridJunit4Argument, Object> { /** Injected local node ID. */ @GridLocalNodeIdResource private UUID locNodeId = null; /** Grid instance. */ @GridInstanceResource private Grid grid = null; /** * @param execCls Executed class. * @param execLdr Class loader for the class. */ protected GridJunit4Task(Class<?> execCls, ClassLoader execLdr) { super(execCls, execLdr); } /** * {@inheritDoc} */ public Map<? extends GridJob, GridNode> map(List<GridNode> subgrid, GridJunit4Argument arg) { GridJunit4Runner runner = arg.getRunner(); if (arg.isLocal() == true) { return Collections.singletonMap(new GridJunit4Job(runner), grid.getLocalNode()); } return Collections.singletonMap(new GridJunit4Job(runner), arg.getRouter().route(runner.getTestClass(), runner.getDescription().getDisplayName(), subgrid, locNodeId)); } /** * {@inheritDoc} */ public Object reduce(List<GridJobResult> results) throws GridException { assert results.size() == 1 : "ASSERTION [line=70, file=src/java/org/gridgain/grid/test/junit4/GridJunit4Task.java]"; GridJobResult res = results.get(0); if (res.getException() != null) { throw res.getException(); } return res.getData(); } }
hwellmann/omadac
platform/gridgain/src/main/java/org/gridgain/grid/test/junit4/GridJunit4Task.java
Java
lgpl-2.1
2,579
package awesomespider.lumina.TileEntities; import net.minecraft.entity.item.EntityItem; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; /** * Created by Awesome_Spider on 5/7/2015. */ public class TileEntityEssentiaInterface extends TileEntity{ /* Timer used in checking blocks for lumina orb*/ int timer = 20; public boolean orbLocated = false; public TileEntityLuminaOrb luminaOrb; @Override public void updateEntity(){ if (timer == 0){ if (!orbLocated) { checkForOrb(); } timer = 10; } else { timer --; } } /** * Check for the lumina orb. To be called once per second if the orb isn't located yet. */ public void checkForOrb(){ TileEntity te; //Search east and west of this tile entity te = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord); if (te == null) te = worldObj.getTileEntity(xCoord + 4, yCoord, zCoord); if (te == null) te = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord); if (te == null) te = worldObj.getTileEntity(xCoord - 4, yCoord, zCoord); //Search north and south of this tile entity if (te == null) te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2); if (te == null) te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 4); if (te == null) te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2); if (te == null) te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 4); if (te != null){ if (te instanceof TileEntityLuminaOrb) { orbLocated = true; luminaOrb = (TileEntityLuminaOrb) te; } } } }
AwesomeSpider/Lumina
src/main/java/awesomespider/lumina/TileEntities/TileEntityEssentiaInterface.java
Java
lgpl-2.1
1,770
// Jubatus: Online machine learning framework for distributed environment // Copyright (C) 2013 Preferred Infrastructure and Nippon Telegraph and Telephone Corporation. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License version 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <iostream> #include <iterator> #include <limits> #include <string> #include <utility> #include <vector> #include <gtest/gtest.h> #include <pficommon/lang/cast.h> #include <pficommon/text/json.h> #include "../storage/storage_type.hpp" #include "../storage/local_storage.hpp" #include "../classifier/classifier_test_util.hpp" #include "../classifier/classifier.hpp" #include "../fv_converter/datum.hpp" #include "classifier.hpp" #include "test_util.hpp" using std::string; using std::vector; using std::pair; using std::make_pair; using std::isfinite; using std::numeric_limits; using std::cout; using std::endl; using pfi::lang::lexical_cast; using pfi::data::optional; using jubatus::core::fv_converter::datum; using jubatus::core::classifier::classify_result; namespace jubatus { namespace core { namespace driver { namespace { datum convert_vector(const vector<double>& vec) { datum d; for (size_t i = 0; i < vec.size(); i++) { string f = "f" + lexical_cast<string>(i); d.num_values_.push_back(make_pair(f, vec[i])); } return d; } void make_random_data( pfi::math::random::mtrand& rand, vector<pair<string, datum> >& data, size_t size) { for (size_t i = 0; i < size; ++i) { pair<string, vector<double> > p = gen_random_data(rand); data.push_back(make_pair(p.first, convert_vector(p.second))); } } string get_max_label(const classify_result& result) { string max_label = ""; double max_prob = 0; for (size_t i = 0; i < result.size(); ++i) { if (max_label == "" || result[i].score > max_prob) { max_label = result[i].label; max_prob = result[i].score; } } return max_label; } } // namespace typedef pair<core::storage::storage_base*, core::classifier::classifier_base*> storage_pair; class classifier_test : public ::testing::TestWithParam<storage_pair> { protected: void SetUp() { classifier_.reset(new driver::classifier( GetParam().first, GetParam().second, make_fv_converter())); } void TearDown() { classifier_.reset(); } void my_test(); pfi::lang::shared_ptr<core::driver::classifier> classifier_; }; TEST_P(classifier_test, simple) { datum d; classifier_->train(make_pair(string("hoge"), d)); classifier_->classify(d); } TEST_P(classifier_test, api_train) { pfi::math::random::mtrand rand(0); const size_t example_size = 1000; vector<pair<string, datum> > data; make_random_data(rand, data, example_size); for (size_t i = 0; i < example_size; i++) { classifier_->train(data[i]); } } void classifier_test::my_test() { pfi::math::random::mtrand rand(0); const size_t example_size = 1000; vector<pair<string, datum> > data; make_random_data(rand, data, example_size); for (size_t i = 0; i < example_size; i++) { classifier_->train(data[i]); } vector<string> labels; vector<classify_result> result; { vector<pair<string, datum> >::const_iterator it; for (it = data.begin(); it != data.end(); ++it) { labels.push_back(it->first); result.push_back(classifier_->classify(it->second)); } } ASSERT_EQ(example_size, result.size()); ASSERT_EQ(data.size(), result.size()); vector<string>::const_iterator it0; // answers vector<classify_result>::const_iterator it; size_t count = 0; for (it = result.begin(), it0 = labels.begin(); it != result.end() && it0 != labels.end(); ++it, ++it0) { ASSERT_EQ(2u, it->size()); // estimate_results should have two label OK/NG string most0; double prob0 = DBL_MIN; classify_result::const_iterator ite; for (ite = it->begin(); ite != it->end(); ++ite) { // get most likely label if (prob0 < ite->score || ite == it->begin()) { prob0 = ite->score; most0 = ite->label; } } if (most0.compare(*it0) == 0) { count++; } // EXPECT_TRUE(*it0 == most0); if (most0.compare(*it0) != 0) { cout << *it0 << "!=" << most0 << endl; for (ite = it->begin(); ite != it->end(); ++ite) { cout << ite->label << "\t" << ite->score << endl; } } } // num of wrong classification should be less than 5% EXPECT_GE(count, result.size() - 50); } TEST_P(classifier_test, my_test) { my_test(); } TEST_P(classifier_test, duplicated_keys) { pfi::math::random::mtrand rand(0); datum d; for (size_t k = 0; k < 10; ++k) { uint32_t dim = rand.next_int(100); pair<string, double> feature = make_pair(lexical_cast<string>(dim), 1.0); // add 100 duplicated values for (size_t j = 0; j < 100; ++j) d.num_values_.push_back(feature); } pair<string, datum> data("", d); for (size_t i = 0; i < 100; ++i) { data.first = i % 2 == 0 ? "P" : "N"; classifier_->train(data); } { datum d; for (size_t i = 0; i < 100; ++i) { d.num_values_.push_back(make_pair(lexical_cast<string>(i), 1.0)); } classify_result result = classifier_->classify(d); /* if the classifier could not learn properly, it estimates scores of labels to NaN and returns no results. */ ASSERT_EQ(2u, result.size()); } } TEST_P(classifier_test, save_load) { pfi::math::random::mtrand rand(0); const size_t example_size = 1000; vector<pair<string, datum> > data; make_random_data(rand, data, example_size); for (size_t i = 0; i < example_size; i++) { classifier_->train(data[i]); } std::string save_data; save_model(classifier_->get_mixable_holder(), save_data); classifier_->clear(); load_model(classifier_->get_mixable_holder(), save_data); my_test(); } TEST_P(classifier_test, save_load_2) { std::string save_empty, save_test; // Test data datum pos; pos.num_values_.push_back(make_pair("value", 10.0)); datum neg; neg.num_values_.push_back(make_pair("value", -10.0)); // Save empty state save_model(classifier_->get_mixable_holder(), save_empty); // Train vector<pair<string, datum> > data; classifier_->train(make_pair("pos", pos)); classifier_->train(make_pair("neg", neg)); // Now, the classifier can classify properly ASSERT_EQ("pos", get_max_label(classifier_->classify(pos))); ASSERT_EQ("neg", get_max_label(classifier_->classify(neg))); // Save current state save_model(classifier_->get_mixable_holder(), save_test); // Load empty load_model(classifier_->get_mixable_holder(), save_empty); // And the classifier classify data improperly, but cannot expect results string pos_max = get_max_label(classifier_->classify(pos)); string neg_max = get_max_label(classifier_->classify(neg)); ASSERT_EQ(0, pos_max.compare(neg_max)); // Reload server load_model(classifier_->get_mixable_holder(), save_test); // The classifier works well ASSERT_EQ("pos", get_max_label(classifier_->classify(pos))); ASSERT_EQ("neg", get_max_label(classifier_->classify(neg))); } TEST_P(classifier_test, nan) { datum d; d.num_values_.push_back( make_pair("value", numeric_limits<float>::quiet_NaN())); classifier_->train(make_pair(string("l1"), d)); classify_result result = classifier_->classify(d); ASSERT_EQ(1u, result.size()); EXPECT_FALSE(isfinite(result[0].score)); } vector<storage_pair> create_classifiers() { vector<storage_pair> method; core::storage::storage_base* storage; core::classifier::classifier_config config; // TODO(unknown): testing with perceptron? storage = new core::storage::local_storage; method.push_back(make_pair(storage, new core::classifier::passive_aggressive(storage))); storage = new core::storage::local_storage; method.push_back(make_pair(storage, new core::classifier::passive_aggressive_1(config, storage))); storage = new core::storage::local_storage; method.push_back(make_pair(storage, new core::classifier::passive_aggressive_2(config, storage))); storage = new core::storage::local_storage; config.C = 0.1f; method.push_back(make_pair(storage, new core::classifier::normal_herd(config, storage))); return method; } INSTANTIATE_TEST_CASE_P(classifier_test_instance, classifier_test, testing::ValuesIn(create_classifiers())); } // driver namespace } // core namespace } // jubatus namespace
abetv/jubatus
jubatus/core/driver/classifier_test.cpp
C++
lgpl-2.1
9,059
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2012 Sam Lantinga 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 Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" /* Initialization code for SDL */ #include "SDL.h" #include "SDL_fatal.h" #if !SDL_VIDEO_DISABLED #include "video/SDL_leaks.h" #endif #if SDL_THREAD_PTH #include <pth.h> #endif /* Initialization/Cleanup routines */ #if !SDL_JOYSTICK_DISABLED extern int SDL_JoystickInit(void); extern void SDL_JoystickQuit(void); #endif #if !SDL_CDROM_DISABLED extern int SDL_CDROMInit(void); extern void SDL_CDROMQuit(void); #endif #if !SDL_TIMERS_DISABLED extern void SDL_StartTicks(void); extern int SDL_TimerInit(void); extern void SDL_TimerQuit(void); #endif /* The current SDL version */ static SDL_version version = { SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL }; /* The initialized subsystems */ static Uint32 SDL_initialized = 0; #if !SDL_TIMERS_DISABLED static Uint32 ticks_started = 0; #endif #ifdef CHECK_LEAKS int surfaces_allocated = 0; #endif int SDL_InitSubSystem(Uint32 flags) { #if !SDL_TIMERS_DISABLED /* Initialize the timer subsystem */ if ( ! ticks_started ) { SDL_StartTicks(); ticks_started = 1; } if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) { if ( SDL_TimerInit() < 0 ) { return(-1); } SDL_initialized |= SDL_INIT_TIMER; } #else if ( flags & SDL_INIT_TIMER ) { SDL_SetError("SDL not built with timer support"); return(-1); } #endif #if !SDL_VIDEO_DISABLED /* Initialize the video/event subsystem */ if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) { if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"), (flags&SDL_INIT_EVENTTHREAD)) < 0 ) { return(-1); } SDL_initialized |= SDL_INIT_VIDEO; } #else if ( flags & SDL_INIT_VIDEO ) { SDL_SetError("SDL not built with video support"); return(-1); } #endif #if !SDL_AUDIO_DISABLED /* Initialize the audio subsystem */ if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) { if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) { return(-1); } SDL_initialized |= SDL_INIT_AUDIO; } #else if ( flags & SDL_INIT_AUDIO ) { SDL_SetError("SDL not built with audio support"); return(-1); } #endif #if !SDL_JOYSTICK_DISABLED /* Initialize the joystick subsystem */ if ( (flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK) ) { if ( SDL_JoystickInit() < 0 ) { return(-1); } SDL_initialized |= SDL_INIT_JOYSTICK; } #else if ( flags & SDL_INIT_JOYSTICK ) { SDL_SetError("SDL not built with joystick support"); return(-1); } #endif #if !SDL_CDROM_DISABLED /* Initialize the CD-ROM subsystem */ if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) { if ( SDL_CDROMInit() < 0 ) { return(-1); } SDL_initialized |= SDL_INIT_CDROM; } #else if ( flags & SDL_INIT_CDROM ) { SDL_SetError("SDL not built with cdrom support"); return(-1); } #endif return(0); } int SDL_Init(Uint32 flags) { #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH if (!pth_init()) { return -1; } #endif /* Clear the error message */ SDL_ClearError(); /* Initialize the desired subsystems */ if ( SDL_InitSubSystem(flags) < 0 ) { return(-1); } /* Everything is initialized */ if ( !(flags & SDL_INIT_NOPARACHUTE) ) { SDL_InstallParachute(); } return(0); } void SDL_QuitSubSystem(Uint32 flags) { /* Shut down requested initialized subsystems */ #if !SDL_CDROM_DISABLED if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) { SDL_CDROMQuit(); SDL_initialized &= ~SDL_INIT_CDROM; } #endif #if !SDL_JOYSTICK_DISABLED if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) { SDL_JoystickQuit(); SDL_initialized &= ~SDL_INIT_JOYSTICK; } #endif #if !SDL_AUDIO_DISABLED if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) { SDL_AudioQuit(); SDL_initialized &= ~SDL_INIT_AUDIO; } #endif #if !SDL_VIDEO_DISABLED if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) { SDL_VideoQuit(); SDL_initialized &= ~SDL_INIT_VIDEO; } #endif #if !SDL_TIMERS_DISABLED if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) { SDL_TimerQuit(); SDL_initialized &= ~SDL_INIT_TIMER; } #endif } Uint32 SDL_WasInit(Uint32 flags) { if ( ! flags ) { flags = SDL_INIT_EVERYTHING; } return (SDL_initialized&flags); } void SDL_Quit(void) { /* Quit all subsystems */ #ifdef DEBUG_BUILD printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); fflush(stdout); #endif SDL_QuitSubSystem(SDL_INIT_EVERYTHING); #ifdef CHECK_LEAKS #ifdef DEBUG_BUILD printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout); #endif /* Print the number of surfaces not freed */ if ( surfaces_allocated != 0 ) { //fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n", //surfaces_allocated); } #endif #ifdef DEBUG_BUILD printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout); #endif /* Uninstall any parachute signal handlers */ SDL_UninstallParachute(); #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH pth_kill(); #endif #ifdef DEBUG_BUILD printf("[SDL_Quit] : Returning!\n"); fflush(stdout); #endif } /* Return the library version number */ const SDL_version * SDL_Linked_Version(void) { return(&version); } #if defined(__OS2__) /* Building for OS/2 */ #ifdef __WATCOMC__ #define INCL_DOSERRORS #define INCL_DOSEXCEPTIONS #include <os2.h> /* Exception handler to prevent the Audio thread hanging, making a zombie process! */ ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec, PEXCEPTIONREGISTRATIONRECORD pERegRec, PCONTEXTRECORD pCtxRec, PVOID p) { if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) return XCPT_CONTINUE_SEARCH; if (pERepRec->fHandlerFlags & EH_UNWINDING) return XCPT_CONTINUE_SEARCH; if (pERepRec->fHandlerFlags & EH_NESTED_CALL) return XCPT_CONTINUE_SEARCH; /* Do cleanup at every fatal exception! */ if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) && (pERepRec->ExceptionNum != XCPT_BREAKPOINT) && (pERepRec->ExceptionNum != XCPT_SINGLE_STEP) ) { if (SDL_initialized & SDL_INIT_AUDIO) { /* This removes the zombie audio thread in case of emergency. */ #ifdef DEBUG_BUILD printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n"); #endif SDL_CloseAudio(); } } return (XCPT_CONTINUE_SEARCH); } EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler}; /* The main DLL entry for DLL Initialization and Uninitialization: */ unsigned _System LibMain(unsigned hmod, unsigned termination) { if (termination) { #ifdef DEBUG_BUILD /* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */ #endif DosUnsetExceptionHandler(&SDL_Main_xcpthand); return 1; } else { #ifdef DEBUG_BUILD /* Make stdout and stderr unbuffered! */ setbuf(stdout, NULL); setbuf(stderr, NULL); #endif /* Fire up exception handler */ #ifdef DEBUG_BUILD /* printf("[SDL DLL Initialization] : Setting exception handler\n"); */ #endif /* Set exception handler */ DosSetExceptionHandler(&SDL_Main_xcpthand); return 1; } } #endif /* __WATCOMC__ */ #elif defined(__WIN32__) && !defined(__SYMBIAN32__) #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) /* Need to include DllMain() on Watcom C for some reason.. */ #define WIN32_LEAN_AND_MEAN #include <windows.h> BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } #endif /* building DLL with Watcom C */ #endif /* OS/2 elif __WIN32__ */
ruler501/pSDL
src/SDL.c
C
lgpl-2.1
8,663
from leapp.topics import Topic class ApiTestTopic(Topic): name = 'api_test'
leapp-to/prototype
tests/data/actor-api-tests/topics/apitest.py
Python
lgpl-2.1
82
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CHECKOUTPROGRESSWIZARDPAGE_H #define CHECKOUTPROGRESSWIZARDPAGE_H #include <QSharedPointer> #include <QWizardPage> namespace VcsBase { class Command; namespace Internal { namespace Ui { class CheckoutProgressWizardPage; } class CheckoutProgressWizardPage : public QWizardPage { Q_OBJECT public: enum State { Idle, Running, Failed, Succeeded }; explicit CheckoutProgressWizardPage(QWidget *parent = 0); ~CheckoutProgressWizardPage(); void setStartedStatus(const QString &startedStatus); void start(Command *command); virtual bool isComplete() const; bool isRunning() const{ return m_state == Running; } void terminate(); signals: void terminated(bool success); private slots: void slotFinished(bool ok, int exitCode, const QVariant &cookie); void slotOutput(const QString &text); void slotError(const QString &text); private: Ui::CheckoutProgressWizardPage *ui; Command *m_command; QString m_startedStatus; QString m_error; State m_state; }; } // namespace Internal } // namespace VcsBase #endif // CHECKOUTPROGRESSWIZARDPAGE_H
richardmg/qtcreator
src/plugins/vcsbase/checkoutprogresswizardpage.h
C
lgpl-2.1
2,578
package cpw.mods.fml.common.asm.transformers; import static org.objectweb.asm.Opcodes.ACC_FINAL; import static org.objectweb.asm.Opcodes.ACC_PRIVATE; import static org.objectweb.asm.Opcodes.ACC_PROTECTED; import static org.objectweb.asm.Opcodes.ACC_PUBLIC; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.util.Collection; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.MethodNode; import com.google.common.base.Charsets; import com.google.common.base.Splitter; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.io.LineProcessor; import com.google.common.io.Resources; import cpw.mods.fml.relauncher.IClassTransformer; public class AccessTransformer implements IClassTransformer { private static final boolean DEBUG = false; private class Modifier { public String name = ""; public String desc = ""; public int oldAccess = 0; public int newAccess = 0; public int targetAccess = 0; public boolean changeFinal = false; public boolean markFinal = false; protected boolean modifyClassVisibility; private void setTargetAccess(String name) { if (name.startsWith("public")) targetAccess = ACC_PUBLIC; else if (name.startsWith("private")) targetAccess = ACC_PRIVATE; else if (name.startsWith("protected")) targetAccess = ACC_PROTECTED; if (name.endsWith("-f")) { changeFinal = true; markFinal = false; } else if (name.endsWith("+f")) { changeFinal = true; markFinal = true; } } } private Multimap<String, Modifier> modifiers = ArrayListMultimap.create(); public AccessTransformer() throws IOException { this("fml_at.cfg"); } protected AccessTransformer(String rulesFile) throws IOException { readMapFile(rulesFile); } private void readMapFile(String rulesFile) throws IOException { File file = new File(rulesFile); URL rulesResource; if (file.exists()) { rulesResource = file.toURI().toURL(); } else { rulesResource = Resources.getResource(rulesFile); } Resources.readLines(rulesResource, Charsets.UTF_8, new LineProcessor<Void>() { @Override public Void getResult() { return null; } @Override public boolean processLine(String input) throws IOException { String line = Iterables.getFirst(Splitter.on('#').limit(2).split(input), "").trim(); if (line.length()==0) { return true; } List<String> parts = Lists.newArrayList(Splitter.on(" ").trimResults().split(line)); if (parts.size()>2) { throw new RuntimeException("Invalid config file line "+ input); } Modifier m = new Modifier(); m.setTargetAccess(parts.get(0)); List<String> descriptor = Lists.newArrayList(Splitter.on(".").trimResults().split(parts.get(1))); if (descriptor.size() == 1) { m.modifyClassVisibility = true; } else { String nameReference = descriptor.get(1); int parenIdx = nameReference.indexOf('('); if (parenIdx>0) { m.desc = nameReference.substring(parenIdx); m.name = nameReference.substring(0,parenIdx); } else { m.name = nameReference; } } modifiers.put(descriptor.get(0).replace('/', '.'), m); return true; } }); } @SuppressWarnings("unchecked") @Override public byte[] transform(String name, byte[] bytes) { if (bytes == null) { return null; } if (!modifiers.containsKey(name)) { return bytes; } ClassNode classNode = new ClassNode(); ClassReader classReader = new ClassReader(bytes); classReader.accept(classNode, 0); Collection<Modifier> mods = modifiers.get(name); for (Modifier m : mods) { if (m.modifyClassVisibility) { classNode.access = getFixedAccess(classNode.access, m); if (DEBUG) { System.out.println(String.format("Class: %s %s -> %s", name, toBinary(m.oldAccess), toBinary(m.newAccess))); } continue; } if (m.desc.isEmpty()) { for (FieldNode n : (List<FieldNode>) classNode.fields) { if (n.name.equals(m.name) || m.name.equals("*")) { n.access = getFixedAccess(n.access, m); if (DEBUG) { System.out.println(String.format("Field: %s.%s %s -> %s", name, n.name, toBinary(m.oldAccess), toBinary(m.newAccess))); } if (!m.name.equals("*")) { break; } } } } else { for (MethodNode n : (List<MethodNode>) classNode.methods) { if ((n.name.equals(m.name) && n.desc.equals(m.desc)) || m.name.equals("*")) { n.access = getFixedAccess(n.access, m); if (DEBUG) { System.out.println(String.format("Method: %s.%s%s %s -> %s", name, n.name, n.desc, toBinary(m.oldAccess), toBinary(m.newAccess))); } if (!m.name.equals("*")) { break; } } } } } ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); classNode.accept(writer); return writer.toByteArray(); } private String toBinary(int num) { return String.format("%16s", Integer.toBinaryString(num)).replace(' ', '0'); } private int getFixedAccess(int access, Modifier target) { target.oldAccess = access; int t = target.targetAccess; int ret = (access & ~7); switch (access & 7) { case ACC_PRIVATE: ret |= t; break; case 0: // default ret |= (t != ACC_PRIVATE ? t : 0 /* default */); break; case ACC_PROTECTED: ret |= (t != ACC_PRIVATE && t != 0 /* default */? t : ACC_PROTECTED); break; case ACC_PUBLIC: ret |= (t != ACC_PRIVATE && t != 0 /* default */&& t != ACC_PROTECTED ? t : ACC_PUBLIC); break; default: throw new RuntimeException("The fuck?"); } // Clear the "final" marker on fields only if specified in control field if (target.changeFinal && target.desc == "") { if (target.markFinal) { ret |= ACC_FINAL; } else { ret &= ~ACC_FINAL; } } target.newAccess = ret; return ret; } public static void main(String[] args) { if (args.length < 2) { System.out.println("Usage: AccessTransformer <JarPath> <MapFile> [MapFile2]... "); System.exit(1); } boolean hasTransformer = false; AccessTransformer[] trans = new AccessTransformer[args.length - 1]; for (int x = 1; x < args.length; x++) { try { trans[x - 1] = new AccessTransformer(args[x]); hasTransformer = true; } catch (IOException e) { System.out.println("Could not read Transformer Map: " + args[x]); e.printStackTrace(); } } if (!hasTransformer) { System.out.println("Culd not find a valid transformer to perform"); System.exit(1); } File orig = new File(args[0]); File temp = new File(args[0] + ".ATBack"); if (!orig.exists() && !temp.exists()) { System.out.println("Could not find target jar: " + orig); System.exit(1); } if (!orig.renameTo(temp)) { System.out.println("Could not rename file: " + orig + " -> " + temp); System.exit(1); } try { processJar(temp, orig, trans); } catch (IOException e) { e.printStackTrace(); System.exit(1); } if (!temp.delete()) { System.out.println("Could not delete temp file: " + temp); } } private static void processJar(File inFile, File outFile, AccessTransformer[] transformers) throws IOException { ZipInputStream inJar = null; ZipOutputStream outJar = null; try { try { inJar = new ZipInputStream(new BufferedInputStream(new FileInputStream(inFile))); } catch (FileNotFoundException e) { throw new FileNotFoundException("Could not open input file: " + e.getMessage()); } try { outJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFile))); } catch (FileNotFoundException e) { throw new FileNotFoundException("Could not open output file: " + e.getMessage()); } ZipEntry entry; while ((entry = inJar.getNextEntry()) != null) { if (entry.isDirectory()) { outJar.putNextEntry(entry); continue; } byte[] data = new byte[4096]; ByteArrayOutputStream entryBuffer = new ByteArrayOutputStream(); int len; do { len = inJar.read(data); if (len > 0) { entryBuffer.write(data, 0, len); } } while (len != -1); byte[] entryData = entryBuffer.toByteArray(); String entryName = entry.getName(); if (entryName.endsWith(".class") && !entryName.startsWith(".")) { ClassNode cls = new ClassNode(); ClassReader rdr = new ClassReader(entryData); rdr.accept(cls, 0); String name = cls.name.replace('/', '.').replace('\\', '.'); for (AccessTransformer trans : transformers) { entryData = trans.transform(name, entryData); } } ZipEntry newEntry = new ZipEntry(entryName); outJar.putNextEntry(newEntry); outJar.write(entryData); } } finally { if (outJar != null) { try { outJar.close(); } catch (IOException e) { } } if (inJar != null) { try { inJar.close(); } catch (IOException e) { } } } } public void ensurePublicAccessFor(String modClazzName) { Modifier m = new Modifier(); m.setTargetAccess("public"); m.modifyClassVisibility = true; modifiers.put(modClazzName, m); } }
aerospark/FML
common/cpw/mods/fml/common/asm/transformers/AccessTransformer.java
Java
lgpl-2.1
13,117
/* gpgme-w32spawn.c - Wrapper to spawn a process under Windows. * Copyright (C) 2008 g10 Code GmbH * * This file is part of GPGME. * * GPGME 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. * * GPGME 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 <https://gnu.org/licenses/>. * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <ctype.h> #include <string.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #include <stdint.h> #include <process.h> #include "priv-io.h" /* Name of this program. */ #define PGM "gpgme-w32spawn" static char * build_commandline (char **argv) { int i; int n = 0; char *buf; char *p; /* We have to quote some things because under Windows the program parses the commandline and does some unquoting. We enclose the whole argument in double-quotes, and escape literal double-quotes as well as backslashes with a backslash. We end up with a trailing space at the end of the line, but that is harmless. */ for (i = 0; argv[i]; i++) { p = argv[i]; /* The leading double-quote. */ n++; while (*p) { /* An extra one for each literal that must be escaped. */ if (*p == '\\' || *p == '"') n++; n++; p++; } /* The trailing double-quote and the delimiter. */ n += 2; } /* And a trailing zero. */ n++; buf = p = malloc (n); if (!buf) return NULL; for (i = 0; argv[i]; i++) { char *argvp = argv[i]; *(p++) = '"'; while (*argvp) { if (*argvp == '\\' || *argvp == '"') *(p++) = '\\'; *(p++) = *(argvp++); } *(p++) = '"'; *(p++) = ' '; } *(p++) = 0; return buf; } int my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags) { SECURITY_ATTRIBUTES sec_attr; PROCESS_INFORMATION pi = { NULL, /* returns process handle */ 0, /* returns primary thread handle */ 0, /* returns pid */ 0 /* returns tid */ }; STARTUPINFO si; char *envblock = NULL; int cr_flags = CREATE_DEFAULT_ERROR_MODE | GetPriorityClass (GetCurrentProcess ()); int i; char *arg_string; int duped_stdin = 0; int duped_stdout = 0; int duped_stderr = 0; HANDLE hnul = INVALID_HANDLE_VALUE; i = 0; while (argv[i]) { fprintf (stderr, PGM": argv[%2i] = %s\n", i, argv[i]); i++; } memset (&sec_attr, 0, sizeof sec_attr); sec_attr.nLength = sizeof sec_attr; sec_attr.bInheritHandle = FALSE; arg_string = build_commandline (argv); if (!arg_string) return -1; memset (&si, 0, sizeof si); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; si.wShowWindow = (flags & IOSPAWN_FLAG_SHOW_WINDOW) ? SW_SHOW : SW_HIDE; si.hStdInput = GetStdHandle (STD_INPUT_HANDLE); si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); si.hStdError = GetStdHandle (STD_ERROR_HANDLE); fprintf (stderr, PGM": spawning: %s\n", arg_string); for (i = 0; fd_list[i].fd != -1; i++) { /* The handle already is inheritable. */ if (fd_list[i].dup_to == 0) { si.hStdInput = (HANDLE) fd_list[i].peer_name; duped_stdin = 1; fprintf (stderr, PGM": dup 0x%x to stdin\n", fd_list[i].peer_name); } else if (fd_list[i].dup_to == 1) { si.hStdOutput = (HANDLE) fd_list[i].peer_name; duped_stdout = 1; fprintf (stderr, PGM": dup 0x%x to stdout\n", fd_list[i].peer_name); } else if (fd_list[i].dup_to == 2) { si.hStdError = (HANDLE) fd_list[i].peer_name; duped_stderr = 1; fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_list[i].peer_name); } } if (!duped_stdin || !duped_stdout || !duped_stderr) { SECURITY_ATTRIBUTES sa; memset (&sa, 0, sizeof sa); sa.nLength = sizeof sa; sa.bInheritHandle = TRUE; hnul = CreateFile ("nul", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hnul == INVALID_HANDLE_VALUE) { free (arg_string); /* FIXME: Should translate the error code. */ errno = EIO; return -1; } /* Make sure that the process has a connected stdin. */ if (!duped_stdin) si.hStdInput = hnul; /* Make sure that the process has a connected stdout. */ if (!duped_stdout) si.hStdOutput = hnul; /* We normally don't want all the normal output. */ if (!duped_stderr) si.hStdError = hnul; } cr_flags |= CREATE_SUSPENDED; if (!CreateProcessA (argv[0], arg_string, &sec_attr, /* process security attributes */ &sec_attr, /* thread security attributes */ TRUE, /* inherit handles */ cr_flags, /* creation flags */ envblock, /* environment */ NULL, /* use current drive/directory */ &si, /* startup information */ &pi)) /* returns process information */ { free (arg_string); /* FIXME: Should translate the error code. */ errno = EIO; return -1; } free (arg_string); /* Close the /dev/nul handle if used. */ if (hnul != INVALID_HANDLE_VALUE) CloseHandle (hnul); for (i = 0; fd_list[i].fd != -1; i++) CloseHandle ((HANDLE) fd_list[i].fd); if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) { static int initialized; static BOOL (WINAPI * func)(DWORD); void *handle; if (!initialized) { /* Available since W2000; thus we dynload it. */ initialized = 1; handle = LoadLibrary ("user32.dll"); if (handle) { func = GetProcAddress (handle, "AllowSetForegroundWindow"); if (!func) FreeLibrary (handle); } } if (func) { int rc = func (pi.dwProcessId); fprintf (stderr, PGM": AllowSetForegroundWindow(%d): rc=%d\n", (int)pi.dwProcessId, rc); } } ResumeThread (pi.hThread); CloseHandle (pi.hThread); CloseHandle (pi.hProcess); return 0; } #define MAX_TRANS 10 int translate_get_from_file (const char *trans_file, struct spawn_fd_item_s *fd_list, unsigned int *r_flags) { /* Hold roughly MAX_TRANS triplets of 64 bit numbers in hex notation: "0xFEDCBA9876543210". 10*19*4 - 1 = 759. This plans ahead for a time when a HANDLE is 64 bit. */ #define BUFFER_MAX 810 char line[BUFFER_MAX + 1]; char *linep; int idx; int res; int fd; *r_flags = 0; fd = open (trans_file, O_RDONLY); if (fd < 0) return -1; /* We always read one line from stdin. */ res = read (fd, line, BUFFER_MAX); close (fd); if (res < 0) return -1; line[BUFFER_MAX] = '\0'; linep = strchr (line, '\n'); if (linep) { if (linep > line && linep[-1] == '\r') linep--; *linep = '\0'; } linep = line; /* Now start to read mapping pairs. */ for (idx = 0; idx < MAX_TRANS; idx++) { unsigned long from; long dup_to; unsigned long to; unsigned long loc; char *tail; /* FIXME: Maybe could use scanf. */ while (isspace (*((unsigned char *)linep))) linep++; if (*linep == '\0') break; if (!idx && *linep == '~') { /* Spawn flags have been passed. */ linep++; *r_flags = strtoul (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; linep = tail; while (isspace (*((unsigned char *)linep))) linep++; if (*linep == '\0') break; } from = strtoul (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; linep = tail; while (isspace (*linep)) linep++; if (*linep == '\0') break; dup_to = strtol (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; linep = tail; while (isspace (*linep)) linep++; if (*linep == '\0') break; to = strtoul (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; linep = tail; while (isspace (*linep)) linep++; if (*linep == '\0') break; loc = strtoul (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; linep = tail; fd_list[idx].fd = from; fd_list[idx].dup_to = dup_to; fd_list[idx].peer_name = to; fd_list[idx].arg_loc = loc; } fd_list[idx].fd = -1; fd_list[idx].dup_to = -1; fd_list[idx].peer_name = -1; fd_list[idx].arg_loc = 0; return 0; } /* Read the translated handles from TRANS_FILE and do a substitution in ARGV. Returns the new argv and the list of substitutions in FD_LIST (which must be MAX_TRANS+1 large). */ char ** translate_handles (const char *trans_file, const char * const *argv, struct spawn_fd_item_s *fd_list, unsigned int *r_flags) { int res; int idx; int n_args; char **args; res = translate_get_from_file (trans_file, fd_list, r_flags); if (res < 0) return NULL; for (idx = 0; argv[idx]; idx++) ; args = malloc (sizeof (*args) * (idx + 1)); for (idx = 0; argv[idx]; idx++) { args[idx] = strdup (argv[idx]); if (!args[idx]) return NULL; } args[idx] = NULL; n_args = idx; for (idx = 0; fd_list[idx].fd != -1; idx++) { char buf[25]; int aidx; aidx = fd_list[idx].arg_loc; if (aidx == 0) continue; if (aidx >= n_args) { fprintf (stderr, PGM": translation file does not match args\n"); return NULL; } args[aidx] = malloc (sizeof (buf)); /* We currently disable translation for stdin/stdout/stderr. We assume that the spawned program handles 0/1/2 specially already. FIXME: Check if this is true. */ if (!args[idx] || fd_list[idx].dup_to != -1) return NULL; /* NOTE: Here is the part where application specific knowledge comes in. GPGME/GnuPG uses two forms of descriptor specification, a plain number and a "-&" form. */ if (argv[aidx][0] == '-' && argv[aidx][1] == '&') snprintf (args[aidx], sizeof (buf), "-&%d", fd_list[idx].peer_name); else snprintf (args[aidx], sizeof (buf), "%d", fd_list[idx].peer_name); } return args; } int main (int argc, const char * const *argv) { int rc = 0; char **argv_spawn; struct spawn_fd_item_s fd_list[MAX_TRANS + 1]; unsigned int flags; if (argc < 3) { rc = 2; goto leave; } argv_spawn = translate_handles (argv[1], &argv[2], fd_list, &flags); if (!argv_spawn) { rc = 2; goto leave; } /* Using execv does not replace the existing program image, but spawns a new one and daemonizes it, confusing the command line interpreter. So we have to use spawnv. */ rc = my_spawn (argv_spawn, fd_list, flags); if (rc < 0) { fprintf (stderr, PGM": executing `%s' failed: %s\n", argv[0], strerror (errno)); rc = 2; goto leave; } leave: if (rc) fprintf (stderr, PGM": internal error\n"); /* Always try to delete the temporary file. */ if (argc >= 2) { if (DeleteFile (argv[1]) == 0) fprintf (stderr, PGM": failed to delete %s: ec=%ld\n", argv[1], GetLastError ()); } return rc; }
gpg/gpgme
src/gpgme-w32spawn.c
C
lgpl-2.1
12,153
/********** 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. (See <http://www.gnu.org/copyleft/lesser.html>.) 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 **********/ // "liveMedia" // Copyright (c) 1996-2012 Live Networks, Inc. All rights reserved. // A filter that converts a MPEG Transport Stream file - with corresponding index file // - to a corresponding Video Elementary Stream. It also uses a "scale" parameter // to implement 'trick mode' (fast forward or reverse play, using I-frames) on // the video stream. // Implementation #include "../MPEG2TransportStreamTrickModeFilter.hh" #include "../ByteStreamFileSource.hh" // Define the following to be True if we want the output file to have the same frame rate as the original file. // (Because the output file contains I-frames only, this means that each I-frame will appear in the output file // several times, and therefore the output file's bitrate will be significantly higher than that of the original.) // Define the following to be False if we want the output file to include each I-frame no more than once. // (This means that - except for high 'scale' values - both the output frame rate and the output bit rate // will be less than that of the original.) #define KEEP_ORIGINAL_FRAME_RATE False MPEG2TransportStreamTrickModeFilter* MPEG2TransportStreamTrickModeFilter ::createNew(UsageEnvironment& env, FramedSource* inputSource, MPEG2TransportStreamIndexFile* indexFile, int scale) { return new MPEG2TransportStreamTrickModeFilter(env, inputSource, indexFile, scale); } MPEG2TransportStreamTrickModeFilter ::MPEG2TransportStreamTrickModeFilter(UsageEnvironment& env, FramedSource* inputSource, MPEG2TransportStreamIndexFile* indexFile, int scale) : FramedFilter(env, inputSource), fHaveStarted(False), fIndexFile(indexFile), fScale(scale), fDirection(1), fState(SKIPPING_FRAME), fFrameCount(0), fNextIndexRecordNum(0), fNextTSPacketNum(0), fCurrentTSPacketNum((unsigned long)(-1)), fUseSavedFrameNextTime(False) { if (fScale < 0) { // reverse play fScale = -fScale; fDirection = -1; } } MPEG2TransportStreamTrickModeFilter::~MPEG2TransportStreamTrickModeFilter() { } Boolean MPEG2TransportStreamTrickModeFilter::seekTo(unsigned long tsPacketNumber, unsigned long indexRecordNumber) { seekToTransportPacket(tsPacketNumber); fNextIndexRecordNum = indexRecordNumber; return True; } #define isIFrameStart(type) ((type) == 0x81/*actually, a VSH*/ || (type) == 0x85/*actually, a SPS*//*for H.264*/) // This relies upon I-frames always being preceded by a VSH+GOP (for MPEG-2 data) and by a SPS (for H.264 data) #define isNonIFrameStart(type) ((type) == 0x83 || (type) == 0x88/*for H.264*/) void MPEG2TransportStreamTrickModeFilter::doGetNextFrame() { // fprintf(stderr, "#####DGNF1\n"); // If our client's buffer size is too small, then deliver // a 0-byte 'frame', to tell it to process all of the data that it has // already read, before asking for more data from us: if (fMaxSize < TRANSPORT_PACKET_SIZE) { fFrameSize = 0; afterGetting(this); return; } while (1) { // Get the next record from our index file. // This tells us the type of frame this data is, which Transport Stream packet // (from the input source) the data comes from, and where in the Transport Stream // packet it comes from: u_int8_t recordType; float recordPCR; Boolean endOfIndexFile = False; if (!fIndexFile->readIndexRecordValues(fNextIndexRecordNum, fDesiredTSPacketNum, fDesiredDataOffset, fDesiredDataSize, recordPCR, recordType)) { // We ran off the end of the index file. If we're not delivering a // pre-saved frame, then handle this the same way as if the // input Transport Stream source ended. if (fState != DELIVERING_SAVED_FRAME) { onSourceClosure1(); return; } endOfIndexFile = True; } else if (!fHaveStarted) { fFirstPCR = recordPCR; fHaveStarted = True; } // fprintf(stderr, "#####read index record %ld: ts %ld: %c, PCR %f\n", fNextIndexRecordNum, fDesiredTSPacketNum, isIFrameStart(recordType) ? 'I' : isNonIFrameStart(recordType) ? 'j' : 'x', recordPCR); fNextIndexRecordNum += (fState == DELIVERING_SAVED_FRAME) ? 1 : fDirection; // Handle this index record, depending on the record type and our current state: switch (fState) { case SKIPPING_FRAME: case SAVING_AND_DELIVERING_FRAME: { // if (fState == SKIPPING_FRAME) fprintf(stderr, "\tSKIPPING_FRAME\n"); else fprintf(stderr, "\tSAVING_AND_DELIVERING_FRAME\n");//##### if (isIFrameStart(recordType)) { // Save a record of this frame: fSavedFrameIndexRecordStart = fNextIndexRecordNum - fDirection; fUseSavedFrameNextTime = True; // fprintf(stderr, "\trecording\n");//##### if ((fFrameCount++)%fScale == 0 && fUseSavedFrameNextTime) { // A frame is due now. fFrameCount = 1; // reset to avoid overflow if (fDirection > 0) { // Begin delivering this frame, as we're scanning it: fState = SAVING_AND_DELIVERING_FRAME; // fprintf(stderr, "\tdelivering\n");//##### fDesiredDataPCR = recordPCR; // use this frame's PCR attemptDeliveryToClient(); return; } else { // Deliver this frame, then resume normal scanning: // (This relies on the index records having begun with an I-frame.) fState = DELIVERING_SAVED_FRAME; fSavedSequentialIndexRecordNum = fNextIndexRecordNum; fDesiredDataPCR = recordPCR; // use this frame's (not the saved frame's) PCR fNextIndexRecordNum = fSavedFrameIndexRecordStart; // fprintf(stderr, "\tbeginning delivery of saved frame\n");//##### } } else { // No frame is needed now: fState = SKIPPING_FRAME; } } else if (isNonIFrameStart(recordType)) { if ((fFrameCount++)%fScale == 0 && fUseSavedFrameNextTime) { // A frame is due now, so begin delivering the one that we had saved: // (This relies on the index records having begun with an I-frame.) fFrameCount = 1; // reset to avoid overflow fState = DELIVERING_SAVED_FRAME; fSavedSequentialIndexRecordNum = fNextIndexRecordNum; fDesiredDataPCR = recordPCR; // use this frame's (not the saved frame's) PCR fNextIndexRecordNum = fSavedFrameIndexRecordStart; // fprintf(stderr, "\tbeginning delivery of saved frame\n");//##### } else { // No frame is needed now: fState = SKIPPING_FRAME; } } else { // Not the start of a frame, but deliver it, if it's needed: if (fState == SAVING_AND_DELIVERING_FRAME) { // fprintf(stderr, "\tdelivering\n");//##### fDesiredDataPCR = recordPCR; // use this frame's PCR attemptDeliveryToClient(); return; } } break; } case DELIVERING_SAVED_FRAME: { // fprintf(stderr, "\tDELIVERING_SAVED_FRAME\n");//##### if (endOfIndexFile || (isIFrameStart(recordType) && fNextIndexRecordNum-1 != fSavedFrameIndexRecordStart) || isNonIFrameStart(recordType)) { // fprintf(stderr, "\tended delivery of saved frame\n");//##### // We've reached the end of the saved frame, so revert to the // original sequence of index records: fNextIndexRecordNum = fSavedSequentialIndexRecordNum; fUseSavedFrameNextTime = KEEP_ORIGINAL_FRAME_RATE; fState = SKIPPING_FRAME; } else { // Continue delivering: // fprintf(stderr, "\tdelivering\n");//##### attemptDeliveryToClient(); return; } break; } } } } void MPEG2TransportStreamTrickModeFilter::doStopGettingFrames() { FramedFilter::doStopGettingFrames(); fIndexFile->stopReading(); } void MPEG2TransportStreamTrickModeFilter::attemptDeliveryToClient() { if (fCurrentTSPacketNum == fDesiredTSPacketNum) { // fprintf(stderr, "\t\tdelivering ts %d:%d, %d bytes, PCR %f\n", fCurrentTSPacketNum, fDesiredDataOffset, fDesiredDataSize, fDesiredDataPCR);//##### // We already have the Transport Packet that we want. Deliver its data: memmove(fTo, &fInputBuffer[fDesiredDataOffset], fDesiredDataSize); fFrameSize = fDesiredDataSize; float deliveryPCR = fDirection*(fDesiredDataPCR - fFirstPCR)/fScale; if (deliveryPCR < 0.0) deliveryPCR = 0.0; fPresentationTime.tv_sec = (unsigned long)deliveryPCR; fPresentationTime.tv_usec = (unsigned long)((deliveryPCR - fPresentationTime.tv_sec)*1000000.0f); // fprintf(stderr, "#####DGNF9\n"); afterGetting(this); } else { // Arrange to read the Transport Packet that we want: readTransportPacket(fDesiredTSPacketNum); } } void MPEG2TransportStreamTrickModeFilter::seekToTransportPacket(unsigned long tsPacketNum) { if (tsPacketNum == fNextTSPacketNum) return; // we're already there ByteStreamFileSource* tsFile = (ByteStreamFileSource*)fInputSource; u_int64_t tsPacketNum64 = (u_int64_t)tsPacketNum; tsFile->seekToByteAbsolute(tsPacketNum64*TRANSPORT_PACKET_SIZE); fNextTSPacketNum = tsPacketNum; } void MPEG2TransportStreamTrickModeFilter::readTransportPacket(unsigned long tsPacketNum) { seekToTransportPacket(tsPacketNum); fInputSource->getNextFrame(fInputBuffer, TRANSPORT_PACKET_SIZE, afterGettingFrame, this, onSourceClosure, this); } void MPEG2TransportStreamTrickModeFilter ::afterGettingFrame(void* clientData, unsigned frameSize, unsigned /*numTruncatedBytes*/, struct timeval presentationTime, unsigned /*durationInMicroseconds*/) { MPEG2TransportStreamTrickModeFilter* filter = (MPEG2TransportStreamTrickModeFilter*)clientData; filter->afterGettingFrame1(frameSize); } void MPEG2TransportStreamTrickModeFilter::afterGettingFrame1(unsigned frameSize) { if (frameSize != TRANSPORT_PACKET_SIZE) { // Treat this as if the input source ended: onSourceClosure1(); return; } fCurrentTSPacketNum = fNextTSPacketNum; // i.e., the one that we just read ++fNextTSPacketNum; // Attempt deliver again: attemptDeliveryToClient(); } void MPEG2TransportStreamTrickModeFilter::onSourceClosure(void* clientData) { MPEG2TransportStreamTrickModeFilter* filter = (MPEG2TransportStreamTrickModeFilter*)clientData; filter->onSourceClosure1(); } void MPEG2TransportStreamTrickModeFilter::onSourceClosure1() { fIndexFile->stopReading(); FramedSource::handleClosure(this); }
hatboyzero/live456
liveMedia/src/MPEG2TransportStreamTrickModeFilter.cpp
C++
lgpl-2.1
10,943
/* * 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 distributed.update; import distributed.dto.IMessage; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; /** * * @author steffen */ public abstract class AUpdateServer extends Thread { protected static final Logger log = Logger.getLogger(AUpdateServer.class.getName()); protected List<IMessage> objectBuffer; protected List<IMessage> updateQueue; protected List<IMessage> sublist; protected ServerSocket server; protected Socket client; protected ObjectInputStream ois; protected ObjectOutputStream oos; protected boolean inProgress; public AUpdateServer(int port) { log.debug("Init UpdateServer"); updateQueue = new ArrayList<>(); try { server = new ServerSocket(port); inProgress = true; } catch (IOException e) { log.error(e); } } protected abstract void prepareGroupMessageList(); protected abstract void preparePrivateMessageList(); private void processMessage(Object o) { if (o instanceof UpdateProtokoll) { UpdateProtokoll msg = (UpdateProtokoll) o; log.debug("Received: " + msg.getTask()); switch (msg.getTask()) { case LOAD_GROUP_MESSAGES: log.debug("Load GroupMessage"); prepareGroupMessageList(); if (msg.getObjectCount() == 0) { //TODO Plain update log.debug("Object count is 0"); updateQueue.addAll(objectBuffer); sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.SUCESSFUL)); } else if (msg.getObjectCount() <= objectBuffer.size()) { log.debug("Object count lower equal"); //Adding missing messages and updating changed sublist = objectBuffer.subList(0, msg.getObjectCount()); updateQueue.addAll(objectBuffer.subList(msg.getObjectCount(), objectBuffer.size())); sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.START_UPDATE)); } else { //TODO NOT SUPPORTED IN THIS VERSION //Breaks the entropy paradigm of the incremental update log.error("UpdateClient contains more messages as server"); sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.FAILURE)); } break; case LOAD_PRIVATE_MESSAGES: log.debug("Load PrivateMessages"); preparePrivateMessageList(); if (msg.getObjectCount() == 0) { //TODO PLain update sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.SUCESSFUL)); } else if (msg.getObjectCount() <= objectBuffer.size()) { sublist = objectBuffer.subList(0, msg.getObjectCount()); updateQueue.addAll(objectBuffer.subList(msg.getObjectCount(), objectBuffer.size())); sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.START_UPDATE)); } else { //TODO Breaks the entropy paradigm log.error("Update not possible, entropy paradigm broken"); sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.FAILURE)); } case COMPARE_IMSG_HASH: if (checkHash(msg)) { //Hashes equal sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.HASH_EQUALS)); log.debug("Hashes of block are equal"); } else { //Hashes differ sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.HASH_DIFFERS)); } break; case ACK: try { oos.writeObject(updateQueue); log.debug("UpdateQueue written"); } catch(IOException io) { log.error(io); } break; case SUCESSFUL: inProgress = false; break; case FAILURE: throw new UpdateFailureException("FAILURE Received"); default: log.warn("Unknown message received while update"); } } } private boolean checkHash(UpdateProtokoll up) { if (up.getObjectCount() != 1) { List<IMessage> tmpList = sublist.subList( up.getPivot(), up.getPivot() + up.getObjectCount()); if (tmpList.hashCode() == up.getHash()) { log.debug("hashes equal"); return true; } log.debug("hashes unequal"); return false; } else { if(up.getObjectCount() == 1) { if(sublist.get(up.getPivot()).hashCode() == up.getHash()) return true; log.debug("Hash at leaf different add to uq"); updateQueue.add(sublist.get(up.getPivot())); return false; } } return false; } /** * Send an UpdateProtokoll to the client; * * @param msg The object which should be send. */ private void sendProtokollMessage(UpdateProtokoll msg) { try { log.debug("Send: " + msg.getTask()); oos.flush(); oos.writeObject(msg); } catch (IOException io) { log.error(io); } } @Override public void run() { try { client = server.accept(); log.debug("Client connected"); oos = new ObjectOutputStream( client.getOutputStream()); ois = new ObjectInputStream( client.getInputStream()); log.debug("Streams opend"); Object o; while (inProgress) { o = ois.readObject(); log.debug("Read Object"); processMessage(o); } sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.SEND_GM_REQ)); o = ois.readObject(); processMessage(o); inProgress = true; while (inProgress) { o = ois.readObject(); log.debug("Read Object"); processMessage(o); } sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.SEND_PM_REQ)); o = ois.readObject(); processMessage(o); } catch (IOException e) { log.error(e); } catch (ClassNotFoundException cnf) { log.error(cnf); } catch (UpdateFailureException ufe) { sendProtokollMessage(new UpdateProtokoll( UpdateProtokoll.UpdateTask.FAILURE)); log.error(ufe); } finally { log.info("Update ended 1"); } } }
Fussel/distributed
Distributed/src/distributed/update/AUpdateServer.java
Java
lgpl-2.1
8,307
//------------------------------------------------------------------------------ // <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 { /// <summary> /// Choice [0, *] /// Feature [0, *] /// </summary> public class BridgeElement : XsdBaseReader { public BridgeElement(System.Xml.XmlReader reader) : base(reader) { } /// <summary> /// Represents the actual measured distance along the geometry in numeric decimal form expressed in linear units. Also known as the internal station value where no station equations are applied. /// </summary> public double? StaStart; /// <summary> /// Represents the actual measured distance along the geometry in numeric decimal form expressed in linear units. Also known as the internal station value where no station equations are applied. /// </summary> public double? StaEnd; public double? Width; public BridgeProjectType? ProjectType; #region XsdBaseReader protected override bool NewReader(string namespaceURI, string name) { if (name.EqualsIgnoreCase("Feature")) { this.SetCurrent("Feature", this.NewReader<Feature>()); return true; } return base.NewReader(namespaceURI, name); } #endregion #region XsdBaseObject public override bool Read(IDictionary<string, string> attributes, string text) { base.Read(attributes, text); this.StaStart = XsdConverter.Instance.Convert<double?>( attributes.GetSafe("staStart")); this.StaEnd = XsdConverter.Instance.Convert<double?>( attributes.GetSafe("staEnd")); this.Width = XsdConverter.Instance.Convert<double?>( attributes.GetSafe("width")); this.ProjectType = XsdConverter.Instance.Convert<BridgeProjectType?>( attributes.GetSafe("projectType")); return true; } public override string ToAttributes() { AttributesBuilder buff = new AttributesBuilder(base.ToAttributes()); if ((object)this.StaStart != null) { buff.Append("staStart", this.StaStart); } if ((object)this.StaEnd != null) { buff.Append("staEnd", this.StaEnd); } if ((object)this.Width != null) { buff.Append("width", this.Width); } if ((object)this.ProjectType != null) { buff.Append("projectType", this.ProjectType); } return buff.ToString(); } #endregion #region object public override string ToString() { StringBuilder buff = new StringBuilder(base.ToString()); if ((object)this.StaStart != null) { buff.AppendFormat("staStart = {0}", this.StaStart).AppendLine(); } if ((object)this.StaEnd != null) { buff.AppendFormat("staEnd = {0}", this.StaEnd).AppendLine(); } if ((object)this.Width != null) { buff.AppendFormat("width = {0}", this.Width).AppendLine(); } if ((object)this.ProjectType != null) { buff.AppendFormat("projectType = {0}", this.ProjectType).AppendLine(); } return buff.ToString(); } #endregion } } #endif
jlroviramartin/XsdProcessor
LandXml20/BridgeElement.cs
C#
lgpl-2.1
4,278
using System; using System.IO; using System.Threading; using GitSharp.Core; using GitSharp.Core.Tests.Util; using GitSharp.Tests.GitSharp.Core.Util; using NUnit.Framework; using FileMode = GitSharp.Core.FileMode; namespace GitSharp.Core.Tests { [TestFixture] public class IndexModifiedTests : RepositoryTestCase { [Test] public void ShouldSupportExtensionlessFiles() { var index = new GitIndex(db); writeTrashFile("extensionless-file", "contents"); var file = new FileInfo(Path.Combine(trash.FullName, "extensionless-file")); index.add(trash, file); var entry = index.GetEntry("extensionless-file"); Assert.IsFalse(entry.IsModified(trash, true)); } [Test] public void ShouldSupportNotModifiedExtensionlessFilesWithoutContentChecking() { var index = new GitIndex(db); writeTrashFile("extensionless-file", "contents"); var file = new FileInfo(Path.Combine(trash.FullName, "extensionless-file")); index.add(trash, file); var entry = index.GetEntry("extensionless-file"); Assert.IsFalse(entry.IsModified(trash)); } [Test] public void ShouldAllowComparingOfAlreadyOpenedFile() { var index = new GitIndex(db); var file = writeTrashFile("extensionless-file", "contents"); index.add(trash, file); var entry = index.GetEntry("extensionless-file"); // [henon] failed on my windows box (originally only observed on mono/unix) when executed in resharper or with nunit without waiting a second! // as the timing is not the point of the test here let's wait a sec anyway. Thread.Sleep(TimeSpan.FromSeconds(1)); // replace contents of file (with same size so it passes the size check) using (var writer = file.CreateText()) writer.Write("stnetnoc"); // opening the file for reading shoudn't block us from checking the contents using (file.OpenRead()) Assert.IsTrue(entry.IsModified(trash, true)); } } }
henon/GitSharp
GitSharp.Tests/GitSharp.Core/IndexModifiedTests.cs
C#
lgpl-2.1
1,910
/* * * The DbUnit Database Testing Framework * Copyright (C)2002-2004, DbUnit.org * * 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.dbunit.dataset.xml; import org.dbunit.dataset.AbstractTableTest; import org.dbunit.dataset.Column; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; import org.dbunit.testutil.TestUtils; import java.io.File; /** * @author Manuel Laflamme * @version $Revision: 1162 $ * @since Mar 12, 2002 */ public class FlatXmlTableTest extends AbstractTableTest { public FlatXmlTableTest(String s) { super(s); } protected ITable createTable() throws Exception { return createDataSet(true).getTable("TEST_TABLE"); } protected IDataSet createDataSet(boolean noneAsNull) throws Exception { return new FlatXmlDataSetBuilder().build(TestUtils.getFile("xml/flatXmlTableTest.xml")); } public void testGetMissingValue() throws Exception { int row = 0; Object[] expected = {"row 1 col 0", null, "row 1 col 2"}; ITable table = createDataSet(false).getTable("MISSING_VALUES"); Column[] columns = table.getTableMetaData().getColumns(); assertEquals("column count", expected.length, columns.length); assertEquals("row count", 1, table.getRowCount()); for (int i = 0; i < columns.length; i++) { assertEquals("value " + i, expected[i], table.getValue(row, columns[i].getColumnName())); } } public void testLoadCRLF() throws Exception { int row = 0; Object[] expected = {"row 0 \n col 0 \r"}; // in the expected result the &#xA; and &#xD; should be replaced by \n and \r ITable table = createDataSet(false).getTable("TABLE_VALUE_METACHARS"); Column[] columns = table.getTableMetaData().getColumns(); assertEquals("column count", expected.length, columns.length); assertEquals("row count", 1, table.getRowCount()); for (int i = 0; i < columns.length; i++) { assertEquals("value " + i, expected[i], table.getValue(row, columns[i].getColumnName())); } } // public void testGetValueAndNoSuchColumn() throws Exception // { // ITable table = createTable(); // String columnName = "Unknown"; // // Object value = table.getValue(0, columnName); // assertEquals("no value", null, value); // } }
wbstr/dbunit
src/test/java/org/dbunit/dataset/xml/FlatXmlTableTest.java
Java
lgpl-2.1
3,184
// The libMesh Finite Element Library. // Copyright (C) 2002-2021 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_TREE_H #define LIBMESH_TREE_H // Local includes #include "libmesh/tree_node.h" #include "libmesh/tree_base.h" // C++ includes namespace libMesh { // Forward Declarations class MeshBase; /** * This class defines a tree that may be used for fast point * location in space. * * \author Benjamin S. Kirk * \date 2002 * \brief Tree class templated on the number of leaves on each node. */ template <unsigned int N> class Tree : public TreeBase { public: /** * Constructor. Requires a mesh and the target bin size. Optionally takes the build method. */ Tree (const MeshBase & m, unsigned int target_bin_size, Trees::BuildType bt = Trees::NODES); /** * Copy-constructor. Not currently implemented. */ Tree (const Tree<N> & other_tree); /** * Destructor. */ ~Tree() = default; /** * Prints the nodes. */ virtual void print_nodes(std::ostream & my_out=libMesh::out) const override; /** * Prints the nodes. */ virtual void print_elements(std::ostream & my_out=libMesh::out) const override; /** * \returns The number of active bins. */ virtual unsigned int n_active_bins() const override { return root.n_active_bins(); } /** * \returns A pointer to the element containing point p, * optionally restricted to a set of allowed subdomains, * optionally using a non-zero relative tolerance for searches. */ virtual const Elem * find_element(const Point & p, const std::set<subdomain_id_type> * allowed_subdomains = nullptr, Real relative_tol = TOLERANCE) const override; /** * Fills \p candidate_elements with any elements containing the * specified point \p p, * optionally restricted to a set of allowed subdomains, * optionally using a non-zero relative tolerance for searches. */ virtual void find_elements(const Point & p, std::set<const Elem *> & candidate_elements, const std::set<subdomain_id_type> * allowed_subdomains = nullptr, Real relative_tol = TOLERANCE) const override; /** * \returns A pointer to the element containing point p, * optionally restricted to a set of allowed subdomains, * optionally using a non-zero relative tolerance for searches. */ const Elem * operator() (const Point & p, const std::set<subdomain_id_type> * allowed_subdomains = nullptr, Real relative_tol = TOLERANCE) const; private: /** * The tree root. */ TreeNode<N> root; /** * How the tree is built. */ const Trees::BuildType build_type; }; /** * For convenience we define QuadTrees and OctTrees * explicitly. */ namespace Trees { /** * A BinaryTree is a tree appropriate * for 1D meshes. */ typedef Tree<2> BinaryTree; /** * A QuadTree is a tree appropriate * for 2D meshes. */ typedef Tree<4> QuadTree; /** * An OctTree is a tree appropriate * for 3D meshes. */ typedef Tree<8> OctTree; } } // namespace libMesh #endif // LIBMESH_TREE_H
dschwen/libmesh
include/utils/tree.h
C
lgpl-2.1
3,992
<html dir="LTR"> <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>NoOpLoggerFactoryAdapter Methods</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">NoOpLoggerFactoryAdapter Methods</h1> </div> </div> <div id="nstext"> <p>The methods of the <b>NoOpLoggerFactoryAdapter</b> class are listed below. For a complete list of <b>NoOpLoggerFactoryAdapter</b> class members, see the <a href="Common.Logging~Common.Logging.Simple.NoOpLoggerFactoryAdapter~Members.html">NoOpLoggerFactoryAdapter Members</a> topic.</p> <h4 class="dtH4" xmlns:ndoc="urn:ndoc-schema">Public Instance Methods</h4> <div class="tablediv" xmlns:ndoc="urn:ndoc-schema"> <table class="dtTABLE" cellspacing="0"> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassEqualsTopic.aspx">Equals</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassGetHashCodeTopic.aspx">GetHashCode</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="Common.Logging~Common.Logging.Simple.NoOpLoggerFactoryAdapter.GetLogger.html">GetLogger</a></td><td width="50%"> Get a ILog instance by type </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassGetTypeTopic.aspx">GetType</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassToStringTopic.aspx">ToString</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr></table> </div> <h4 class="dtH4" xmlns:ndoc="urn:ndoc-schema">Protected Instance Methods</h4> <div class="tablediv" xmlns:ndoc="urn:ndoc-schema"> <table class="dtTABLE" cellspacing="0"> <tr VALIGN="top"><td width="50%"><img src="protmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassFinalizeTopic.aspx">Finalize</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="protmethod.gif"></img><a href="http://msdn.microsoft.com/{0}/library/{1}({2}).aspxSystemObjectClassMemberwiseCloneTopic.aspx">MemberwiseClone</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr></table> </div> <h4 class="dtH4">See Also</h4> <p> <a href="Common.Logging~Common.Logging.Simple.NoOpLoggerFactoryAdapter.html">NoOpLoggerFactoryAdapter Class</a> | <a href="Common.Logging~Common.Logging.Simple.html">Common.Logging.Simple Namespace</a> | <a href="Common.Logging~Common.Logging.LogManager.Adapter.html">Adapter</a> | <a href="Common.Logging~Common.Logging.ConfigurationSectionHandler.html">ConfigurationSectionHandler</a></p> <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"> <param name="Keyword" value="NoOpLoggerFactoryAdapter class, methods"> </param> </object> <hr /> <div id="footer"> <p> <a href="mailto:netcommon-developer@lists.sourceforge.net?subject=Common%20Logging%202.0%20API%20Reference%20Documentation%20Feedback:%20NoOpLoggerFactoryAdapter Methods">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 [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~Common.Logging.Simple.NoOpLoggerFactoryAdapter~Methods.html
HTML
lgpl-2.1
4,548
package com.sun.jna.platform.win32; import junit.framework.TestCase; public class ShlwapiTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(ShlwapiTest.class); } public void testPathIsUNC() { assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\path1\\path2")); assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\path1")); assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("acme\\\\path4\\\\path5")); assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\")); assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1\\path2")); assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1")); assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\")); assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("\\path1")); assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("path1")); assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("c:\\path1")); assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\c:\\path1")); } }
trejkaz/jna
contrib/platform/test/com/sun/jna/platform/win32/ShlwapiTest.java
Java
lgpl-2.1
1,072
/**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** 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. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSIZE_H #define QSIZE_H #include <QtCore/qnamespace.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Core) class Q_CORE_EXPORT QSize { public: QSize(); QSize(int w, int h); bool isNull() const; bool isEmpty() const; bool isValid() const; int width() const; int height() const; void setWidth(int w); void setHeight(int h); void transpose(); void scale(int w, int h, Qt::AspectRatioMode mode); void scale(const QSize &s, Qt::AspectRatioMode mode); QSize expandedTo(const QSize &) const; QSize boundedTo(const QSize &) const; int &rwidth(); int &rheight(); QSize &operator+=(const QSize &); QSize &operator-=(const QSize &); QSize &operator*=(qreal c); QSize &operator/=(qreal c); friend inline bool operator==(const QSize &, const QSize &); friend inline bool operator!=(const QSize &, const QSize &); friend inline const QSize operator+(const QSize &, const QSize &); friend inline const QSize operator-(const QSize &, const QSize &); friend inline const QSize operator*(const QSize &, qreal); friend inline const QSize operator*(qreal, const QSize &); friend inline const QSize operator/(const QSize &, qreal); private: int wd; int ht; }; Q_DECLARE_TYPEINFO(QSize, Q_MOVABLE_TYPE); /***************************************************************************** QSize stream functions *****************************************************************************/ #ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSize &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &); #endif /***************************************************************************** QSize inline functions *****************************************************************************/ inline QSize::QSize() { wd = ht = -1; } inline QSize::QSize(int w, int h) { wd = w; ht = h; } inline bool QSize::isNull() const { return wd==0 && ht==0; } inline bool QSize::isEmpty() const { return wd<1 || ht<1; } inline bool QSize::isValid() const { return wd>=0 && ht>=0; } inline int QSize::width() const { return wd; } inline int QSize::height() const { return ht; } inline void QSize::setWidth(int w) { wd = w; } inline void QSize::setHeight(int h) { ht = h; } inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) { scale(QSize(w, h), mode); } inline int &QSize::rwidth() { return wd; } inline int &QSize::rheight() { return ht; } inline QSize &QSize::operator+=(const QSize &s) { wd+=s.wd; ht+=s.ht; return *this; } inline QSize &QSize::operator-=(const QSize &s) { wd-=s.wd; ht-=s.ht; return *this; } inline QSize &QSize::operator*=(qreal c) { wd = qRound(wd*c); ht = qRound(ht*c); return *this; } inline bool operator==(const QSize &s1, const QSize &s2) { return s1.wd == s2.wd && s1.ht == s2.ht; } inline bool operator!=(const QSize &s1, const QSize &s2) { return s1.wd != s2.wd || s1.ht != s2.ht; } inline const QSize operator+(const QSize & s1, const QSize & s2) { return QSize(s1.wd+s2.wd, s1.ht+s2.ht); } inline const QSize operator-(const QSize &s1, const QSize &s2) { return QSize(s1.wd-s2.wd, s1.ht-s2.ht); } inline const QSize operator*(const QSize &s, qreal c) { return QSize(qRound(s.wd*c), qRound(s.ht*c)); } inline const QSize operator*(qreal c, const QSize &s) { return QSize(qRound(s.wd*c), qRound(s.ht*c)); } inline QSize &QSize::operator/=(qreal c) { Q_ASSERT(!qFuzzyIsNull(c)); wd = qRound(wd/c); ht = qRound(ht/c); return *this; } inline const QSize operator/(const QSize &s, qreal c) { Q_ASSERT(!qFuzzyIsNull(c)); return QSize(qRound(s.wd/c), qRound(s.ht/c)); } inline QSize QSize::expandedTo(const QSize & otherSize) const { return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht)); } inline QSize QSize::boundedTo(const QSize & otherSize) const { return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht)); } #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const QSize &); #endif class Q_CORE_EXPORT QSizeF { public: QSizeF(); QSizeF(const QSize &sz); QSizeF(qreal w, qreal h); bool isNull() const; bool isEmpty() const; bool isValid() const; qreal width() const; qreal height() const; void setWidth(qreal w); void setHeight(qreal h); void transpose(); void scale(qreal w, qreal h, Qt::AspectRatioMode mode); void scale(const QSizeF &s, Qt::AspectRatioMode mode); QSizeF expandedTo(const QSizeF &) const; QSizeF boundedTo(const QSizeF &) const; qreal &rwidth(); qreal &rheight(); QSizeF &operator+=(const QSizeF &); QSizeF &operator-=(const QSizeF &); QSizeF &operator*=(qreal c); QSizeF &operator/=(qreal c); friend inline bool operator==(const QSizeF &, const QSizeF &); friend inline bool operator!=(const QSizeF &, const QSizeF &); friend inline const QSizeF operator+(const QSizeF &, const QSizeF &); friend inline const QSizeF operator-(const QSizeF &, const QSizeF &); friend inline const QSizeF operator*(const QSizeF &, qreal); friend inline const QSizeF operator*(qreal, const QSizeF &); friend inline const QSizeF operator/(const QSizeF &, qreal); inline QSize toSize() const; private: qreal wd; qreal ht; }; Q_DECLARE_TYPEINFO(QSizeF, Q_MOVABLE_TYPE); /***************************************************************************** QSizeF stream functions *****************************************************************************/ #ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSizeF &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &); #endif /***************************************************************************** QSizeF inline functions *****************************************************************************/ inline QSizeF::QSizeF() { wd = ht = -1.; } inline QSizeF::QSizeF(const QSize &sz) : wd(sz.width()), ht(sz.height()) { } inline QSizeF::QSizeF(qreal w, qreal h) { wd = w; ht = h; } inline bool QSizeF::isNull() const { return qIsNull(wd) && qIsNull(ht); } inline bool QSizeF::isEmpty() const { return wd <= 0. || ht <= 0.; } inline bool QSizeF::isValid() const { return wd >= 0. && ht >= 0.; } inline qreal QSizeF::width() const { return wd; } inline qreal QSizeF::height() const { return ht; } inline void QSizeF::setWidth(qreal w) { wd = w; } inline void QSizeF::setHeight(qreal h) { ht = h; } inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) { scale(QSizeF(w, h), mode); } inline qreal &QSizeF::rwidth() { return wd; } inline qreal &QSizeF::rheight() { return ht; } inline QSizeF &QSizeF::operator+=(const QSizeF &s) { wd += s.wd; ht += s.ht; return *this; } inline QSizeF &QSizeF::operator-=(const QSizeF &s) { wd -= s.wd; ht -= s.ht; return *this; } inline QSizeF &QSizeF::operator*=(qreal c) { wd *= c; ht *= c; return *this; } inline bool operator==(const QSizeF &s1, const QSizeF &s2) { return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); } inline bool operator!=(const QSizeF &s1, const QSizeF &s2) { return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); } inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2) { return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); } inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2) { return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); } inline const QSizeF operator*(const QSizeF &s, qreal c) { return QSizeF(s.wd*c, s.ht*c); } inline const QSizeF operator*(qreal c, const QSizeF &s) { return QSizeF(s.wd*c, s.ht*c); } inline QSizeF &QSizeF::operator/=(qreal c) { Q_ASSERT(!qFuzzyIsNull(c)); wd = wd/c; ht = ht/c; return *this; } inline const QSizeF operator/(const QSizeF &s, qreal c) { Q_ASSERT(!qFuzzyIsNull(c)); return QSizeF(s.wd/c, s.ht/c); } inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const { return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht)); } inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const { return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht)); } inline QSize QSizeF::toSize() const { return QSize(qRound(wd), qRound(ht)); } #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const QSizeF &); #endif QT_END_NAMESPACE QT_END_HEADER #endif // QSIZE_H
xkfz007/vlc
build/win32/include/qt4/src/corelib/tools/qsize.h
C
lgpl-2.1
10,492
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Mon Mar 29 12:16:39 EST 1999 --> <TITLE> : Class Fadd </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../COM/sootNsmoke/instructions/F2l.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../COM/sootNsmoke/instructions/Faload.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Fadd.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_COM.sootNsmoke.instructions.NoArgsSequence">METHOD</A></FONT></TD> <TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> COM.sootNsmoke.instructions</FONT> <BR> Class Fadd</H2> <PRE> java.lang.Object | +--<A HREF="../../../COM/sootNsmoke/instructions/Sequence.html">COM.sootNsmoke.instructions.Sequence</A> | +--<A HREF="../../../COM/sootNsmoke/instructions/NoArgsSequence.html">COM.sootNsmoke.instructions.NoArgsSequence</A> | +--<B>COM.sootNsmoke.instructions.Fadd</B> </PRE> <HR> <DL> <DT>public class <B>Fadd</B><DT>extends <A HREF="../../../COM/sootNsmoke/instructions/NoArgsSequence.html">NoArgsSequence</A></DL> <P> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" ID="TableRowColor"> <TD><CODE><B><A HREF="../../../COM/sootNsmoke/instructions/Fadd.html#Fadd()">Fadd</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="methods_inherited_from_class_COM.sootNsmoke.instructions.NoArgsSequence"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"> <TD><B>Methods inherited from class COM.sootNsmoke.instructions.<A HREF="../../../COM/sootNsmoke/instructions/NoArgsSequence.html">NoArgsSequence</A></B></TD> </TR> <TR BGCOLOR="white" ID="TableRowColor"> <TD><CODE><A HREF="../../../COM/sootNsmoke/instructions/NoArgsSequence.html#toBytecodes(COM.sootNsmoke.jvm.Bytecodes)">toBytecodes</A>, <A HREF="../../../COM/sootNsmoke/instructions/NoArgsSequence.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_COM.sootNsmoke.instructions.Sequence"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"> <TD><B>Methods inherited from class COM.sootNsmoke.instructions.<A HREF="../../../COM/sootNsmoke/instructions/Sequence.html">Sequence</A></B></TD> </TR> <TR BGCOLOR="white" ID="TableRowColor"> <TD><CODE><A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#addMethod(COM.sootNsmoke.jvm.JavaClass, java.lang.String, java.lang.String, int)">addMethod</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#append(COM.sootNsmoke.instructions.Sequence)">append</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#appendSequence(COM.sootNsmoke.instructions.Sequence)">appendSequence</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#highbyte(int)">highbyte</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#lowbyte(int)">lowbyte</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#max_stack()">max_stack</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#max_vars()">max_vars</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#net_stack()">net_stack</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#parallelSequence(COM.sootNsmoke.instructions.Sequence)">parallelSequence</A>, <A HREF="../../../COM/sootNsmoke/instructions/Sequence.html#toByteArray(COM.sootNsmoke.jvm.JavaClass)">toByteArray</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Object</B></TD> </TR> <TR BGCOLOR="white" ID="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="Fadd()"><!-- --></A><H3> Fadd</H3> <PRE> public <B>Fadd</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../COM/sootNsmoke/instructions/F2l.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../COM/sootNsmoke/instructions/Faload.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Fadd.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_COM.sootNsmoke.instructions.NoArgsSequence">METHOD</A></FONT></TD> <TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> </BODY> </HTML>
tmjee/oolong
doc/COM/sootNsmoke/instructions/Fadd.html
HTML
lgpl-2.1
9,599
############# MACROS ############## RC := root-config ifeq ($(shell which $(RC) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC)) include $(shell $(RC) --etcdir)/Makefile.arch else ROOTSYS = ../.. include $(ROOTSYS)/etc/Makefile.arch endif DICT := NdbDict.$(SrcSuf) DICTH := $(DICT:.$(SrcSuf)=.h) DICTO := $(DICT:.$(SrcSuf)=.$(ObjSuf)) DBSRCS := $(wildcard Ndb*.$(SrcSuf)) XSSRCS := $(wildcard XS*.$(SrcSuf)) SRCS := $(XSSRCS) $(DBSRCS) HDRS := $(SRCS:.$(SrcSuf)=.h) NdbLinkDef.h HDRS := $(filter-out $(DICTH),$(HDRS)) TARGETLIB = libNdb.$(DllSuf) TARGETPRG = XSGui$(ExeSuf) DBOBJS = $(DBSRCS:.$(SrcSuf)=.$(ObjSuf)) XSOBJS = $(XSSRCS:.$(SrcSuf)=.$(ObjSuf)) ############# RULES ############### .$(SrcSuf).$(ObjSuf): $(CXX) $(CXXFLAGS) -c $< ############# TARGETS ############# .SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) .$(DllSuf) all: $(TARGETPRG) $(TARGETLIB) $(DICT): $(HDRS) @echo "Generating dictionary $@..." $(ROOTCINT) -f $@ -c $^ $(TARGETPRG): $(XSOBJS) $(DBOBJS) $(DICTO) $(LD) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt)$@ @echo "$@ done" $(TARGETLIB): $(DBOBJS) $(DICTO) ifeq ($(PLATFORM),macosx) $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS) else $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt)$@ endif distclean: clean @rm -f $(TARGETPRG) $(TARGETLIB) $(DICT) $(DICTH) clean: @rm -f $(DBOBJS) $(XSOBJS) $(DICTO)
dawehner/root
test/periodic/Makefile
Makefile
lgpl-2.1
1,357
/* * Copyright (C) 2000-2008 The Exult Team * * Original file by Dancer A.L Vesperman * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IFF_H_ #define __IFF_H_ #include <vector> #include <string> #include <cstring> #include "common_types.h" #include "U7file.h" #include "exceptions.h" class DataSource; /** * The IFF class is an data reader which reads data in the IFF * file format. The actual data need not be in a file, however. */ class IFF : public U7file { public: struct IFFhdr { char form_magic[4]; uint32 size; char data_type[4]; IFFhdr() { } }; struct IFFobject { char type[4]; uint32 size; char even; }; struct u7IFFobj { char name[8]; // char data[]; // Variable }; struct Reference { size_t offset; uint32 size; Reference() : offset(0),size(0) {}; }; protected: // The IFF's header. ++++ Unused???? //IFFhdr header; /// List of objects in the IFF file. std::vector<Reference> object_list; virtual void index_file(); public: /// Basic constructor. /// @param spec File name and object index pair. IFF(const File_spec &spec) : U7file(spec) { } virtual size_t number_of_objects(void) { return object_list.size(); }; virtual char *retrieve(uint32 objnum,std::size_t &len); virtual const char *get_archive_type() { return "IFF"; }; static bool is_iff(DataSource *in); static bool is_iff(const char *fname); private: /// No default constructor IFF(); UNREPLICATABLE_CLASS_I(IFF, U7file("")); }; typedef U7DataFile<IFF> IFFFile; typedef U7DataBuffer<IFF> IFFBuffer; #endif
twinaphex/sdcell
appport/exult/files/IFF.h
C
lgpl-2.1
2,270
<?php namespace LiftKit\DependencyInjection\Rule; use LiftKit\DependencyInjection\Container\Container; use LiftKit\DependencyInjection\ClassIndex\ClassIndex; use LiftKit\DependencyInjection\Exception\Dependency; use ReflectionClass; class ClassBindingRule extends Rule { protected $container; protected $classIndex; protected $className; public function __construct (Container $container, ClassIndex $classIndex, $className) { $this->container = $container; $this->classIndex = $classIndex; $this->className = $className; } public function resolve (array $params = array()) { $className = $this->classIndex->resolveClassToAlias($this->className); $reflectionClass = new ReflectionClass($className); $constructor = $reflectionClass->getConstructor(); $resolvedParams = array(); if ($constructor) { $constructorParameters = $constructor->getParameters(); if (count($params)) { array_splice($constructorParameters, -count($params)); } foreach ($constructorParameters as $index => $constructorParam) { $class = $constructorParam->getClass(); if (! $class) { if ($constructorParam->isOptional()) { break; } throw new Dependency('Only valid type-hinted classnames can be auto-resolved.'); } $className = $class->getName(); $identifier = $this->classIndex->resolveClassToRule($className); if (! $identifier) { $identifier = uniqid(); $this->container->bindRuleToClass($identifier, $className); } $resolvedParams[] = $this->container->getObject($identifier); } } $finalParams = array_merge($resolvedParams, $params); return $reflectionClass->newInstanceArgs($finalParams); } }
liftkit/dependency-injection
src/Rule/ClassBindingRule.php
PHP
lgpl-2.1
1,762
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_03) on Wed Jan 09 13:25:40 CET 2008 --> <TITLE> Uses of Package org.springframework.instrument (Spring Framework API 2.5) </TITLE> <META NAME="date" CONTENT="2008-01-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.springframework.instrument (Spring Framework API 2.5)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a href="http://www.springframework.org/" target="_top">The Spring Framework</a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/springframework/instrument/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.springframework.instrument</B></H2> </CENTER> No usage of org.springframework.instrument <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a href="http://www.springframework.org/" target="_top">The Spring Framework</a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/springframework/instrument/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2002-2007 <a href=http://www.springframework.org/ target=_top>The Spring Framework</a>.</i> </BODY> </HTML>
cacheonix/cacheonix-core
3rdparty/spring-framework-2.5.1/docs/api/org/springframework/instrument/package-use.html
HTML
lgpl-2.1
5,841
/* * chewingio.h * * Copyright (c) 1999, 2000, 2001 * Lu-chuan Kung and Kang-pen Chen. * All rights reserved. * * Copyright (c) 2004, 2005, 2008 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /* *INDENT-OFF* */ #ifndef _CHEWING_IO_H #define _CHEWING_IO_H /* *INDENT-ON* */ /*! \file chewingio.h * \brief Chewing I/O module * \author libchewing Core Team */ #include "global.h" #define KEYSTROKE_IGNORE 1 #define KEYSTROKE_COMMIT 2 #define KEYSTROKE_BELL 4 #define KEYSTROKE_ABSORB 8 /*! \name Series of functions handling key stroke. */ /*@{*/ /** * @brief Handle the input key stroke: Space * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Space(ChewingContext *ctx); /** * @brief Handle the input key stroke: Escape * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Esc(ChewingContext *ctx); /** * @brief Handle the input key stroke: Enter/Return * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Enter(ChewingContext *ctx); /** * @brief Handle the input key stroke: Delete * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Del(ChewingContext *ctx); /** * @brief Handle the input key stroke: Backspace * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Backspace(ChewingContext *ctx); /** * @brief Handle the input key stroke: Tab * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Tab(ChewingContext *ctx); /** * @brief Handle the input key stroke: Shift + Left * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_ShiftLeft(ChewingContext *ctx); /** * @brief Handle the input key stroke: Left * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Left(ChewingContext *ctx); /** * @brief Handle the input key stroke: Shift + Right * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_ShiftRight(ChewingContext *ctx); /** * @brief Handle the input key stroke: Right * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Right(ChewingContext *ctx); /** * @brief Handle the input key stroke: Up * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Up(ChewingContext *ctx); /** * @brief Handle the input key stroke: Home * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Home(ChewingContext *ctx); /** * @brief Handle the input key stroke: End * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_End(ChewingContext *ctx); /** * @brief Handle the input key stroke: PageUp * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_PageUp(ChewingContext *ctx); /** * @brief Handle the input key stroke: PageDown * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_PageDown(ChewingContext *ctx); /** * @brief Handle the input key stroke: Down * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Down(ChewingContext *ctx); /** * @brief Handle the input key stroke: Capslock * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_Capslock(ChewingContext *ctx); /** * @brief Handle the input key stroke: casual key * @param ctx Chewing IM context * @param key scan code of key stroke */ CHEWING_API int chewing_handle_Default(ChewingContext *ctx, int key); /** * @brief Handle the input key stroke: Ctrl + Number-key * @param ctx Chewing IM context * @param key scan code of number key */ CHEWING_API int chewing_handle_CtrlNum(ChewingContext *ctx, int key); /** * @brief Handle the input key stroke: Shift + Space * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_ShiftSpace(ChewingContext *ctx); /** * @brief Handle the input key stroke: double Tab * @param ctx Chewing IM context */ CHEWING_API int chewing_handle_DblTab(ChewingContext *ctx); /** * @brief Handle the input key stroke: Numlock (keypad) * @param ctx Chewing IM context * @param key scan code of number key */ CHEWING_API int chewing_handle_Numlock(ChewingContext *ctx, int key); /*@}*/ /*! \name Chewing IM Instance Management */ /*@{*/ /** * @brief Create new handle of the instance for Chewing IM * @see chewing_delete() */ CHEWING_API ChewingContext *chewing_new(); /** * @brief Release the handle and internal memory by given Chewing instance * @see chewing_new() * * @param ctx Chewing IM context */ CHEWING_API void chewing_delete(ChewingContext *ctx); /** * @brief Release memory allocated used by given pointer used in APIs */ CHEWING_API void chewing_free(void *); /*@}*/ /*! \name Chewing IM Setup */ /** * @brief Reset all settings * * @param ctx * @return If successed than return 0 */ CHEWING_API int chewing_Reset(ChewingContext *ctx); /*@}*/ /*! \name Keyboard mapping */ /*@{*/ /** * @brief Set keyboard mapping type * * @param ctx * @param kbtype index number of keyboard mapping type from KBStr2Num * @return If successed then return 0 */ CHEWING_API int chewing_set_KBType(ChewingContext *ctx, int kbtype); /** * @brief Get keyboard mapping type * * @param ctx * @return If successed then return keyboard mapping type from KBStr2Num */ CHEWING_API int chewing_get_KBType(const ChewingContext *ctx); /** * @brief Get keyboard mapping type in C-style string format * * @param ctx * @return If successed then return kbtype from KBStr2Num */ CHEWING_API char *chewing_get_KBString(const ChewingContext *ctx); /** * @brief Get the index number of keyboard mapping type from given string * * @param str[] name of kbtype eg. "KB_HSU" */ CHEWING_API int chewing_KBStr2Num(const char str[]); /*@}*/ /*! \name Operating language mode of Chewing IM */ /*@{*/ /** * @brief Set the operating language mode of Chewing IM. * * @param ctx * @param mode CHINESE_MODE or ENGLISH_MODE */ CHEWING_API void chewing_set_ChiEngMode(ChewingContext *ctx, int mode); /** * @brief Get current operating language mode: English / Chinese * * @param ctx * * @return CHINESE_MODE or ENGLISH_MODE */ CHEWING_API int chewing_get_ChiEngMode(const ChewingContext *ctx); /*@*/ /*! \name Shape mode of output symbols */ /*@{*/ /** * @brief Set the shape mode of output symbols: full-shape / half-shape * * @param ctx * @param mode FULLSHAPE_MODE or HALFSHAPE_MODE */ CHEWING_API void chewing_set_ShapeMode(ChewingContext *ctx, int mode); /** * @brief Get current shape mode of output symbols * * @param ctx * * @return FULLSHAPE_MODE or HALFSHAPE_MODE */ CHEWING_API int chewing_get_ShapeMode(const ChewingContext *ctx); /*@}*/ /*! \name Number of selection candidate per page */ /*@{*/ /** * @brief Set the number of selection candidate per page * * @param ctx * @param n number of selection candidate */ CHEWING_API void chewing_set_candPerPage(ChewingContext *ctx, int n); /** * @brief Get the number of selection candidate per page * * @param ctx */ CHEWING_API int chewing_get_candPerPage(const ChewingContext *ctx); /*@}*/ /*! \name Maximum length of Chinese symbols */ /*@{*/ /** * @brief Set the maximum length of Chinese symbols * * @param ctx * @param n maximum length */ CHEWING_API void chewing_set_maxChiSymbolLen(ChewingContext *ctx, int n); /** * @brief Get the maximum length of Chinese symbols * * @param ctx */ CHEWING_API int chewing_get_maxChiSymbolLen(const ChewingContext *ctx); /*@}*/ /*! \name Key sequence for selecting phrases */ /*@{*/ /** * @brief Set the key sequence for selecting phrases * * @param ctx * @param selkeys * @param len */ CHEWING_API void chewing_set_selKey(ChewingContext *ctx, const int *selkeys, int len); /** * @brief Get the key sequence for selecting phrases * * @param ctx */ CHEWING_API int *chewing_get_selKey(const ChewingContext *ctx); /*@}*/ /*! \name Direction of adding new user-defined phrases */ /*@{*/ /** * @brief Set the direction of adding new user-defined phrases * * @param ctx * @param direction */ CHEWING_API void chewing_set_addPhraseDirection(ChewingContext *ctx, int direction); /** * @brief Get the direction of adding new user-defined phrases * * @param ctx */ CHEWING_API int chewing_get_addPhraseDirection(const ChewingContext *ctx); /*@}*/ /*! \name Behavior whether if space key is regarded as selection key */ /*@{*/ /** * @brief Set the behavior whether if space key is regarded as selection key * * @param ctx * @param mode */ CHEWING_API void chewing_set_spaceAsSelection(ChewingContext *ctx, int mode); /** * @brief Get the behavior if space key is regarded as selection key or not * * @param ctx */ CHEWING_API int chewing_get_spaceAsSelection(const ChewingContext *ctx); /*@}*/ /*! \name Behavior whether if Escape should clean all buffer */ /*@{*/ /** * @brief Set the behavior whether if Escape key should clean all buffer * * @param ctx * @param mode */ CHEWING_API void chewing_set_escCleanAllBuf(ChewingContext *ctx, int mode); /** * @brief Get the behavior whether if Escape key should clean all buffer * * @param ctx */ CHEWING_API int chewing_get_escCleanAllBuf(const ChewingContext *ctx); /*@}*/ /*! \name Behavior of automatically shifting cursor after selection */ /*@{*/ /** * @brief Set the behavior of automatically shifting cursor after selection * * @param ctx * @param mode */ CHEWING_API void chewing_set_autoShiftCur(ChewingContext *ctx, int mode); /** * @brief Get the behavior of automatically shifting cursor after selection * * @param ctx */ CHEWING_API int chewing_get_autoShiftCur(const ChewingContext *ctx); /*@}*/ /*! \name Operating mode during easy symbol input */ /*@{*/ /** * @brief Set the operating mode during easy symbol input * * @param ctx * @param mode */ CHEWING_API void chewing_set_easySymbolInput(ChewingContext *ctx, int mode); /** * @brief Get the operating mode during easy symbol input * * @param ctx */ CHEWING_API int chewing_get_easySymbolInput(const ChewingContext *ctx); /*@}*/ /*! \name Behavior for phrase choice to be rearward or not */ /*@{*/ /** * @brief Set the behavior for phrase choice to be rearward or not * * @param ctx * @param mode */ CHEWING_API void chewing_set_phraseChoiceRearward(ChewingContext *ctx, int mode); /** * @brief Get the behavior for phrase choice to be rearward or not * * @param ctx */ CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx); /*@}*/ /*! \name Phonetic sequence in Chewing internal state machine */ /*@{*/ /** * @brief Get phonetic sequence in Chewing internal state machine * * @param ctx */ CHEWING_API unsigned short *chewing_get_phoneSeq(const ChewingContext *ctx); /** * @brief Get the length of phonetic sequence in Chewing internal state machine * * @param ctx */ CHEWING_API int chewing_get_phoneSeqLen(const ChewingContext *ctx); /*@}*/ CHEWING_API void chewing_set_logger(ChewingContext *ctx, void (*logger) (void *data, int level, const char *fmt, ...), void *data); CHEWING_API int chewing_userphrase_enumerate(ChewingContext *ctx); CHEWING_API int chewing_userphrase_has_next(ChewingContext *ctx, unsigned int *phrase_len, unsigned int *bopomofo_len); CHEWING_API int chewing_userphrase_get(ChewingContext *ctx, char *phrase_buf, unsigned int phrase_len, char *bopomofo_buf, unsigned int bopomofo_len); CHEWING_API int chewing_userphrase_add(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf); CHEWING_API int chewing_userphrase_remove(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf); CHEWING_API int chewing_userphrase_lookup(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf); CHEWING_API int chewing_cand_list_first(ChewingContext *ctx); CHEWING_API int chewing_cand_list_last(ChewingContext *ctx); CHEWING_API int chewing_cand_list_has_next(ChewingContext *ctx); CHEWING_API int chewing_cand_list_has_prev(ChewingContext *ctx); CHEWING_API int chewing_cand_list_next(ChewingContext *ctx); CHEWING_API int chewing_cand_list_prev(ChewingContext *ctx); CHEWING_API int chewing_commit_preedit_buf(ChewingContext *ctx); CHEWING_API int chewing_clean_preedit_buf(ChewingContext *ctx); CHEWING_API int chewing_clean_bopomofo_buf(ChewingContext *ctx); CHEWING_API ChewingContext *chewing_new2(const char *syspath, const char *userpath, void (*logger) (void *data, int level, const char *fmt, ...), void *loggerdata); /* *INDENT-OFF* */ #endif /* _CHEWING_IO_H */ /* *INDENT-ON* */
czchen/libchewing
include/chewingio.h
C
lgpl-2.1
12,789
% -*- Mode: Prolog -*- % ============================================================ % big_french_drt.pl % ============================================================ % !grail 3.1.1 :- encoding(utf8). :- ensure_loaded(french_roles). :- ensure_loaded(translate_form). % This grammar is made for use with the supertagger and the grammar % extracted from the Paris VII Treebank. % It contains a mix of macro definitions, structural rules and the % start of a semantic component, which will be made more and more % complete over time. % = output options % = tense and aspect % % A choice between "yes" and "no" tense_aspect(verkuyl). %tense_aspect(drs). % DEFAULT %TENSE_Y tense_aspect(yes). %TENSE_N tense_aspect(no). % is the document in a more literary style? Then the passe % compose will have E < R o S as temporal relation between % event time E, reference time R and current time S. % In spoken language (and more informal styles) the passe % compose often has E o R < S as an alternative (which % would be the passe simple in a more literary text). document_style(literary). % = Lefff features to add to the semantics % % - "none" adds no Lefff features at all % - "basic" adds only "human" and "place" features % - "all" adds number and gender features as well % % Note that only features which can unambiguously decided will % be added. If a form is ambiguis between masculin and feminin, % no information will be added (instead of a disjunction) lefff_info(basic). % DEFAULT %LEFFF_N lefff_info(none). %LEFFF_B lefff_info(basic). %LEFFF_A lefff_info(all). % these variables have little effect for the moment, since a lot % of the neo-Davidsonian DRT semantics is hard-coded. event_semantics(classic). discourse_semantics(drt). %auto_expand(monde). invisible_mode(0). atomic_type(n, e->t). atomic_type(np, (e->t)->t). atomic_type(pp, (e->t)->t). atomic_type(cl_r, (e->t)->t). atomic_type(cl_r12, (e->t)->t). atomic_type(cl_a3, (e->t)->t). atomic_type(cl_d3, (e->t)->t). atomic_type(cl_y, (e->t)->t). atomic_type(cl_en, (e->t)->t). atomic_type(cl, (e->t)->t). atomic_type(cl(_), (e->t)->t). atomic_type(s, s->t). atomic_type(s(_), s->t). atomic_type(cs, s->t). atomic_type(txt, t). % np(Case,Expl,Num-Per) % Case = nom, acc % Expl = ce, il % Num-Per %custom_first_order(dl(1,lit(s(Z)),lit(s(Z))) dl(1, lit(s, [V,W,Z]), lit(s, [V,W,Z])), _, [X,X]). custom_first_order(lit(np), lit(np, [X,Y,_,_,_]), _, [X,Y]). custom_first_order(lit(np(U,V,W)), lit(np, [X,Y,U,V,W]), _, [X,Y]). custom_first_order(lit(pp), lit(pp, [X,Y,_]), _, [X,Y]). custom_first_order(lit(pp(Z)), lit(pp, [X,Y,Z]), _, [X,Y]). custom_first_order(lit(s), lit(s, [X,Y,_]), _, [X,Y]). custom_first_order(lit(s(Z)), lit(s, [X,Y,Z]), _, [X,Y]). % = extraction % = mode 1 : mixed associativity and mixed commutativity custom_first_order(dr(0,B0,dia(1,box(1,A0))), dr(0,B,dia(1,box(1,A))), P, [X,Y]) :- !, flip(P,Q), gensym_pos(Q, Z), add_first_order(A0, A, Q, [Z,Z]), add_first_order(B0, B, P, [X,Y]). % = mode 0 : mixed associativity only custom_first_order(dia(0,box(0,A0)), dia(0,box(0,A)), P, [X,Y]) :- !, add_first_order(A0, A, P, [X,Y]). % coordination macro(dr(0,dr(0,s,np),dr(0,s,np)), dr(0,dr(0,lit(s(X)),lit(np(U,V,W))),dr(0,lit(s(X)),lit(np(U,V,W))))). macro(dl(0,dr(0,s,np),dr(0,s,np)), dl(0,dr(0,lit(s(X)),lit(np(U,V,W))),dr(0,lit(s(X)),lit(np(U,V,W))))). macro(dr(0,dl(0,np,s),dl(0,np,s)), dr(0,dl(0,lit(np(U,V,W)),lit(s(X))),dl(0,lit(np(U,V,W)),lit(s(X))))). macro(dl(0,dl(0,np,s),dl(0,np,s)), dl(0,dl(0,lit(np(U,V,W)),lit(s(X))),dl(0,lit(np(U,V,W)),lit(s(X))))). macro(dl(1,dl(0,np,s),dl(0,np,s)), dl(1,dl(0,lit(np(U,V,W)),lit(s(X))),dl(0,lit(np(U,V,W)),lit(s(X))))). macro(dr(0,dl(0,np,np),dr(0,s,dia(1,box(1,np)))),dr(0,dl(0,lit(np(U,V,W)),lit(np(U,V,W))),dr(0,lit(s(_)),dia(1,box(1,lit(np(acc,_,_))))))). macro(dr(0,s,dia(1,box(1,np))),dr(0,lit(s(_)),dia(1,box(1,lit(np(acc,_,_)))))). % macro(dr(0,dr(0,s,dl(0,np,s)),np), dr(0,dr(0,lit(s(S)),dl(0,lit(np(nom,B,C)),lit(s(S)))),lit(np(nom,B,C)))). macro(dl(0,np,dl(0,dr(0,s,np),s)), dl(0,lit(np(A,B,C)),dl(0,dr(0,lit(s(D)),lit(np(A,B,C))),lit(s(D))))). macro(dr(0,dl(0,dr(0,s,dia(0,box(0,dl(0,np,s)))),dr(0,s,dl(0,np,s))),dr(0,s,dia(0,box(0,dl(0,np,s))))),dr(0,dl(0,dr(0,lit(s(X)),dia(0,box(0,dl(0,np,lit(s(Y)))))),dr(0,lit(s(X)),dl(0,np,lit(s(Y))))),dr(0,lit(s(X)),dia(0,box(0,dl(0,np,lit(s(Y)))))))). macro(dr(0,dl(0,dr(0,s,s),dr(0,s,s)),dr(0,s,s)), dr(0,dl(0,dr(0,lit(s(X)),lit(s(Y))),dr(0,lit(s(X)),lit(s(Y)))),dr(0,lit(s(_)),lit(s(_))))). macro(dr(0,dl(0,dl(1,s,s),dl(1,s,s)),dl(1,s,s)), dr(0,dl(0,dl(1,lit(s(X)),lit(s(X))),dl(1,lit(s(X)),lit(s(X)))),dl(1,lit(s(Y)),lit(s(Y))))). macro(dr(0,dl(1,s,s),dl(1,s,s)), dr(0,dl(1,lit(s(X)),lit(s(X))),dl(1,lit(s(X)),lit(s(X))))). macro(dl(0,dl(1,s,s),dl(1,s,s)), dl(0,dl(1,lit(s(X)),lit(s(X))),dl(1,lit(s(X)),lit(s(X))))). macro(dr(0,dr(0,s,s),dr(0,s,s)), dr(0,dr(0,lit(s(X)),lit(s(X))),dr(0,lit(s(X)),lit(s(X))))). macro(dr(0,s,s), dr(0,lit(s(X)),lit(s(X)))). macro(dl(1,s,s), dl(1,lit(s(X)),lit(s(X)))). macro(dr(0,pp,pp),dr(0,lit(pp(P)),lit(pp(P)))). macro(pp_apres, lit(pp(apres))). macro(pp_pour, lit(pp(pour))). macro(pp_par, lit(pp(par))). macro(pp_sur, lit(pp(sur))). macro(pp_en, lit(pp(en))). macro(pp_dans, lit(pp(dans))). macro(pp_vers, lit(pp(vers))). macro(pp_entre, lit(pp(entre))). macro(pp_comme, lit(pp(comme))). macro(pp_contre, lit(pp(contre))). macro(pp_avec, lit(pp(avec))). macro(pp_sans, lit(pp(sans))). macro(pp_sous, lit(pp(sous))). macro(pp_de, lit(pp(de))). macro(pp_à, lit(pp(à))). macro(pp_a, lit(pp(à))). macro(pp, lit(pp(_))). macro(cl_r, lit(cl_r)). macro(cl_en, lit(cl_en)). macro(cl_y, lit(cl_y)). macro(np_nom, lit(np(nom,_,_))). macro(np_ce, lit(np(nom,ce,3-s))). macro(np_il, lit(np(nom,il,3-s))). macro(np_acc, lit(np(acc,_,_))). macro(np_refl, lit(np(acc,refl,3-s))). macro(np, lit(np(_,_,_))). macro(dr(0,dl(0,np,s),dr(0,dl(0,np,s),np)),dr(0,dl(0,lit(np(nom,A,B)),lit(s(X))),dr(0,dl(0,lit(np(nom,A,B)),lit(s(X))),lit(np(acc,_,_))))). macro(dr(0,dl(0,dr(0,dl(0,np,s),dia(0,box(0,np))),dr(0,dl(0,np,s),np)),dr(0,dl(0,np,s),dia(0,box(0,np)))), dr(0,dl(0,dr(0,dl(0,lit(np(nom,A,B)),lit(s(S))),dia(0,box(0,lit(np(acc,_,_))))),dr(0,dl(0,lit(np(nom,A,B)),lit(s(S))),lit(np(acc,_,_)))),dr(0,dl(0,lit(np(nom,_,_)),lit(s(_))),dia(0,box(0,lit(np(acc,_,_))))))). macro(dr(0,s_q,s),dr(0,lit(s(q)),lit(s(_)))). % main or ppres macro(dr(0,s_whq,s),dr(0,lit(s(whq)),lit(s(_)))). % main or ppres macro(dr(0,dl(0,s,s),np), dr(0,dl(0,lit(s(X)),lit(s(X))),lit(np(_,_,_)))). macro(dr(0,dl(0,s,s),s), dr(0,dl(0,lit(s(X)),lit(s(X))),lit(s(_)))). macro(dr(0,dl(0,pp,pp),pp), dr(0,dl(0,lit(pp(X)),lit(pp(X))),lit(pp(_)))). macro(dl(0,s_ppart,s_ppart), dl(1,lit(s(X)),lit(s(X)))). macro(dr(0,s_ppart,s_ppart), dr(0,lit(s(X)),lit(s(X)))). macro(dl(0,s_inf,s_inf), dl(1,lit(s(X)),lit(s(X)))). macro(dr(0,s_inf,s_inf), dr(0,lit(s(X)),lit(s(X)))). macro(s_inf, lit(s(inf(_)))). macro(s_deinf, lit(s(inf(de)))). macro(s_ainf, lit(s(inf(à)))). macro(s_ppres, lit(s(ppres))). macro(s_ppart, lit(s(ppart))). macro(s_pass, lit(s(pass))). macro(cs, lit(s(q))). macro(s_q, lit(s(q))). macro(s_whq, lit(s(whq))). macro(s_top, lit(s(_))). macro(s, lit(s(_))). macro(dia(1,box(1,np)), dia(1,box(1,lit(np(acc,_,_))))). % = continuous(0). continuous_dia(0). external(_). % = % standard extraction postulates for a unary mode 1 % commutativity, mixed commutativity and mixed associativity for mode 1 postulate(p(0,A,zip(1,B)), p(0,zip(1,B),A), 'Cp1'). postulate(p(0,A,p(0,B,zip(1,C))), p(0,p(0,A,B),zip(1,C)), 'MCp1'). postulate(p(0,p(0,A,zip(1,B)),C), p(0,p(0,A,C),zip(1,B)), 'MAp1'). % mixed associativity only for unary mode 0 postulate(p(0,A,p(0,B,zip(0,C))), p(0,p(0,A,B),zip(0,C)), 'MAa1'). postulate(p(0,p(0,A,B),zip(0,C)), p(0,A,p(0,B,zip(0,C))), 'MAa'). special_string(".", '.'). special_string(";", ';'). special_string(":", ':'). special_string(",", ','). special_string("!", '!'). special_string("?", '?'). raising_verb(sembler). raising_verb(paraître). raising_verb(apparaître). weather_verb(pleuvoir). weather_verb(pleuvasser). weather_verb(pleuvoter). weather_verb(pleuviner). weather_verb(pluviner). weather_verb(neiger). weather_verb(gèler). % ==================== % = semantic recipes = % ==================== semantics(dot, Sem) :- event_semantics(ES), discourse_semantics(Dis), dot_semantics(ES, Dis, Sem). semantics(dot_np, Sem) :- event_semantics(ES), discourse_semantics(Dis), dot_np_semantics(ES, Dis, Sem). % TODO - verify carefully which parts are presuppositions possessive_1p_semantics(lambda(P,lambda(Q,presup(merge(drs(Vars,L0),appl(P,X)),appl(Q,X)))), SujF, ObjF) :- possessive_s_features_1p(SujF, Y, Vars, [variable(X)], L0, L1), possessive_o_features(ObjF, X, L1, [appl(appl(de,X),Y)]). possessive_2p_semantics(lambda(P,lambda(Q,presup(merge(drs(Vars,L0),appl(P,X)),appl(Q,X)))), SujF, ObjF) :- possessive_s_features_2p(SujF, Y, Vars, [variable(X)], L0, L1), possessive_o_features(ObjF, X, L1, [appl(appl(de,X),Y)]). possessive_3p_semantics(lambda(P,lambda(Q,presup(merge(drs(Vars,L0),appl(P,X)),appl(Q,X)))), SujF, ObjF) :- possessive_s_features_3p(SujF, Y, Vars, [variable(X)], L0, L1), possessive_o_features(ObjF, X, L1, [appl(appl(de,X),Y)]). possessive_s_features_1p(s, X, [variable(X)|Xs], Xs, [appl(orateur,X)|R], R). possessive_s_features_1p(p, X, [variable(X),variable(Y)|Xs], Xs, [bool(Y,=,?),bool(num(Y),>,1),appl(orateur,X),bool(X,atomic_sub,Y)|R], R). % note that we do not demand that the set of listeners/addressees has more than % one element in order to avoid making a commitment between polite singular % "vous" and plurar "vous" possessive_s_features_2p(s, X, [variable(X)|Xs], Xs, [appl(auditeur,X)|R], R). possessive_s_features_2p(p, X, [variable(X),variable(Y)|Xs], Xs, [bool(Y,=,?),appl(auditeur,Y),bool(X,atomic_sub,Y)|R], R). possessive_s_features_3p(s, X, [variable(X)|Xs], Xs, [bool(X,=,'singular?')|R], R). possessive_s_features_3p(p, X, [variable(X)|Xs], Xs, [bool(X,=,?),bool(num(X),>,1)|R], R). possessive_o_features(p, X, [bool(num(X),>,1)|R], R). possessive_o_features(f, X, [appl(feminin,X)|R], R). possessive_o_features(m, _X, R, R). % masculin form can occur because following word starts with vowel (TODO: REFINE) possessive_o_features(s, _X, R, R). % do we treat the determiners "un/une/le/la" as having a singleton set as argument or not? % variables without further specification are entities % = add comment to treat X as a singleton set singleton_sets(_, []). % = remove comment to treat X as a singleton set %singleton_sets(X, [bool(num(X),=,1)]). gq_no_semantics(lambda(P,lambda(Q,drs([],[bool(merge(drs([variable(X)],[]),appl(P,X)),->,drs([],[not(appl(Q,X))]))])))). gq_a_semantics(lambda(P,lambda(Q,merge(merge(drs([variable(X)],L),appl(P,X)),appl(Q,X))))) :- singleton_sets(X, L). gq_every_semantics(lambda(P,lambda(Q,drs([],[bool(merge(drs([variable(X)],[]),appl(P,X)),->,appl(Q,X))])))). % semantics for "every" but which presupposes existence % TODO: verify if it really presupposes the existence of more than one (P Z) gq_every_semantics_bis(lambda(P,lambda(Q,presup(merge(drs([variable(Z)],[bool(num(Z),>,1)]),appl(P,Z)),drs([],[bool(merge(drs([],[]),appl(P,Z)),->,appl(Q,Z))]))))). gq_the_semantics(lambda(P,lambda(Q,presup(merge(drs([variable(X)],L),appl(P,X)),appl(Q,X))))) :- singleton_sets(X, L). % variation for "l'un des" gq_l_un_des_semantics(lambda(P,lambda(Q,presup(merge(drs([variable(X),variable(Y)],[bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,Y)),appl(Q,X))))). % variation for "l'un de" gq_l_un_de_semantics(lambda(P,lambda(Q,presup(merge(drs([variable(X),variable(Y)],[bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,Y)),appl(Q,X))))). gq_les_semantics(lambda(P,lambda(Q,presup(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). gq_this_semantics(Sem) :- gq_the_semantics(Sem). gq_these_semantics(Sem) :- gq_les_semantics(Sem). wh_rel_semantics(lambda(P,lambda(Q,lambda(X,merge(appl(Q,X),merge(drs([event(E)],[]),appl(appl(P,lambda(R,appl(R,X))),E))))))). % Adj (e->t)->(e->t)) % P (e->t) % V e intensifier_semantics(Word, lambda(Adj, lambda(P, lambda(V, merge(drs([event(L)],[appl(Word,L),drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),V))]),appl(P,V)))))). dot_semantics(none, _, lambda(X,X)). dot_semantics(classic, Dis, Sem) :- dot_semantics1(Dis, Sem). dot_semantics(neo, Dis, Sem) :- dot_semantics1(Dis, Sem). dot_semantics1(drt, lambda(P, merge(drs([event(E)],[]),appl(P, E)))). dot_np_semantics(none, _, lambda(X,X)). dot_np_semantics(classic, Dis, Sem) :- dot_np_semantics1(Dis, Sem). dot_np_semantics(neo, Dis, Sem) :- dot_np_semantics1(Dis, Sem). dot_np_semantics1(drt, lambda(P,appl(P,lambda(_V,drs([],[]))))). noun_semantics(drt, Word, lambda(V,drs([],[appl(Word,V)]))). sem_tv_subject_control(Word, POS, lambda(INF,lambda(NP,lambda(E,appl(NP,lambda(Z,drs(Es,Conds))))))) :- add_roles([agent-Z,theme-L], Word, E, Conds, [drs_label(L,appl(appl(INF,lambda(P,appl(P,Z))),F))|Tnse]), pos_time(POS, [event(F)], Es, E-Tnse). auxiliary_verb_etre(POS, _Rest0, lambda(P,lambda(X,lambda(E,merge(appl(appl(P,X),E),drs(EVs,Rest)))))) :- past_participle_semantics(POS, [], EVs, E, Rest). auxiliary_verb_avoir(POS, _Rest0, lambda(P,lambda(X,lambda(E,merge(appl(appl(P,X),E),drs(EVs,Rest)))))) :- past_participle_semantics(POS, [], EVs, E, Rest). auxiliary_verb_se(POS, _Rest0, lambda(VPPC, lambda(C, lambda(NP,lambda(E,merge(appl(appl(appl(VPPC,C),NP),E),drs(EVs,Rest))))))) :- past_participle_semantics(POS, [], EVs, E, Rest). title_semantics(Title, lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(appl(titre,Title),X)]))))))). % ===================================== % = Role lexicon = % ===================================== get_roles(Verb, List, Roles) :- get_roles1(Verb, List, Roles), !. get_roles(Verb, [A|As], Roles) :- default_roles(As, A, Verb, Roles). default_roles([], np, _, [agent]). default_roles([np], np, _, [agent,patient]). default_roles([cl_r], np, _, [agent,patient]). default_roles([np], cl_r, _, [agent,patient]). default_roles([np,np], np, _, [agent,patient,theme]). default_roles([np,inf(_)], np, _, [agent,patient,theme]). default_roles([cl_r,np], np, _, [agent,patient,theme]). default_roles([cl_r,pp(_)], np, _, [agent,patient,theme]). default_roles([pp(_)], np, _, [agent,theme]). default_roles([np,pp(_)], np, _, [agent,theme,patient]). default_roles([pp(_),np], np, _, [agent,patient,theme]). default_roles([pp(_),cl_r], np, _, [agent,patient,theme]). default_roles([cl_r,inf(_)], np, _, [agent,patient,theme]). default_roles([inf(_),cl_r], np, _, [agent,theme,patient]). % = clitic_y_word(retrouver, retrouver_à, arg) :- !. clitic_y_word(X, X, mod). combine_se(Word, SeWord) :- ( var(Word) -> SeWord = Word ; atom_chars(Word, [F|_]), ( is_vowel(F) -> atomic_list_concat(['s\'', Word], SeWord) ; atomic_list_concat([se,'_',Word], SeWord) )). % rather restricted list of vowels (and no "h", which would need to be listed lexically) is_vowel(a). is_vowel(e). is_vowel(i). is_vowel(u). is_vowel(é). combine_prep_word(Prp, Word0, Word) :- var(Prp), !, Word = Word0. combine_prep_word(_, Word0, Word) :- var(Word0), !, Word = Word0. combine_prep_word('$VAR'(_), Word, Word) :- !. combine_prep_word(base, Word, Word) :- !. combine_prep_word(a, Word, PrepWord) :- !, atomic_list_concat([Word,'_',à], PrepWord). combine_prep_word(Prep, Word, PrepWord) :- atomic_list_concat([Word,'_',Prep], PrepWord). % ===================================== % = Tense information = % ===================================== % pos_time(+VerbForm, -EventList) % compatibility only, subsumed by pos_time/4, which allows % the introduction of additional (event) variables in the % main DRS. pos_time(VForm, EList) :- pos_time(VForm, _, _, EList), format(user_error, 'POS_TIME ~w ~w~n', [VForm,EList]). pos_time(VForm, EVs0, EVs, EList) :- tense_aspect(TA), !, pos_time(TA, VForm, EVs0, EVs, EList). pos_time(no, _, EVs, EVs, _-[]) :- !. pos_time(none, _, EVs, EVs, _-[]) :- !. pos_time(drs, ver:TENSE, EVs0, EVs, EList) :- !, pos_time_drs(TENSE, EVs0, EVs, EList). pos_time(verkuyl, ver:TENSE, EVs0, EVs, EList) :- !, pos_time_verkuyl(TENSE, EVs0, EVs, EList). pos_time(yes, ver:TENSE, EVs0, EVs, EList) :- !, pos_time_verkuyl(TENSE, EVs0, EVs, EList). pos_time(_, _, EVs, EVs, _-[]). % the tense operators "present" and "past" are of type (v->t)->(v->t) semantics_tense_pres(lambda(Phi,lambda(I,merge(appl(Phi,I),drs([],[bool(temps(I),overlaps,maintenant)]))))). semantics_tense_past(lambda(Phi,lambda(I,merge(appl(Phi,I),drs([],[bool(temps(I),<,maintenant)]))))). % the "aspectual" operators are of type (v->t)->(v->t) semantics_aspect_post(lambda(Phi, lambda(I, drs([J],[appl(Phi,J),bool(I,<,J)])))). %semantics_aspect_post(lambda(Phi, lambda(I, drs([J],[appl(Phi,J),bool(sub(I,a),<,J)])))). semantics_aspect_post_imm(lambda(Phi, lambda(I, drs([J],[appl(Phi,J),bool(I,abuts,J)])))). semantics_aspect_perf(lambda(Phi, lambda(I, drs([K],[appl(Phi,K),bool(K,<,I)])))). semantics_aspect_impf(lambda(Phi, lambda(I, drs([K],[appl(Phi,K),bool(I,subseteq,K)])))). semantics_aspect_anch(lambda(Phi, lambda(J, drs([K],[appl(Phi,K),bool(K,=,'event?'),bool(K,<,J)])))). pos_time_drs(pres, E-[bool(E,overlaps,maintenant),bool(E,overlaps,ref_time)]) :- !. pos_time_drs(impf, EVs, [event(S1)|EVs], E-[bool(S1,=,'time?'),bool(ref_time,overlaps,S1),bool(ref_time,overlaps,appl(temps,E))]) :- !. pos_time_drs(simp, EVs, EVs, E-[bool(appl(temps,E),<,maintenant),bool(ref_time,<,maintenant),bool(ref_time,overlaps,appl(temps,E))]) :- !. pos_time_drs(cond, EVs, [event(S1)|EVs], E-[bool(S1,=,'time?'),bool(S1,<,E),bool(ref_time,overlaps,appl(temps,E))]) :- !. pos_time_drs(futu, EVs, EVs, E-[bool(maintenant,<,appl(temps,E)),bool(ref_time,overlaps,maintenant)]) :- !. pos_time_drs(_, EVs, EVs, _-[]). pos_time_verkuyl(pres, EVs, EVs, E-[bool(appl(temps,E),overlaps,maintenant)]) :- !. pos_time_verkuyl(impf, EVs, EVs, E-[drs([event(X)],[bool(appl(temps,X),subseteq,appl(temps,E)),bool(appl(temps,X),<,maintenant)])]) :- !. pos_time_verkuyl(futu, EVs, EVs, E-[drs([event(X)],[bool(appl(temps,X),<,appl(temps,E)),bool(appl(temps,X),overlaps,maintenant)])]) :- !. %pos_time_verkuyl(futu, EVs, EVs, E-[drs([event(X)],[bool(sub(appl(temps,X),a),<,appl(temps,E)),bool(appl(temps,X),overlaps,maintenant)])]) :- % !. pos_time_verkuyl(cond, EVs, EVs, E-[drs([event(X)],[bool(appl(temps,X),<,appl(temps,E)),bool(appl(temps,X),<,maintenant)])]) :- !. pos_time_verkuyl(simp, EVs, EVs, E-[drs([event(X)],[bool(X,=,'event?'),bool(appl(temps,X),<,appl(temps,E)),bool(appl(temps,E),<,maintenant)])]) :- !. pos_time_verkuyl(_, EVs, EVs, _-[]). past_participle_semantics(ver:TIME, EVs0, EVs, E, Rest) :- tense_aspect(TA), past_participle_semantics(TA, TIME, EVs0, EVs, E, Rest). past_participle_semantics(drs, Time, EVs, EVs, E, Rest) :- !, past_participle_semantics_drs(Time, E, Rest). past_participle_semantics(verkuyl, Time, EVs0, EVs, E, Rest) :- !, past_participle_semantics_verkuyl(Time, EVs0, EVs, E, Rest). past_participle_semantics(yes, Time, EVs0, EVs, E, Rest) :- !, past_participle_semantics_verkuyl(Time, EVs0, EVs, E, Rest). % even when no tense information is wanted, indicate SDRS "background" relation % for the plus-que-parfait past_participle_semantics(_, Time, E, Rest) :- ( Time = impf -> Rest = [appl(background,E)] ; Rest = [] ). past_participle_semantics_drs(impf, E, [bool(appl(temps,E),<,ref_time),bool(ref_time,<,maintenant),appl(background,E)]) :- !. past_participle_semantics_drs(futu, E, [bool(maintenant,<,appl(temps,E)),bool(appl(temps,E),<,ref_time)]) :- !. past_participle_semantics_drs(cond, E, [bool(appl(temps,E),<,ref_time),bool(ref_time,<,maintenant)]) :- !. past_participle_semantics_drs(pres, E, [bool(appl(temps,E),<,ref_time),bool(ref_time,overlaps,maintenant)]) :- !. past_participle_semantics_drs(_, E, [bool(appl(temps,E),<,maintenant)]). % Verkuyl-style semantics has perfect operator in auxiliary verb past_participle_semantics_verkuyl(pres, EVs, EVs, E, [drs([event(I)],[bool(appl(temps,E),<,appl(temps,I)),bool(appl(temps,I),overlaps,maintenant)])]) :- !. past_participle_semantics_verkuyl(futu, EVs, EVs, E, [drs([event(X),event(Y)],[bool(appl(temps,E),<,appl(temps,Y)),bool(appl(temps,X),<,appl(temps,Y)),bool(appl(temps,X),overlaps,maintenant)])]) :- !. past_participle_semantics_verkuyl(impf, EVs, [event(Y)|EVs], E, [drs([event(X)],[bool(appl(temps,E),<,appl(temps,Y)),bool(appl(temps,X),subseteq,appl(temps,Y)),bool(appl(temps,X),<,maintenant)])]) :- !. past_participle_semantics_verkuyl(cond, EVs, EVs, E, [drs([event(X),event(Y),event(Z)],[bool(appl(temps,E),<,appl(temps,Z)),bool(appl(temps,Y),subseteq,appl(temps,Z)),bool(appl(temps,X),<,appl(temps,Y)),bool(appl(temps,X),overlaps,maintenant)])]) :- !. past_participle_semantics_verkuyl(simp, EVs, EVs, E, [drs([event(X),event(Y)],[bool(appl(temps,E),<,appl(temps,Y)),bool(X,=,'event?'),bool(appl(temps,Y),subseteq,appl(temps,X)),bool(appl(temps,X),<,maintenant)])]) :- !. past_participle_semantics_verkuyl(_, EVs, EVs, _, []). % ===================================== % = Cardinal Numbers = % ===================================== convert_cardinal(Sem, Num) :- convert_cardinal1(Sem, Num), !. convert_cardinal(Num0, Num) :- atom_codes(Num0, List0), convert_interpunction(List0, List), atom_codes(Num1, List), catch(atom_number(Num1, Num),syntax_error,fail). % = convert_inpterpunction % % NOTE: this implementation presupposes that number are represented % European-style, with '.' regrouping and the ',' denoting fractions. convert_interpunction([], []). convert_interpunction([C0|Cs0], Cs) :- ( C0 = 46 -> convert_interpunction(Cs0, Cs) ; C0 = 44 -> Cs = [46|Cs1], convert_interpunction(Cs0, Cs1) ; Cs = [C0|Cs1], convert_interpunction(Cs0, Cs1) ). convert_cardinal1(zéro, 0). convert_cardinal1(un, 1). convert_cardinal1(une, 1). convert_cardinal1(deux, 2). convert_cardinal1(trois, 3). convert_cardinal1(quatre, 4). convert_cardinal1(cinq, 5). convert_cardinal1(six, 6). convert_cardinal1(sept, 7). convert_cardinal1(huit, 8). convert_cardinal1(neuf, 9). convert_cardinal1(dix, 10). convert_cardinal1(onze, 11). convert_cardinal1(douze, 12). convert_cardinal1(treize, 13). convert_cardinal1(quatorze, 14). convert_cardinal1(quize, 15). convert_cardinal1(seize, 16). convert_cardinal1(dix-sept, 17). convert_cardinal1(dix-huit, 18). convert_cardinal1(dix-neuf, 19). convert_cardinal1(vingt, 20). convert_cardinal1(vingt-et-un, 21). convert_cardinal1(vingt-deux, 22). convert_cardinal1(vingt-trois, 23). convert_cardinal1(vingt-quatre, 24). convert_cardinal1(vingt-cinq, 25). convert_cardinal1(vingt-six, 26). convert_cardinal1(vingt-sept, 27). convert_cardinal1(vingt-huit, 28). convert_cardinal1(vingt-neuf, 29). convert_cardinal1(trente, 30). convert_cardinal1(trente-et-un, 31). convert_cardinal1(trente-deux, 32). convert_cardinal1(trente-trois, 33). convert_cardinal1(trente-quatre, 34). convert_cardinal1(trente-cinq, 35). convert_cardinal1(trente-six, 36). convert_cardinal1(trente-sept, 37). convert_cardinal1(trente-huit, 38). convert_cardinal1(trente-neuf, 39). convert_cardinal1(quarante, 40). convert_cardinal1(quarante-et-un, 41). convert_cardinal1(quarante-deux, 42). convert_cardinal1(quarante-trois, 43). convert_cardinal1(quarante-quatre, 44). convert_cardinal1(quarante-cinq, 45). convert_cardinal1(quarante-six, 46). convert_cardinal1(quarante-sept, 47). convert_cardinal1(quarante-huit, 48). convert_cardinal1(quarante-neuf, 49). convert_cardinal1(cinquante, 50). convert_cardinal1(cinquante-et-un, 51). convert_cardinal1(cinquante-deux, 52). convert_cardinal1(cinquante-trois, 53). convert_cardinal1(cinquante-quatre, 54). convert_cardinal1(cinquante-cinq, 55). convert_cardinal1(cinquante-six, 56). convert_cardinal1(cinquante-sept, 57). convert_cardinal1(cinquante-huit, 58). convert_cardinal1(cinquante-neuf, 59). convert_cardinal1(soixante, 60). convert_cardinal1(soixante-et-un, 61). convert_cardinal1(soixante-deux, 62). convert_cardinal1(soixante-trois, 63). convert_cardinal1(soixante-quatre, 64). convert_cardinal1(soixante-cinq, 65). convert_cardinal1(soixante-six, 66). convert_cardinal1(soixante-sept, 67). convert_cardinal1(soixante-huit, 68). convert_cardinal1(soixante-neuf, 69). convert_cardinal1(soixante-dix, 70). convert_cardinal1(soixante-et-onze, 71). convert_cardinal1(soixante-douze, 72). convert_cardinal1(soixante-treize, 73). convert_cardinal1(soixante-quatorze, 74). convert_cardinal1(soixante-quinze, 75). convert_cardinal1(soixante-seize, 76). convert_cardinal1(soixante-dix-sept, 77). convert_cardinal1(soixante-dix-huit, 78). convert_cardinal1(soixante-dix-neuf, 79). convert_cardinal1(quatre-vingts, 80). convert_cardinal1(quatre-vingts-et-un, 81). convert_cardinal1(quatre-vingts-deux, 82). convert_cardinal1(quatre-vingts-trois, 83). convert_cardinal1(quatre-vingts-quatre, 84). convert_cardinal1(quatre-vingts-cinq, 85). convert_cardinal1(quatre-vingts-six, 86). convert_cardinal1(quatre-vingts-sept, 87). convert_cardinal1(quatre-vingts-huit, 88). convert_cardinal1(quatre-vingts-neuf, 89). convert_cardinal1(quatre-vingts-dix, 90). convert_cardinal1(quatre-vingts-et-onze, 91). convert_cardinal1(quatre-vingts-douze, 92). convert_cardinal1(quatre-vingts-treize, 93). convert_cardinal1(quatre-vingts-quatorze, 94). convert_cardinal1(quatre-vingts-quinze, 95). convert_cardinal1(quatre-vingts-seize, 96). convert_cardinal1(quatre-vingts-dix-sept, 97). convert_cardinal1(quatre-vingts-dix-huit, 98). convert_cardinal1(quatre-vingts-dix-neuf, 99). convert_cardinal1(cent, 100). convert_cardinal1(cents, 100). convert_cardinal1(mille, '1.000'). convert_cardinal1(million, '1.000.000'). convert_cardinal1(millions, '1.000.000'). convert_cardinal1(milliard, '1.000.000.000'). convert_cardinal1(milliards, '1.000.000.000'). convert_approx_cardinal(dizaine, 10). convert_approx_cardinal(douzaine, 12). convert_approx_cardinal(vingtaine, 20). convert_approx_cardinal(centaine, 100). convert_approx_cardinal(millier, 1000). convert_approx_cardinal_pl(dizaines, 10). convert_approx_cardinal_pl(centaines, 100). convert_approx_cardinal_pl(milliers, 1000). % ===================================== % = Ordinal Numbers = % ===================================== convert_ordinal(premier, 1). convert_ordinal(première, 1). convert_ordinal(deuxième, 2). convert_ordinal(troisième, 3). convert_ordinal(quatrième, 4). convert_ordinal(cinquième, 5). convert_ordinal(sixième, 6). convert_ordinal(septième, 7). convert_ordinal(huitième, 8). convert_ordinal(neuvième, 9). convert_ordinal(dixième, 10). % ===================================== % = Lefff Information = % ===================================== add_lefff_info(Features, Var, List) :- lefff_info(Info), add_lefff_info(Info, Features, Var, List). add_lefff_info(none, _, _, []). add_lefff_info(basic, Features, Var, List) :- add_lefff_info1(Features, Var, List). add_lefff_info(all, Features, Var, List) :- add_lefff_info2(Features, Var, List). add_lefff_info1(h, X, [appl(humain,X)]). add_lefff_info1(hm, X, [appl(humain,X)]). add_lefff_info1(hf, X, [appl(humain,X)]). add_lefff_info1(hs, X, [appl(humain,X)]). add_lefff_info1(hms, X, [appl(humain,X)]). add_lefff_info1(hfs, X, [appl(humain,X)]). add_lefff_info1(hp, X, [appl(humain,X)]). add_lefff_info1(hmp, X, [appl(humain,X)]). add_lefff_info1(hfp, X, [appl(humain,X)]). add_lefff_info1(l, X, [appl(lieu,X)]). add_lefff_info1(lm, X, [appl(lieu,X)]). add_lefff_info1(lf, X, [appl(lieu,X)]). add_lefff_info1(ls, X, [appl(lieu,X)]). add_lefff_info1(lms, X, [appl(lieu,X)]). add_lefff_info1(lfs, X, [appl(lieu,X)]). add_lefff_info1(lp, X, [appl(lieu,X)]). add_lefff_info1(lmp, X, [appl(lieu,X)]). add_lefff_info1(lfp, X, [appl(lieu,X)]). add_lefff_info1(m, _X, []). add_lefff_info1(f, _X, []). add_lefff_info1(mp, _X, []). add_lefff_info1(fp, _X, []). add_lefff_info1(ms, _X, []). add_lefff_info1(fs, _X, []). add_lefff_info2(h, X, [appl(humain,X)]). add_lefff_info2(hm, X, [appl(humain,X),appl(masculin,X)]). add_lefff_info2(hf, X, [appl(humain,X),appl(féminin,X)]). add_lefff_info2(hs, X, [appl(humain,X)]). add_lefff_info2(hms, X, [appl(humain,X),appl(masculin,X)]). add_lefff_info2(hfs, X, [appl(humain,X),appl(féminin,X)]). add_lefff_info2(hp, X, [appl(humain,X)]). add_lefff_info2(hmp, X, [appl(humain,X),appl(masculin,X)]). add_lefff_info2(hfp, X, [appl(humain,X),appl(féminin,X)]). add_lefff_info2(l, X, [appl(lieu,X)]). add_lefff_info2(lm, X, [appl(lieu,X),appl(masculin,X)]). add_lefff_info2(lf, X, [appl(lieu,X),appl(féminin,X)]). add_lefff_info2(ls, X, [appl(lieu,X)]). add_lefff_info2(lms, X, [appl(lieu,X),appl(masculin,X)]). add_lefff_info2(lfs, X, [appl(lieu,X),appl(féminin,X)]). add_lefff_info2(lp, X, [appl(lieu,X)]). add_lefff_info2(lmp, X, [appl(lieu,X),appl(masculin,X)]). add_lefff_info2(lfp, X, [appl(lieu,X),appl(féminin,X)]). add_lefff_info2(m, X, [appl(masculin,X)]). add_lefff_info2(f, X, [appl(féminin,X)]). add_lefff_info2(mp, X, [appl(masculin,X)]). add_lefff_info2(fp, X, [appl(féminin,X)]). add_lefff_info2(ms, X, [appl(masculin,X)]). add_lefff_info2(fs, X, [appl(féminin,X)]). add_info('Pyrénées', X, [appl(lieu,X),appl(mountain_range,X)|L], L) :- !. add_info('Mont-Perdu', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Maladetta', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Maladette', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Vignemale', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Pimené', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Pique', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Crabère', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Maboré', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Aiguillons', X, [appl(lieu,X),appl(mountain,X)|L], L) :- !. add_info('Corunes', X, [appl(lieu,X),appl(lac,X)|L], L) :- !. add_info(cirque, X, [appl(lieu,X)|L], L) :- !. add_info('Cirque', X, [appl(lieu,X)|L], L) :- !. add_info(col, X, [appl(lieu,X)|L], L) :- !. add_info(mont, X, [appl(lieu,X)|L], L) :- !. add_info(monts, X, [appl(lieu,X)|L], L) :- !. add_info('Mont', X, [appl(lieu,X)|L], L) :- !. add_info('Monts', X, [appl(lieu,X)|L], L) :- !. add_info(port, X, [appl(lieu,X)|L], L) :- !. add_info(ports, X, [appl(lieu,X)|L], L) :- !. add_info('Port', X, [appl(lieu,X)|L], L) :- !. add_info('Ports', X, [appl(lieu,X)|L], L) :- !. add_info(fort, X, [appl(lieu,X)|L], L) :- !. add_info(forts, X, [appl(lieu,X)|L], L) :- !. add_info('fort', X, [appl(lieu,X)|L], L) :- !. add_info('Forts', X, [appl(lieu,X)|L], L) :- !. add_info(lac, X, [appl(lieu,X)|L], L) :- !. add_info(lacs, X, [appl(lieu,X)|L], L) :- !. add_info('Lac', X, [appl(lieu,X)|L], L) :- !. add_info('Lacs', X, [appl(lieu,X)|L], L) :- !. add_info('vallée', X, [appl(lieu,X)|L], L) :- !. add_info(vallon, X, [appl(lieu,X)|L], L) :- !. add_info(val, X, [appl(lieu,X)|L], L) :- !. add_info('Vallée', X, [appl(lieu,X)|L], L) :- !. add_info('Vallon', X, [appl(lieu,X)|L], L) :- !. add_info('Val', X, [appl(lieu,X)|L], L) :- !. add_info(_, _, L, L). convert_quantifier(nul, lambda(P,lambda(Q,drs([],[bool(merge(drs([variable(X)],[]),appl(P,X)),->,drs([],[not(appl(Q,X))]))])))). convert_quantifier(nulle, lambda(P,lambda(Q,drs([],[bool(merge(drs([variable(X)],[]),appl(P,X)),->,drs([],[not(appl(Q,X))]))])))). convert_quantifier(quelque, lambda(P,lambda(Q,merge(merge(drs([variable(X)],[]),appl(P,X)),appl(Q,X))))). convert_quantifier_adj(nulle, lambda(P,lambda(X,drs([],[not(appl(P,X))])))). convert_quantifier_adj(quelque, lambda(P, lambda(X, appl(P,X)))). is_temporal_unit(seconde). is_temporal_unit(minute). is_temporal_unit(heure). is_temporal_unit(jour). is_temporal_unit(semaine). is_temporal_unit(an). % = new sequence_semantics sequence_semantics([PE, X, Y], Pendant, I0, I, dl(1,lit(s(_)),lit(s(_))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(sub(mésure,LTF),appl(temps,E)),=,Num)]))))) :- chart:word(PE, _, _, I0, I1), ( PE = pendant ; PE = en ), chart:word(X, num, LN, I1, I2), chart:word(Y, _, LT, I2, I), convert_cardinal(LN, Num), ( Y = mois -> LTF = mois ; is_temporal_unit(LT), LTF = LT ), concat_atom([PE,LT,Num], Pendant). sequence_semantics([secrétaire, général], secrétaire_général, _, _, lit(n), lambda(X,drs([],[appl('secrétaire-général',X)]))). sequence_semantics([secrétaire, général], secrétaire_général, _, _, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[appl('secrétaire-général',X)]),appl(P,X)))). sequence_semantics([président,de,la,'République'], 'président_de_la_République', _, _, lit(n), lambda(X,drs([],[appl(président_de_la_République,X)]))). sequence_semantics([président,de,la,'République'], 'président_de_la_République', _, _, lit(np(_,_,_)), lambda(P,merge(drs([event(X)],[appl(président_de_la_République,X)]),appl(P,X)))). sequence_semantics([W,bon,train], aller_bon_train, I, _, dl(0,lit(np(_,_,_)),lit(s(_))), lambda(NP,lambda(E,appl(NP,lambda(X,drs([],[appl(appl(aller_bon_train,X),E)])))))) :- chart:word(W, _, aller, I, _). sequence_semantics([ETRE,en,train,DE|_INF0], être_en_train_de, I, K, dl(0,lit(np(_,_,_)),lit(s(_))), lambda(NP,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Conds),merge(drs([event(F)],[bool(E,subseteq,F)]),appl(appl(INF,lambda(Prp,appl(Prp,X))),F)))))))) :- chart:word(ETRE, ver:TNS, être, I, _), ( DE = de ; DE = 'd\'' ), chart:word(train, _, _, _, J1), chart:word(DE, _, _, J1, J), chart:stored(_, _, J, K, dl(0,lit(np(_,_,_)),lit(s(inf(_)))), data(_, INF, _, [], [], [])), pos_time(ver:TNS, [], EVs, E-Conds). sequence_semantics(['d\'',ailleurs], d_ailleurs, _, _, dl(1,lit(s(_)),lit(s(_))), lambda(S,lambda(E,merge(drs([],[appl(d_ailleurs,E)]),appl(S,E))))). sequence_semantics(['Dans',_,_|Ws], Ws, [prp,num,nom|Ps], Ps, [_,N,Tmp|Ls], Ls, [dr(0,dr(0,lit(s(X)),lit(s(X))),lit(np(N1,N2,N3))),dr(0,lit(np(N1,N2,N3)),lit(n)),lit(n)|Fs], Fs, [dr(0,dr(0,lit(s(X)),lit(s(X))),lit(np(N1,N2,N3)))-lambda(_,lambda(S,lambda(E,merge(appl(S,E),drs([event(E2)],[bool(appl(sub(mésure,Tmp),E2),=,Num),bool(E2,abuts,E)]))))),dr(0,lit(np(N1,N2,N3)),lit(n))-_,lit(n)-_|Ss], Ss, dr(0,lit(s(X)),lit(s(X)))-lambda(S,lambda(E,merge(appl(S,E),drs([event(E2)],[bool(appl(sub(mésure,Tmp),E2),=,Num),bool(E2,abuts,E)]))))) :- is_temporal_unit(Tmp), convert_ordinal(N,Num), !, format(user_error, 'DANS ~w ~w~n', [N,Tmp]). % "il est probable que ..." %sequence_semantics([_,W|Ws], [W|Ws], [pro:per,P|Ps], Ps, [il,L|Ls], Ls, [lit(np(_,_,_)),F|Fs], [F|Fs], [lit(np(_,_,_))-_,S0|Ss0], [S|Ss]) :- % process_verb_adjective(P, Ps, W, Ws, L, Ls, F, Fs, S0, Ss0, S,Ss). sequence_semantics([Q,part|Ws], Ws, [adj,nom|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),lit(n)|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-QS,lit(n)-lambda(X,drs([],[appl(lieu,X)]))|Ss], Ss) :- convert_quantifier(Q,QS), !, write(user_error, 'SEQUENCE: nulle/quelque part'). sequence_semantics([Q,part|Ws], Ws, [adj,nom|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(n),lit(n)),lit(n)|Fs], Fs, [dr(0,lit(n),lit(n))-AS,lit(n)-lambda(X,drs([],[appl(lieu,X)]))|Ss], Ss) :- convert_quantifier_adj(Q,AS), !, write(user_error, 'SEQUENCE: nulle/quelque part'). sequence_semantics([_,et,_|Ws], Ws, [num,kon,num|Ps], Ps, [A,_,B|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),dr(0,dl(0,dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(np(_,_,_)),lit(n))),dr(0,lit(np(_,_,_)),lit(n))),dr(0,lit(np(_,_,_)),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(Z,Z),dr(0,dl(0,dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(np(_,_,_)),lit(n))),dr(0,lit(np(_,_,_)),lit(n)))-lambda(V,V),dr(0,lit(np(_,_,_)),lit(n))-lambda(R,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),=,Num)]),appl(R,X)),appl(Q,X))))|Ss], Ss) :- convert_cardinal(B, 1), convert_cardinal(A, N0), !, number(N0), Num is N0 + 1. % "fait-n que-(n\n)/s_q" has the presupposition that the que-phrase is true sequence_semantics([_,_|Ws], Ws, [nom,_|Ps], Ps, [fait,que|Ls], Ls, [lit(n),dr(0,dl(0,lit(n),lit(n)),lit(s(q)))|Fs], Fs, [lit(n)-lambda(X,drs([],[appl(fait,X)])),dr(0,dl(0,lit(n),lit(n)),lit(s(q)))-lambda(SQ,lambda(CN,lambda(Y,presup(merge(drs([event(E)],[]),appl(SQ,E)),merge(appl(CN,Y),drs([event(Lab)],[appl(appl(contenu,Lab),Y),drs_label(Lab,appl(SQ,E))]))))))|Ss], Ss). % "l'on" sequence_semantics([LAp,on|Ws], Ws, [det:art,pro:per|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(np(_,_,_)))-lambda(Z,Z),lit(np(_,_,_))-lambda(P,merge(drs([variable(X)],[]),appl(P,X)))|Ss], Ss) :- is_l_apostrophe(LAp), !. % "l'un des" sequence_semantics([LAp,Un,des|Ws], Ws, [det:art,_,prp:det|Ps], Ps, [_,_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),lit(n),dr(0,dl(0,lit(n),lit(n)),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-Sem,lit(n)-lambda(_,drs([],[])),dr(0,dl(0,lit(n),lit(n)),lit(n))-lambda(P1,lambda(_,lambda(X,appl(P1,X))))|Ss], Ss) :- is_l_apostrophe(LAp), is_un_une(Un), !, gq_l_un_des_semantics(Sem). % NUM des % (e->t)->t sequence_semantics([W,des|Ws], Ws, [num,prp:det|Ps], Ps, [_,_|Ls], Ls, [lit(np(_,_,_)),dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n))|Fs], Fs, [lit(np(_,_,_))-lambda(_,drs([],[])),dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n))-lambda(N1,lambda(_,lambda(P1,presup(merge(drs([variable(X),variable(Y)],[bool(Y,=,?),bool(X,subsetneq,Y),bool(num(X),=,Num)]),appl(N1,Y)),appl(P1,X)))))|Ss], Ss) :- convert_cardinal(W,Num), !. % dizaine/douzaine/centaine de % (e->t)->t sequence_semantics([W,de|Ws], Ws, [_,prp|Ps], Ps, [_,_|Ls], Ls, [lit(n),dr(0,dl(0,lit(n),lit(n)),lit(n))|Fs], Fs, [lit(n)-lambda(X,drs([],[bool(num(X),approx,Num)])),dr(0,dl(0,lit(n),lit(n)),lit(n))-lambda(N1,lambda(N2,lambda(Y,merge(appl(N1,Y),appl(N2,Y)))))|Ss], Ss) :- convert_approx_cardinal(W,Num), !. % sequence_semantics([W,de|Ws], Ws, [_,prp|Ps], Ps, [_,_|Ls], Ls, [lit(n),dr(0,dl(0,lit(n),lit(n)),lit(n))|Fs], Fs, [lit(n)-lambda(X,drs([],[bool(num(X),>,Num)])),dr(0,dl(0,lit(n),lit(n)),lit(n))-lambda(N1,lambda(N2,lambda(Y,merge(appl(N1,Y),appl(N2,Y)))))|Ss], Ss) :- convert_approx_cardinal_pl(W,Num0), !, Num is 2*Num0. % "l'un de" (mes/ses...) % TODO this is a bit ugly, find a way to do without explicit identity condition for X and Y sequence_semantics([LAp,Un,de|Ws], Ws, [det:art,_,prp|Ps], Ps, [_,_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),lit(n),dr(0,dl(0,lit(n),lit(n)),lit(np(_,_,_)))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-Sem,lit(n)-lambda(_,drs([],[])),dr(0,dl(0,lit(n),lit(n)),lit(np(_,_,_)))-lambda(P1,lambda(_,lambda(X,appl(P1,lambda(Y,drs([],[bool(X,=,Y)]))))))|Ss], Ss) :- is_l_apostrophe(LAp), is_un_une(Un), !, gq_l_un_de_semantics(Sem). % "l'un" sequence_semantics([LAp,Un,Next|Ws], [Next|Ws], [det:art,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),lit(n)|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(_,lambda(P1,presup(drs([variable(Y)],[bool(Y,=,?),bool(num(Y),>,1)]),merge(drs([variable(X)],[bool(X,atomic_sub,Y),appl(Gender,X)]),appl(P1,X))))),lit(n)-lambda(_,drs([],[]))|Ss], Ss) :- Next \== de, Next \== des, is_l_apostrophe(LAp), is_un_une(Un), !, ( Un = un -> Gender = masculin ; Gender = feminin ). sequence_semantics([_,_,_|Ws], Ws, [prp,nom,_|Ps], Ps, [par,rapport,_|Ls], Ls, [dr(0,A,lit(n)),dr(0,lit(n),lit(pp(à))),dr(0,lit(pp(à)),lit(n))|Fs], Fs, [dr(0,A,lit(n))-Sem,dr(0,lit(n),lit(pp(à)))-lambda(Y,lambda(X,appl(Y,X))),dr(0,lit(pp(n),lit(n)))-lambda(Z,Z)|Ss], Ss) :- default_semantics(par_rapport_à, prp, dr(0,A,lit(n)), Sem). sequence_semantics([_,_,_|Ws], Ws, [prp,nom,_|Ps], Ps, [par,rapport,_|Ls], Ls, [dr(0,A,lit(n)),dr(0,lit(n),lit(pp(à))),dr(0,lit(pp(à)),lit(np(_,_,_)))|Fs], Fs, [dr(0,A,lit(np(_,_,_)))-Sem,dr(0,lit(np(_,_,_)),lit(pp(à)))-lambda(P,lambda(X,appl(P,X))),dr(0,lit(pp(n),lit(np(_,_,_))))-lambda(Z,Z)|Ss], Ss) :- default_semantics(par_rapport_à, prp, dr(0,A,lit(np(_,_,_))), Sem). sequence_semantics([environ,W|Ws], Ws, [_,num|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(n),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(n),lit(n))-lambda(X,X),dr(0,lit(n),lit(n))-lambda(P,lambda(V, merge(drs([],[bool(appl(num,V),approx,Num)]),appl(P,V))))|Ss], Ss) :- convert_cardinal(W, Num). sequence_semantics([environ,W|Ws], Ws, [_,num|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,lit(np(_,_,_)),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(np(_,_,_)))-lambda(X,X),dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),approx,Num)]),appl(P,X)),appl(Q,X))))|Ss], Ss) :- convert_cardinal(W, Num). sequence_semantics(['Environ',W|Ws], Ws, [_,num|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(n),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(n),lit(n))-lambda(X,X),dr(0,lit(n),lit(n))-lambda(P,lambda(V, merge(drs([],[bool(appl(num,V),approx,Num)]),appl(P,V))))|Ss], Ss) :- convert_cardinal(W, Num). sequence_semantics(['Environ',W|Ws], Ws, [_,num|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,lit(np(_,_,_)),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(np(_,_,_)))-lambda(X,X),dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),approx,Num)]),appl(P,X)),appl(Q,X))))|Ss], Ss) :- convert_cardinal(W, Num). % days "le 14" %sequence_semantics([le,W|Ws], Ws, [_,P|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,dl(1,lit(s),lit(s)),lit(n))-lambda(N,lambda(S,lambda(E,merge(appl(N,E),appl(S,E)))))-lambda(P,lambda(Y,merge(drs([],[Condition]),appl(P,Y))))|Ss], Ss) :- % is_date_indication(P, W, Y, Condition). % days "le mercredi" %sequence_semantics([le,W|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)),lit(n)|Fs], Fs, [dr(0,dl(1,lit(s),lit(s)),lit(n))-lambda(V,V),lit(n)-lambda(P,lambda(Y,merge(drs([variable(X)],[Condition]),appl(P,Y))))|Ss], Ss) :- % is_date_indication(P, W, Condition). %gq_a_semantics(lambda(P,lambda(Q,merge(merge(drs([variable(X)],[]),appl(P,X)),appl(Q,X))))). % "tous/toutes les" sequence_semantics([Tout,les|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,lit(np(_,_,_)),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(np(_,_,_)))-lambda(Z,Z),dr(0,lit(np(_,_,_)),lit(n))-Sem|Ss], Ss) :- is_tout(Tout), !, format(user_error, 'SEQUENCE: ~w les~n', [Tout]), gq_every_semantics_bis(Sem). % "Le meilleur/Les meilleurs" sequence_semantics([Le,Meilleur|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,presup(presup(merge(drs([variable(Y)],[]),appl(P,Y)),drs([event(E1),event(E2)],[not(drs([variable(Z)],[drs_label(E1,appl(P,Y)),drs_label(E2,appl(P,Z)),bool(appl(mésure,appl(bon,E2)),>,appl(mésure,appl(bon,E1)))]))])),appl(Q,Y)))),dr(0,lit(n),lit(n))-lambda(X,X)|Ss], Ss) :- is_le_la(Le), is_meilleur(Meilleur), !. sequence_semantics([Les,Meilleurs|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,presup(presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(P,Y)),drs([event(E1),event(E2)],[not(drs([variable(Z),variable(Y1)],[bool(Z,empty_intersect,Y),bool(Y1,atomic_sub,Y),drs_label(E1,appl(P,Y)),drs_label(E2,appl(P,Z)),bool(appl(mésure,appl(bon,E2)),>,appl(mésure,appl(bon,E1)))]))])),appl(Q,Y)))),dr(0,lit(n),lit(n))-lambda(X,X)|Ss], Ss) :- is_les(Les), is_meilleurs(Meilleurs), !. % "Le pire/Les pires" sequence_semantics([Le,pire|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,presup(presup(merge(drs([variable(Y)],[]),appl(P,Y)),drs([event(E1),event(E2)],[not(drs([variable(Z)],[drs_label(E1,appl(P,Y)),drs_label(E2,appl(P,Z)),bool(appl(mésure,appl(bon,E2)),<,appl(mésure,appl(bon,E1)))]))])),appl(Q,Y)))),dr(0,lit(n),lit(n))-lambda(X,X)|Ss], Ss) :- is_le_la(Le), !. sequence_semantics([Les,pires|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(n),lit(n))|Fs], Fs, [dr(0,lit(np(_,_,_)),lit(n))-lambda(P,lambda(Q,presup(presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(P,Y)),drs([event(E1),event(E2)],[not(drs([variable(Z),variable(Y1)],[bool(Z,empty_intersect,Y),bool(Y1,atomic_sub,Y),drs_label(E1,appl(P,Y)),drs_label(E2,appl(P,Z)),bool(appl(mésure,appl(bon,E2)),<,appl(mésure,appl(bon,E1)))]))])),appl(Q,Y)))),dr(0,lit(n),lit(n))-lambda(X,X)|Ss], Ss) :- is_les(Les), !. % "Le plus/les plus" use adjectival % P (e->t)->(e->t) % Q e->t sequence_semantics([Le,plus|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))|Fs], Fs, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(P,lambda(Q,lambda(Y,presup(drs([event(E1),event(E2)],[not(drs([variable(Z)],[drs_label(E1,appl(appl(P,Q),Y)),drs_label(E2,appl(appl(P,Q),Z)),bool(appl(mésure,E2),>,appl(mésure,E1))]))]),appl(Q,Y))))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(X1,X1)|Ss], Ss) :- is_le_la(Le), !. sequence_semantics([Les,plus|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))|Fs], Fs, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(P,lambda(Q,lambda(Y,presup(drs([event(E1),event(E2)],[not(drs([variable(Z),variable(Y1)],[bool(Z,empty_intersect,Y),bool(Y1,atomic_sub,Y),drs_label(E1,appl(appl(P,Q),Y1)),drs_label(E2,appl(appl(P,Q),Z)),bool(appl(mésure,E2),>,appl(mésure,E1))]))]),appl(Q,Y))))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(X1,X1)|Ss], Ss) :- is_les(Les), !. % "Le plus/les plus" use adjectival % P (e->t)->(e->t) % Q e->t sequence_semantics([Le,plus|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dr(0,dr(0,dl(0,lit(n),lit(n)),lit(pp(de))),dl(0,lit(n),lit(n)))|Fs], Fs, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(P,lambda(Q,lambda(Y,presup(drs([event(E1),event(E2)],[not(drs([variable(Z)],[drs_label(E1,appl(appl(P,Q),Y)),drs_label(E2,appl(appl(P,Q),Z)),bool(appl(mésure,E2),>,appl(mésure,E1))]))]),appl(Q,Y))))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(X1,X1)|Ss], Ss) :- is_le_la(Le), !. % "Le moins/les moins" use adjectival % P (e->t)->(e->t) % Q e->t sequence_semantics([Le,moins|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))|Fs], Fs, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(P,lambda(Q,lambda(Y,presup(drs([event(E1),event(E2)],[not(drs([variable(Z)],[drs_label(E1,appl(appl(P,Q),Y)),drs_label(E2,appl(appl(P,Q),Z)),bool(appl(mésure,E2),<,appl(mésure,E1))]))]),appl(Q,Y))))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(X1,X1)|Ss], Ss) :- is_le_la(Le), !. sequence_semantics([Les,moins|Ws], Ws, [_,_|Ps], Ps, [_,_|Ls], Ls, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))|Fs], Fs, [dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(P,lambda(Q,lambda(Y,presup(drs([event(E1),event(E2)],[not(merge(appl(Q,Z),drs([variable(Z),variable(Y1)],[bool(Z,empty_intersect,Y),bool(Y1,atomic_sub,Y),drs_label(E1,appl(appl(P,Q),Y1)),drs_label(E2,appl(appl(P,Q),Z)),bool(appl(mésure,E2),<,appl(mésure,E1))])))]),appl(Q,Y))))),dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n)))-lambda(X1,X1)|Ss], Ss) :- is_les(Les), !. % "à Num heure(s)" % TODO: Fix this sequence_semantics([à,Num,_|Ws], Ws, [prp,num,_|Ps], Ps, [_,_,heure|Ls], Ls, [dr(0,dl(1,lit(s(_)),lit(s(_))),lit(np(_,_,_))),dr(0,lit(np(_,_,_)),lit(n)),lit(n)|Fs], Fs, [dl(1,lit(s(ST)),lit(s(ST)))-lambda(E,lambda(S,merge(drs([],[bool(appl(temps,E),=,appl(Card,h))]),appl(S,E))))|Ss], Ss) :- convert_cardinal(Num, Card), !. % gq_the_semantics(lambda(P,lambda(Q,presup(merge(drs([variable(X),variable(Y)],[bool(Y,=,?),bool(num(Y),=,1),bool(X,in,Y)]),appl(P,X)),appl(Q,X))))). is_date_indication(num, W, X, appl(appl(jour,Num),X)) :- convert_cardinal(W, Num), Num > 0, Num < 32, !. is_date_indication(_, W, X, appl(appl(jour_de_la_semaine,W),X)) :- is_weekday(W). % = matches the atoms "l'" and "L'" is_l_apostrophe('l\''). is_l_apostrophe('L\''). is_un_une(un). is_un_une(une). is_meilleur(meilleur). is_meilleur(meilleure). is_meilleurs(meilleurs). is_meilleurs(meilleures). is_le_la(le). is_le_la(la). is_le_la('Le'). is_le_la('La'). is_les(les). is_les('Les'). is_tout(tout). is_tout(tous). is_tout(toutes). is_tout(toute). is_tout('Tout'). is_tout('Tous'). is_tout('Toutes'). is_tout('Toute'). % = factive verbs % TODO: verify and complete % NOTE: some of these ("se souvenir" at least) are sensitive % to the aspect (subjunctive or not) of the "que" complement, % where subjunctive can prevent factivity in the context of % negation eg. % % "Pierre se souvient pas que Marie soit venue" % % (example 5) from % % Paul Egré (2005), Question-Embedding and Factivity, Journées % Sémantique et Modélisation 2005, Paris. % % Handling these cases will require a more subtle treatement % both syntactically (right now the "s(q)" atomic formula % is indifferent to whether the sentence is in indicative % or subjunctive mood) and semantically. % Note: "voir", "entendre", "sentir" are not truly factive, % since they permit "deduction" of the that-clause. % % 1. Jean a vu que Marie a renversé sa tasse de café % 2. Jean a vu Marie renverser sa tasse de café % % (1) can be said in case Jean has just seen evidence of % the coffee being spilt (on her desk, for example), whereas % (2) requires Jean to have seen the actual action of % spilling the coffee. % % However, as a simplification of the actual facts, we will % treat these verbs as factive. factive(admettre). factive(apprendre). factive(avouer). factive(cacher). factive(comprendre). factive(constater). factive(decouvrir). factive(découvrir). factive(déplorer). factive(entendre). factive(montrer). factive(observer). factive(oublier). factive(rappeler). factive(reconnaître). factive(regretter). factive(révéler). factive(savoir). factive(sentir). factive(voir). factive(se_souvenir). factive(se_apercevoir). % = prefixed adjectives which are subsective % TODO: verify and complete % QUESTION: are there any which are truly intersective? % or intersective in some sort of more subtle way? % TODO: continue verification, but make subsective the % base case for prefixed adjectives % non-subsective non-privative and others % apparente % chaud (?) % demi % double % financière (?) % prochain (?) prochain président != président, prochain jour = jour % précédent % complex cases: % autre ! % seul ! % tel ! prefixed_nonsubsective_adjective(apparent). % meaning B of TLFI is non-subsective prefixed_nonsubsective_adjective(éventuel). prefixed_nonsubsective_adjective(possible). prefixed_nonsubsective_adjective(partiel). prefixed_nonsubsective_adjective(présumé). prefixed_nonsubsective_adjective(probable). prefixed_nonsubsective_adjective(prochain). % ? % = prefixed adjectives which are privative % TODO: verify and complete prefixed_privative_adjective(faux). prefixed_privative_adjective(imaginaire). prefixed_privative_adjective(prétendu). % = postfixed adjectives which are privative % TODO: verify and complete postfixed_privative_adjective(fictif). postfixed_privative_adjective(imaginaire). % = postfixed adjective which are not intersective but subsective postfixed_subsective_adjective(bas). postfixed_subsective_adjective(difficile). postfixed_subsective_adjective(facile). postfixed_subsective_adjective(grand). postfixed_subsective_adjective(habile). postfixed_subsective_adjective(influent). postfixed_subsective_adjective(intéressant). postfixed_subsective_adjective(irrésistible). postfixed_subsective_adjective(immense). postfixed_subsective_adjective(jeune). postfixed_subsective_adjective(juste). postfixed_subsective_adjective(haut). postfixed_subsective_adjective(large). postfixed_subsective_adjective(lent). postfixed_subsective_adjective(lointain). postfixed_subsective_adjective(long). postfixed_subsective_adjective(lourd). postfixed_subsective_adjective(légendaire). postfixed_subsective_adjective(léger). postfixed_subsective_adjective(magnifique). postfixed_subsective_adjective(maigre). postfixed_subsective_adjective(mauvais). postfixed_subsective_adjective(petit). temporal_adverb(X) :- is_weekday(X). temporal_adverb(hier). temporal_adverb('aujourd\'hui'). temporal_adverb(demain). % = weekdays is_weekday(lundi). is_weekday(mardi). is_weekday(mercredi). is_weekday(jeudi). is_weekday(vendredi). is_weekday(samedi). is_weekday(dimanch). is_month(janvier). is_month(février). is_month(fevrier). is_month(mars). is_month(avril). is_month(mai). is_month(juin). is_month(juillet). is_month(aout). is_month(août). is_month(septembre). is_month(octobre). is_month(novembre). is_month(décembre). is_month(decembre). is_season(hiver). is_season(printemps). is_season(été). is_season(automne). is_daypart(nuit). is_daypart(matin). is_daypart('après-midi'). is_daypart(après-midi). is_daypart(soir). % = add roles add_roles(L, P, E, R0, R) :- event_semantics(prolog), !, add_roles_predicate(L, P, E, R0, R). add_roles(L, P, E, R0, R) :- event_semantics(classic), !, R0 = [appl(T,E)|R], add_roles_classic(L, P, T). add_roles(L, P, E, R0, R) :- event_semantics(neo), !, add_roles_neo(L, P, E, R0, R). add_roles_neo(L, P, E) --> [appl(P,E)], add_roles_neo_args(L, E). add_roles_neo_args([], _) --> []. add_roles_neo_args([R-V|Rest], E) --> [appl(appl(R,V),E)], add_roles_neo_args(Rest, E). add_roles_classic([], P, P). add_roles_classic([_-A|Rest], P, appl(T,A)) :- add_roles_classic(Rest, P, T). add_roles_predicate(L0, P, E) --> {strip_keys(L0, L), T =.. [P,E|L]}, [T]. % ===================================== % = Default semantics with POS tag = % ===================================== % = months and weekdays %% default_semantics(siecle, nom, lit(n), lambda(X,drs([],[appl(appl(temps,siecle),X)]))). %% default_semantics(siecle, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,siecle),X)]))). %% default_semantics(décennie, nom, lit(n), lambda(X,drs([],[appl(appl(temps,décennie),X)]))). %% default_semantics(décennie, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,décennie),X)]))). %% default_semantics(an, nom, lit(n), lambda(X,drs([],[appl(appl(temps,an),X)]))). %% default_semantics(an, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,an),X)]))). %% default_semantics(année, nom, lit(n), lambda(X,drs([],[appl(appl(temps,an),X)]))). %% default_semantics(année, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,an),X)]))). %% default_semantics(mois, nom, lit(n), lambda(X,drs([],[appl(appl(temps,mois),X)]))). %% default_semantics(mois, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,mois),X)]))). %% default_semantics(semaine, nom, lit(n), lambda(X,drs([],[appl(appl(temps,semaine),X)]))). %% default_semantics(semaine, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,semaine),X)]))). %% default_semantics(jour, nom, lit(n), lambda(X,drs([],[appl(appl(temps,jour),X)]))). %% default_semantics(jour, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,jour),X)]))). %% default_semantics(journée, nom, lit(n), lambda(X,drs([],[appl(appl(temps,jour),X)]))). %% default_semantics(journée, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,jour),X)]))). %% default_semantics(heure, nom, lit(n), lambda(X,drs([],[appl(appl(temps,heure),X)]))). %% default_semantics(heure, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,heure),X)]))). %% default_semantics(minute, nom, lit(n), lambda(X,drs([],[appl(appl(temps,minute),X)]))). %% default_semantics(minute, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,minute),X)]))). %% default_semantics(seconde, nom, lit(n), lambda(X,drs([],[appl(appl(temps,seconde),X)]))). %% default_semantics(seconde, nom:_, lit(n), lambda(X,drs([],[appl(appl(temps,seconde),X)]))). %% default_semantics(Season, nom, lit(n), lambda(X,drs([],[appl(appl(saison,Season),X)]))) :- %% is_season(Season). %% default_semantics(Season, nom:_, lit(n), lambda(X,drs([],[appl(appl(saison,Season),X)]))) :- %% is_season(Season). %% default_semantics(Month, nom, lit(n), lambda(X,drs([],[appl(appl(mois,Month),X)]))) :- %% is_month(Month). %% default_semantics(Month, nom:_, lit(n), lambda(X,drs([],[appl(appl(mois,Month),X)]))) :- %% is_month(Month). %% default_semantics(Weekday, nom, lit(n), lambda(X,drs([],[appl(appl(jour_de_la_semaine,Weekday),X)]))) :- %% is_weekday(Weekday). %% default_semantics(Weekday, nom:_, lit(n), lambda(X,drs([],[appl(appl(jour_de_la_semaine,Weekday),X)]))) :- %% is_weekday(Weekday). %% default_semantics(Daypart, nom, lit(n), lambda(X,drs([],[appl(appl(partie_de_la_journée,Daypart),X)]))) :- %% is_daypart(Daypart). %% default_semantics(Daypart, nom:_, lit(n), lambda(X,drs([],[appl(appl(partie_de_la_journée,Daypart),X)]))) :- %% is_daypart(Daypart). % = numbers default_semantics(W, num, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[bool(appl(rank,V),=,Num)]),appl(P,V))))) :- convert_ordinal(W, Num). default_semantics(W, num, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[bool(num(V),=,Num)]),appl(P,V))))) :- convert_cardinal(W, Num). default_semantics(W, num, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),=,Num)]),appl(P,X)),appl(Q,X))))) :- convert_cardinal(W, Num). default_semantics(W, num, lit(n), lambda(X,drs([],[bool(X,=,Num)]))) :- convert_cardinal(W, Num). default_semantics(W, num, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,Num)]),appl(P,X)))) :- convert_cardinal(W, Num). default_semantics(W, num, dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(appl(Word,Num),X)]))))))) :- convert_cardinal(W, Num), ( Num > 1900 -> Word = édition ; Word = numéro ). default_semantics(W, adj, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),=,Num)]),appl(P,X)),appl(Q,X))))) :- convert_cardinal1(W, Num). default_semantics(W, adj, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[bool(num(V),=,Num)]),appl(P,V))))) :- convert_cardinal1(W, Num). default_semantics(W, num, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[bool(num(V),=,Num)]),appl(P,V))))) :- convert_cardinal1(W, Num). default_semantics(W, adj, lit(n), lambda(X,drs([],[bool(num(X),=,Num)]))) :- convert_cardinal1(W, Num). default_semantics(W, nom, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),=,Num)]),appl(P,X)),appl(Q,X))))) :- convert_cardinal1(W, Num). default_semantics(W, nom, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[bool(num(V),=,Num)]),appl(P,V))))) :- convert_cardinal1(W, Num). default_semantics(W, nom, lit(n), lambda(X,drs([],[bool(num(X),=,Num)]))) :- convert_cardinal1(W, Num). % = nouns % = NOM default_semantics(W, nom, lit(n), lambda(X,drs([],[appl(W,X)|Rest]))) :- add_info(W, X, Rest, []). default_semantics(W, nom:INFO, lit(n), lambda(X,drs([],[appl(W,X)|Rest0]))) :- add_lefff_info(INFO, X, Rest), add_info(W, X, Rest0, Rest). % = NAM default_semantics(Word, nam, lit(n), lambda(X,presup(drs([],[appl(appl(nommé,Word),X)]),drs([],[])))). default_semantics(Word, nam:INFO, lit(n), lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest0]),drs([],[])))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). % = noun phrase - NAM (proper name) default_semantics(Word, nam, lit(np(_,_,_)), lambda(P,presup(drs([variable(X)],[appl(appl(nommé,Word),X)]),appl(P,X)))). default_semantics(Word, nam, dr(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)]),appl(P,X))))))). default_semantics(Word, nam, dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)]),appl(P,X))))))). default_semantics(Word, nam:INFO, lit(np(_,_,_)), lambda(P,presup(drs([variable(X)],[appl(appl(nommé,Word),X)|Rest0]),appl(P,X)))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). default_semantics(Word, nam:INFO, dr(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest0]),appl(P,X))))))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). default_semantics(Word, nam:INFO, dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest0]),appl(P,X))))))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). % names used as epithets default_semantics(Word, nam, dl(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest]),appl(P,X))))) :- add_info(Word, X, [], Rest). default_semantics(Word, nam, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest]),appl(P,X))))) :- add_info(Word, X, [], Rest). default_semantics(Word, nam:INFO, dl(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest0]),appl(P,X))))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). default_semantics(Word, nam:INFO, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[appl(appl(nommé,Word),X)|Rest0]),appl(P,X))))) :- add_lefff_info(INFO, X, Rest), add_info(Word, X, Rest0, Rest). % = verbs % "se faire" passive default_semantics(faire, ver:TIME, dr(_,dl(0,lit(cl_r),dl(0,lit(np(_,_,_)),lit(s(_)))),dl(0,lit(np(_,_,_)),lit(s(INF)))), lambda(INF,lambda(_SE,lambda(NP,lambda(E,appl(NP,lambda(Y,presup(drs(Es,Tnse),merge([variable(X),event(L)],Conds))))))))) :- nonvar(INF), INF = inf(_), add_roles([agent-X,patient-Y,theme-L], se_faire, E, Conds, [drs_label(L,appl(INF,lambda(Prp,appl(Prp,X))))]), pos_time(ver:TIME, [], Es, E-Tnse). % passive (tagged as past participle, should correct some POS-tag errors) default_semantics(Word, ver:pper, dr(0,dl(0,lit(np(_,_,_)),lit(s(ppart))),lit(pp(par))), lambda(SUJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUJ,lambda(X,drs([],Conds))))))))) :- get_roles(Word, [np,np], [Role1, Role2]), add_roles([Role1-X,Role2-Y], Word, E, Conds, []). % %get_roles(Word, [np], [SRole]), % add_roles([SRole-X], Word, E, Conds, Time), % not all these constructions use an expletive "il", for example "il est certain de ..." is ambiguous between "he is sure that" and "it is sure that" default_semantics(être, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,il,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(INF,lambda(_NP,lambda(E,presup(drs(Es,Cs),merge(drs([event(L),event(F)],[drs_label(L,merge(drs([variable(X)],[appl(generic,X)]),appl(appl(INF,lambda(P1,appl(P1,X))),F)))]),appl(appl(ADJ,lambda(_,drs([],[]))),sub(L,E))))))))) :- pos_time(ver:TIME, [], Es, E-Cs). default_semantics(estimer, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,il,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(INF,lambda(NP,lambda(E,presup(drs(Es,Cs),appl(NP,lambda(X,drs([event(L),event(F)],[drs_label(L,appl(appl(INF,lambda(P1,appl(P1,X))),F))|Conds]))))))))) :- add_roles([agent-X,theme-M], estimer, E, Conds, [drs_label(M,appl(appl(ADJ,lambda(_,drs([],[]))),sub(L,E)))]), pos_time(ver:TIME, [], Es, E-Cs). default_semantics(juger, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,il,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(INF,lambda(NP,lambda(E,presup(drs(Es,Cs),appl(NP,lambda(X,drs([event(L),event(F)],[drs_label(L,appl(appl(INF,lambda(P1,appl(P1,X))),F))|Conds]))))))))) :- add_roles([agent-X,theme-M], juger, E, Conds, [drs_label(M,appl(appl(ADJ,lambda(_,drs([],[]))),sub(L,E)))]), pos_time(ver:TIME, [], Es, E-Cs). default_semantics(paraître, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,il,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(INF,lambda(_NP,lambda(E,presup(drs(Es,Cs),drs([event(L),event(F)],[drs_label(L,merge(drs([variable(X)],[appl(generic,X)]),appl(appl(INF,lambda(P1,appl(P1,X))),F)))|Conds]))))))) :- add_roles([theme-M], paraître, E, Conds, [drs_label(M,appl(appl(ADJ,lambda(_,drs([],[]))),sub(L,E)))]), pos_time(ver:TIME, [], Es, E-Cs). % = "être + passive" % "être" only provide tense information, the passive itself takes care of role information default_semantics(être, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(pass)))), lambda(VP,lambda(NP,lambda(E,presup(drs(Es,Cs),appl(appl(VP,NP),E)))))) :- pos_time(ver:TIME, [], Es, E-Cs). default_semantics(V, _POS, dl(0,lit(np(_,_,_)),lit(s(pass))), lambda(OBJ,lambda(E,appl(OBJ,lambda(Y, drs([variable(X)],[bool(X,=,'context?')|Conds])))))) :- get_roles(V, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], V, E, Conds, []). % some verbs with par-complements which are not the subject (normally these should not get the passive supertag) default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(par))), lambda(PP,lambda(OBJ,lambda(E,appl(PP,lambda(Z,appl(OBJ,lambda(Y,drs([variable(X)],[bool(X,=,'context?')|Conds]))))))))) :- /* use get_roles1 instead of get_roles to avoid defaults */ get_roles1(V, [np, np, pp(par)], [Arg1, Arg2, Arg3]), !, combine_prep_word(par, V, VPar), add_roles([Arg1-X,Arg2-Y,Arg3-Z], VPar, E, Conds, []). default_semantics(passer, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(par))), lambda(PP,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(PP,lambda(Y,drs([variable(P)],Conds))))))))) :- add_roles([theme-X,path-P], travel, E, Conds, [appl(path,P),appl(moving,X),appl(appl(cross,Y),P)]). % passive with par-complement subjet default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(par))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(V, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], V, E, Conds, []). % passive with de-complement subjet default_semantics(suivre, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(de))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(suivre, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], suivre, E, Conds, []). default_semantics(aimer, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(de))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(aimer, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], aimer, E, Conds, []). default_semantics(accompagner, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(de))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(accompagner, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], accompagner, E, Conds, []). default_semantics(apprécier, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(de))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(apprécier, [np, np], [SubjRole, ObjRole]), add_roles([SubjRole-X,ObjRole-Y], apprécier, E, Conds, []). default_semantics(respecter, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(de))), lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds))))))))) :- get_roles(respecter, SubjRole, ObjRole), add_roles([SubjRole-X,ObjRole-Y], respecter, E, Conds, []). % other prepositions default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(PP))), lambda(PPA,lambda(OBJ,lambda(E,appl(PPA,lambda(Z,appl(OBJ,lambda(Y,drs([variable(X)],[bool(X,=,'context?')|Conds]))))))))) :- combine_prep_word(PP, V, PW), get_roles(V, [np, np, pp(PP)], [Arg1, Arg2, Arg3]), add_roles([Arg1-X,Arg2-Y,Arg3-Z], PW, E, Conds, []). default_semantics(V, _POS, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(par))),lit(pp(PP))), lambda(PP,lambda(SUBJ,lambda(OBJ,lambda(E,appl(PP,lambda(Z,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds)))))))))))) :- combine_prep_word(PP, V, PW), get_roles(V, [np, np, pp(PP)], [Arg1, Arg2, Arg3]), add_roles([Arg1-X,Arg2-Y,Arg3-Z], PW, E, Conds, []). % "était nommé NP" default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(np(_,_,_))), lambda(OBJ2,lambda(OBJ1,lambda(E,appl(OBJ1,lambda(Y,appl(OBJ2,lambda(Z,drs([variable(X)],[bool(X,=,'context?')|Conds]))))))))) :- get_roles(V, [np, np, np], [Arg1, Arg2, Arg3]), add_roles([Arg1-X,Arg2-Y,Arg3-Z], V, E, Conds, []). % passive+control verb, object control only (TODO: verify!) default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),dl(0,lit(np(_,_,_)),lit(s(inf(PRP))))), lambda(INF,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,drs([variable(X),event(L)],[bool(X,=,'context?')|Conds]))))))) :- combine_prep_word(PRP, V, PW), % format(user_error, '~N~w ~w~n', [PRP,PW]), add_roles([agent-X,patient-Y,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))]). % passive+adjectival argument default_semantics(V, _POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,drs([variable(X),event(L)],[bool(X,=,'context?')|Conds]))))))) :- add_roles([agent-X,patient-Y,theme-L], V, E, Conds, [drs_label(L,appl(appl(ADJ,lambda(_,drs([],[]))),Y))]). default_semantics(V, _POS, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),lit(pp(par))),dl(0,lit(n),lit(n))), lambda(ADJ,lambda(SUBJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds)))))))))) :- add_roles([agent-X,patient-Y,theme-L], V, E, Conds, [drs_label(L,appl(appl(ADJ,lambda(_,drs([],[]))),Y))]). default_semantics(V, _POS, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(pass))),dl(0,lit(n),lit(n))),lit(pp(par))), lambda(SUBJ,lambda(ADJ,lambda(OBJ,lambda(E,appl(OBJ,lambda(Y,appl(SUBJ,lambda(X,drs([],Conds)))))))))) :- add_roles([agent-X,patient-Y,theme-L], V, E, Conds, [drs_label(L,appl(appl(ADJ,lambda(_,drs([],[]))),Y))]). % = weather verbs: pleuvoir/neiger etc. which are all impersonal verbs. default_semantics(V, POS, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(_P, lambda(E, presup(drs(Es,Time),drs([],[appl(V,E)]))))) :- weather_verb(V), pos_time(POS, [], Es, E-Time). % = intransitive "aller" % TODO: check more examples, I think movement uses are rather limited, if they exist. %default_semantics(aller, POS, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(P,lambda(E,appl(P,lambda(X,drs(Es,[bool(Y,=,'lieu?'),appl(appl(source,Y),E)|Time])))))) :- % add_roles([moving-X,path-Path], travel, E, Conds, [appl(appl(destination,Y),Path)]), % pos_time(POS, [], Es, E-Time). default_semantics(aller, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(pp(à))), lambda(Q,lambda(P,lambda(E,appl(Q,lambda(Y,appl(P,lambda(X,presup(drs(Es,Time),drs([],Conds)))))))))) :- add_roles([moving-X,path-Path], travel, E, Conds, [appl(appl(destination,Y),Path)]), pos_time(POS, [], Es, E-Time). % version of "aller" which presupposes the speaker is not at the destination (as a sort of symmetry to "venir") %default_semantics(aller, POS, dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(à))), lambda(Q, lambda(P, lambda(E,appl(P,lambda(V,appl(Q,lambda(W,presup(drs([X,OL,T],[appl(orateur,X),appl(appl(temps,T),E),appl(appl(appl(lieu,OL),T),X),bool(OL,neq,W)]),drs(EVs, [appl(event,E),appl(appl(appl(travel,Path),V),E),appl(moving,V),appl(appl(destination,W),Path)|Time])))))))))) :- % pos_time(POS, [], EVs, E-Time). % "se rendre à" default_semantics(rendre, POS, dr(0,dl(0,lit(cl_r),dl(0,lit(np(_,_,_)),lit(s(_)))),lit(pp(à))), lambda(Q,lambda(P,lambda(E,appl(Q,lambda(Y,appl(P,lambda(X,presup(drs(Es,Time),drs([],Conds)))))))))) :- add_roles([moving-X,path-Path], travel, E, Conds, [appl(appl(destination,Y),Path)]), pos_time(POS, [], Es, E-Time). % "revenir" presupposes "partir" default_semantics(revenir, POS, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(P, lambda(E,appl(P,lambda(V,presup(drs([event(F)],[appl(appl(appl(location,V),L),F)]),drs(Es, [appl(appl(appl(travel,V),Path),E),appl(path,Path),appl(moving,V),app(appl(source,complement(L)),Path),appl(appl(destination,L),Path),bool(L,=,'lieu?')|Time]))))))) :- pos_time(POS, [], Es, E-Time). default_semantics(revenir, POS, dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(à))), lambda(Q, lambda(P, lambda(E,appl(P,lambda(V,appl(Q,lambda(Lieu,presup(drs([event(F)],[appl(appl(appl(location,V),L),F)]),drs(Es, [appl(appl(appl(travel,V),Path),E),appl(path,Path),appl(moving,V),app(appl(source,complement(L)),Path),appl(appl(destination,Lieu),Path)|Time])))))))))) :- pos_time(POS, [], Es, E-Time). % intransitive "arriver", resolve implicit destination anaphor default_semantics(arriver, POS, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(P, lambda(E,appl(P,lambda(V,presup(drs([varialbe(D)],[bool(D,=,'lieu?')]),drs(EVs, [appl(appl(appl(travel,Path),V),E),appl(moving,V),appl(path,Path),appl(appl(source,complement(D)),Path),appl(appl(destination,D),Path)|Time]))))))) :- pos_time(POS, [], EVs, E-Time). % intransitive "partir", resolve implicit source anaphor default_semantics(partir, POS, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(P, lambda(E,appl(P,lambda(V,presup(drs([variable(D)],[bool(D,=,'lieu?')]),drs(EVs, [appl(appl(appl(travel,Path),V),E),appl(moving,V),appl(path,Path),appl(appl(source,D),Path),appl(appl(destination,complement(D)),Path)|Time]))))))) :- pos_time(POS, [], EVs, E-Time). % = intransitive --- DEFAULT CASE default_semantics(Word, ver:TIME, dl(0,lit(np(_,_,_)),lit(s(_))), lambda(NPS,lambda(E,appl(NPS,lambda(X,drs(EVs,Conds)))))) :- get_roles(Word, [np], [SRole]), add_roles([SRole-X], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = intransitive - verb initial default_semantics(Word, ver:TIME, dr(0,lit(s(_)),lit(np(_,_,_))), lambda(NPS,lambda(E,appl(NPS,lambda(X,drs(EVs,Conds)))))) :- get_roles(Word, [np], [SRole]), add_roles([SRole-X], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = transitive - SVO default_semantics(quitter, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))), lambda(P,lambda(Q,lambda(E,appl(Q,lambda(V,appl(P,lambda(W,presup(drs([event(F)],[appl(appl(appl(location,V),W),F)]),drs(EVs,[appl(appl(appl(travel,Path),V),E),appl(moving,V),appl(path,Path),appl(appl(source,W),Path),appl(appl(destination,complement(W)),Path),bool(appl(temps,F),<,appl(temps,E))|Time])))))))))) :- pos_time(POS, [], EVs, E-Time). % transitive "être" % the identity between X and Y needs to depend on the temporal information, which is coded as "=_E" where E is the event default_semantics(être, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))), lambda(P,lambda(Q,lambda(E,appl(Q,lambda(Y,appl(P,lambda(X,presup(drs(EVs,Time),drs([],[bool(X,is_at(E),Y)])))))))))) :- pos_time(POS, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))), lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs(EVs,Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = transitive - verb initial default_semantics(Word, ver:TIME, dr(0,dr(0,lit(s(_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NPS,lambda(NPO,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs(EVs,Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = transitive - verb final default_semantics(Word, ver:TIME, dl(0,lit(np(_,_,_)),dl(0,lit(np(_,_,_)),lit(s(_)))), lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs(EVs,Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = NP V PP default_semantics(Word, ver:TIME, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(pp(Prp))), lambda(PP,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(PP,lambda(Y,drs(EVs,Conds))))))))) :- get_roles(Word, [np,pp(Prp)], [SRole,PRole]), combine_prep_word(Prp, Word, PW), add_roles([SRole-X,PRole-Y], PW, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dr(0,lit(s(_)),lit(pp(Prp))),lit(np(_,_,_))), lambda(NPS,lambda(PP,lambda(E,appl(NPS,lambda(X,appl(PP,lambda(Y,drs(EVs,Conds))))))))) :- get_roles(Word, [np,pp(Prp)], [SRole,PRole]), combine_prep_word(Prp, Word, PW), add_roles([SRole-X,PRole-Y], PW, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = ditransitive - SVO default_semantics(Word, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NPO,lambda(NPI,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,appl(NPI,lambda(Z,drs(EVs,Conds)))))))))))) :- get_roles(Word, [np,np,np], [SRole,ORole,IRole]), add_roles([SRole-X,ORole-Y,IRole-Z], Word, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(pp(Prp))),lit(np(_,_,_))), lambda(NPO,lambda(PP,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,appl(PP,lambda(Z,drs(EVs,Conds)))))))))))) :- get_roles(Word, [np,np,pp(Prp)], [SRole,ORole,PRole]), combine_prep_word(Prp, Word, PW), add_roles([SRole-X,ORole-Y,PRole-Z], PW, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),lit(pp(Prp))), lambda(PP,lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,appl(PP,lambda(Z,drs(EVs,Conds)))))))))))) :- get_roles(Word, [np,np,pp(Prp)], [SRole,ORole,PRole]), combine_prep_word(Prp, Word, PW), add_roles([SRole-X,ORole-Y,PRole-Z], PW, E, Conds, Time), pos_time(ver:TIME, [], EVs, E-Time). % = reflexive default_semantics(Word, ver:TIME, dl(0,lit(cl_r),dl(0,lit(np(_,_,_)),lit(s(_)))), lambda(_SE, lambda(NP, lambda(E, appl(NP,lambda(X,drs(Es,Conds))))))) :- get_roles(Word, [np, cl_r], [SRole, CLRole]), ( CLRole == null -> combine_se(Word, SeWord), add_roles([SRole-X], SeWord, E, Conds, Tnse) ; add_roles([SRole-X,CLRole-X], Word, E, Conds, Tnse) ), pos_time(ver:TIME, [], Es, E-Tnse). default_semantics(Word, ver:TIME, dr(0,dl(0,lit(cl_r),lit(s(_))),lit(np(_,_,_))), lambda(NP, lambda(_SE, lambda(E, appl(NP,lambda(X,drs(Es,Conds))))))) :- get_roles(Word, [np, cl_r], [SRole, CLRole]), ( CLRole == null -> combine_se(Word, SeWord), add_roles([SRole-X], SeWord, E, Conds, Tnse) ; add_roles([SRole-X,CLRole-X], Word, E, Conds, Tnse) ), pos_time(ver:TIME, [], Es, E-Tnse). default_semantics(Word, ver:TIME, dl(0,lit(np(_,_,_)),dl(0,lit(cl_r),lit(s(_)))), lambda(NP, lambda(_SE, lambda(E, appl(NP,lambda(X,drs(Es,Conds))))))) :- get_roles(Word, [np, cl_r], [SRole, CLRole]), ( CLRole == null -> combine_se(Word, SeWord), add_roles([SRole-X], SeWord, E, Conds, Tnse) ; add_roles([SRole-X,CLRole-X], Word, E, Conds, Tnse) ), pos_time(ver:TIME, [], Es, E-Tnse). % reflexive + NP/PP default_semantics(Word, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),lit(np(_,_,_))), lambda(Obj, lambda(_SE, lambda(Suj, lambda(E, appl(Suj,lambda(X,appl(Obj,lambda(Y,drs(Es,Conds)))))))))) :- get_roles(Word, [np, cl_r, np], [SRole, CLRole, ORole]), ( CLRole == null -> combine_se(Word, SeWord), add_roles([SRole-X,ORole-Y], SeWord, E, Conds, Tnse) ; add_roles([SRole-X,CLRole-X,ORole-Y], Word, E, Conds, Tnse) ), pos_time(ver:TIME, [], Es, E-Tnse). default_semantics(Word, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),lit(pp(PRP))), lambda(PP, lambda(_SE, lambda(Suj, lambda(E, appl(Suj,lambda(X,appl(PP,lambda(Y,drs(Es,Conds)))))))))) :- combine_prep_word(PRP, Word, PW), get_roles(Word, [np, cl_r, pp(PRP)], [SRole, CLRole, PRole]), ( CLRole == null -> combine_se(PW, SeWord), add_roles([SRole-X,PRole-Y], SeWord, E, Conds, Tnse) ; add_roles([SRole-X,CLRole-X,PRole-Y], PW, E, Conds, Tnse) ), pos_time(ver:TIME, [], Es, E-Tnse). % reflexive + INF default_semantics(Word, ver:TIME, dr(_,dl(0,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),dl(_,lit(np(_,_,_)),lit(s(inf(Prep))))), lambda(INF, lambda(_Refl, lambda(NPS, lambda(E, appl(NPS,lambda(Y,drs(EVs,Conds)))))))) :- combine_prep_word(Prep, Word, PW), get_roles(Word, [np, cl_r, inf(Prep)], [SRole, CLRole, IRole]), ( CLRole == null -> combine_se(PW, SeWord), add_roles([SRole-Y,IRole-L], SeWord, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]) ; add_roles([SRole-Y,CLRole-Y,IRole-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(appl(INF,lambda(Q,appl(Q,Y))),lambda(P,appl(P,Y))),F)))|Pred]) ), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % reflexive + ADJ % TODO % = auxiliary verbs default_semantics(été, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_etre(POS, [], Sem). default_semantics(être, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_etre(POS, [], Sem). default_semantics(être, POS, dr(0,dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(_)))),dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(ppart))))), Sem) :- auxiliary_verb_se(POS, [], Sem). % correct error in lemmatiser: "suis" as form of "suivre", but with a syntactic category which can % only correspond to "etre" default_semantics(suivre, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_etre(POS, [], Sem). default_semantics(suivre, POS, dr(0,dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(_)))),dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(ppart))))), Sem) :- auxiliary_verb_se(POS, [], Sem). % correct error in lemmatiser: "sommes" as form of "sommer", but with a syntactic category which can % only correspond to "etre" default_semantics(sommer, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_etre(POS, [], Sem). default_semantics(sommer, POS, dr(0,dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(_)))),dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(ppart))))), Sem) :- auxiliary_verb_se(POS, [], Sem). % correct formula error: this formula should only occur for forms of "être", do something half-way reasonable if it occurrs elsewhere default_semantics(Word, ver:POS, dr(0,dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(_)))),dl(0,lit(cl_r),dl(0,lit(np(A,B,C)),lit(s(ppart))))), lambda(VP,lambda(_CL,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs, Conds)))))))) :- combine_se(Word, SeWord), add_roles([agent-X, theme-X], SeWord, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(appl(VP,lambda(Q1,appl(Q1,X))),lambda(Q2,appl(Q2,X))),F)))|Time]), pos_time(ver:POS, [event(L)], EVs, E-Time). default_semantics(avoir, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_avoir(POS, [], Sem). default_semantics(avoir, POS, dr(_,dr(_,lit(s(_)),lit(np(_,_,_))),dl(_,lit(np(_,_,_)),lit(s(ppart)))), Sem) :- auxiliary_verb_avoir(POS, [], Sem). % = verbs with a preposition argument % contrary to the previous case, this time Prep is not a variable, but a preposition which is explicitly % named and selected by the verb. default_semantics(Word, ver:TIME, dr(0,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(Prep))),lit(np(acc,_,_))), lambda(OBJ,lambda(PP,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,appl(PP,lambda(Z,drs(EVs,L0)))))))))))) :- combine_prep_word(Prep, Word, PW), get_roles(Word, [np,np,pp(Prep)], [SRole,ORole,PRole]), add_roles([SRole-X,ORole-Y,PRole-Z], PW, E, L0, Time), pos_time(ver:TIME, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),lit(pp(Prep))), lambda(PP,lambda(OBJ,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,appl(PP,lambda(Z,drs(EVs,L0)))))))))))) :- combine_prep_word(Prep, Word, PW), get_roles(Word, [np,np,pp(Prep)], [SRole,ORole,PRole]), add_roles([SRole-X,ORole-Y,PRole-Z], PW, E, L0, Time), pos_time(ver:TIME, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(0,dr(0,lit(s(_)),lit(pp(Prep))),lit(np(_,_,_))), lambda(SUJ,lambda(PP,lambda(E,appl(SUJ,lambda(X,appl(PP,lambda(Y,drs(EVs,L0))))))))) :- combine_prep_word(Prep, Word, PW), get_roles(Word, [np,pp(Prep)], [SRole,PRole]), add_roles([SRole-X,PRole-Y], PW, E, L0, Time), pos_time(ver:TIME, [], EVs, E-Time). % = arrêter + deinf % presupposes "X a arrêté de P" presupposes "P(X)" % (before ref_time) default_semantics(arrêter, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(DEINF,lambda(NPS,lambda(E,appl(NPS,lambda(X,presup(merge(drs(EVs,[bool(appl(temps,F),<,appl(temps,E))]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)),drs([],L0)))))))) :- add_roles([agent-X,theme-F], arrêter, E, L0, Time), pos_time(ver:TIME, [event(F)], EVs, E-Time). default_semantics(cesser, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(DEINF,lambda(NPS,lambda(E,appl(NPS,lambda(X,presup(merge(drs(EVs,[bool(appl(temps,F),<,appl(temps,E))]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)),drs([],L0)))))))) :- add_roles([agent-X,theme-F], cesser, E, L0, Time), pos_time(ver:TIME, [event(F)], EVs, E-Time). default_semantics(finir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(DEINF,lambda(NPS,lambda(E,appl(NPS,lambda(X,presup(merge(drs(EVs,[bool(appl(temps,F),<,appl(temps,E))]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)),drs([],L0)))))))) :- add_roles([agent-X,theme-F], finir, E, L0, Pred), pos_time(ver:TIME, [event(F)], EVs, E-Pred). % = finir par INF % semantics is treated as "finally inf" default_semantics(finir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(par))))), lambda(PARINF,lambda(NPS,lambda(E,merge(appl(appl(PARINF,NPS),E),drs(EVs,[appl(finalement,E)|Pred])))))) :- pos_time(ver:TIME, [], EVs, E-Pred). % = réussir/arriver + ainf % veridical % presupposes ainf is difficult (presupposes *trying* as well) default_semantics(réussir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(AINF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,presup(drs([event(F),event(E1)],[bool(appl(temps,E),leq,appl(temps,F)),bool(appl(temps,E1),leq,appl(temps,E)),appl(difficile,F)|CondsE1]),merge(drs(EVs,Conds),appl(appl(AINF,lambda(Pd,appl(Pd,Y))),F))))))))) :- add_roles([agent-Y,theme-F], réussir_à, E, Conds, Pred), add_roles([agent-Y,theme-F], essayer, E1, CondsE1, []), pos_time(ver:TIME, [], EVs, E-Pred). default_semantics(arriver, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(AINF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,presup(drs([event(F),event(E1)],[bool(appl(temps,E),leq,appl(temps,F)),bool(appl(temps,E1),leq,appl(temps,E)),appl(difficile,F)|CondsE1]),merge(drs(EVs,Conds),appl(appl(AINF,lambda(Pd,appl(Pd,Y))),F))))))))) :- add_roles([agent-Y,theme-F], arriver_à, E, Conds, Pred), add_roles([agent-Y,theme-F], essayer, E1, CondsE1, []), pos_time(ver:TIME, [], EVs, E-Pred). % = venir + deinf % immediate past % TODO: verify Verkuyl-style times here ("venir de" and "aller") default_semantics(venir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(P,lambda(X,lambda(E,merge(drs(Events,Pred),appl(appl(P,X),E)))))) :- ( TIME = pres -> Events0 = [], Pred0 = [bool(appl(temps,E),<,maintenant)] ; TIME = impf -> Events0 = [event(S1)], Pred0 = [bool(appl(temps,E),<,S1),bool(S1,=,'event?'),bool(S1,<,maintenant)] ; Events0 = [], Pred0 = [bool(appl(temps,E),<,maintenant)] ), ( tense_aspect(none) -> Events = [], Pred = [] ; tense_aspect(drs) -> % RefTime = ref_time, Events = Events0, Pred = Pred0 ; % RefTime = appl(temps,E1), Events = [event(E1)|Events0], Pred = [appl(temps,E1)|Pred0] ). % = aller + inf % "immediate" future % TODO: add Verkuyl-style times here ("aller" +INF) default_semantics(aller, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SINF)))), lambda(P,lambda(X,lambda(E,merge(DRS,appl(appl(P,X),E)))))) :- SINF == inf, ( TIME = pres -> DRS = drs([],[bool(appl(temps,E),>,maintenant)]) ; TIME = impf -> DRS = drs([event(S1)],[bool(S1,=,'event?'),bool(appl(temps,S1),<,maintenant),bool(appl(temps,E),>,appl(temps,S1))]) ; DRS = drs([],[]) ). % venir with incorporated clitics, legacy code (obsolete with current treatment of clitics) default_semantics(venir, ver:TIME, dr(_,dl(0,lit(cl_y),dl(_,lit(np(_,_,_)),lit(s(_)))),dl(_,lit(np(_,_,_)),lit(s(SINF)))), lambda(P,lambda(CLY,lambda(X,lambda(E,merge(appl(CLY,lambda(Y,drs(EVs,[appl(venir,E),appl(appl(lieu,Y),E)|Pred]))),appl(appl(P,X),E))))))) :- SINF == inf, pos_time(ver:TIME, [], EVs, E-Pred). % = factive regretter + DEINF % % the theme of "regretter" is generally something which happens before (though not necessarily, it is possible to regret a future event, however, these cases are rather unusual) default_semantics(regretter, ver:TIME, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(Prep))))), lambda(INF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,presup(merge(drs([event(F)],Pred),appl(appl(INF,lambda(Prp,appl(Prp,Y))),F)), drs(EVs,Conds)))))))) :- combine_prep_word(Prep, regretter, PW), add_roles([agent-Y,theme-F], PW, E, Conds, [bool(appl(temps,F),leq,appl(temps,E))]), pos_time(ver:TIME, [], EVs, E-Pred). % = falloir + INF % "il faut" undecided about reference of "il" (determined by context). % Semantics should be: for a person X in this kind of situation (where "this kind of situation" is contextually determined) % person X should/must do INF. default_semantics(falloir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SINF)))), lambda(INF, lambda(_, lambda(E, presup(drs(EVs,Pred),drs([event(L)],Conds)))))) :- SINF = inf(_), add_roles([theme-L], il_faut, E, Conds, [drs_label(L,merge(drs([event(F),variable(Y)],[bool(Y,=,'context?')]),appl(appl(INF,lambda(P,appl(P,Y))),F)))]), pos_time(ver:TIME, [], EVs, E-Pred). % lemma error for "faut" default_semantics(faillir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SINF)))), lambda(INF, lambda(_, lambda(E, presup(drs(EVs,Pred),drs([event(L)],Conds)))))) :- SINF = inf(_), add_roles([theme-L], il_faut, E, Conds, [drs_label(L,merge(drs([event(F),variable(Y)],[bool(Y,=,'context?')]),appl(appl(INF,lambda(P,appl(P,Y))),F)))]), pos_time(ver:TIME, [], EVs, E-Pred). % pousser without object (object is a "generic") % TODO: generics are of course better treated as a binary relation between boxes % "Elle signifie être obligé" default_semantics(aider, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,presup(drs(EVs,Pred),drs([event(L)],Conds)))))))) :- add_roles([agent-X,theme-L], aider, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y),bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(INF,lambda(P,appl(P,Y))),F)))]), pos_time(ver:TIME, [], EVs, E-Pred). default_semantics(appeler, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,presup(drs(EVs,Pred),drs([event(L)],Conds)))))))) :- add_roles([agent-X,theme-L], appeler, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y),bool(appl(temps,E),<,appl(temps,F))]),appl(appl(INF,lambda(P,appl(P,Y))),F)))]), pos_time(ver:TIME, [], EVs, E-Pred). % agent/subject is non-person only (?) default_semantics(conduire, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], conduire, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F))),bool(appl(temps,E),<,appl(temps,L))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(conseiller, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], conseiller, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F))),bool(appl(temps,E),<,appl(temps,L))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(exiger, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], appeler, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y),bool(appl(temps,E),<,appl(temps,F))]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [], EVs, E-Pred). default_semantics(faire, ver:TIME, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(à))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(PP, lambda(NP, lambda(E, appl(NP,lambda(X,appl(PP,lambda(Y,drs(EVs,Conds)))))))))) :- add_roles([agent-X,patient-Y,theme-L], faire, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(falloir, ver:TIME, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(PPA))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(PP, lambda(_NP, lambda(E, appl(PP,lambda(Y,drs(EVs,Conds)))))))) :- PPA == à, add_roles([theme-L], falloir, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % lemmatization error for "faut" default_semantics(faillir, ver:TIME, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(PPA))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(PP, lambda(_NP, lambda(E, appl(PP,lambda(Y,drs(EVs,Conds)))))))) :- PPA == à, add_roles([theme-L], falloir, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(faire, ver:TIME, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(PP, lambda(NP, lambda(E, appl(NP,lambda(X,appl(PP,lambda(Y,drs(EVs,Conds)))))))))) :- add_roles([agent-X,patient-Y,theme-L], faire, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(faire, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,patient-Y,theme-L], faire, E, Conds, [drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [variable(Y),event(L)], EVs, E-Pred). % agent/subject is non-person only (?) default_semantics(impliquer, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(impliquer,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(inciter, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,patient-Y,theme-L], inciter, E, Conds, [appl(generic,Y),drs_label(L,merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [variable(Y),event(L)], EVs, E-Pred). default_semantics(imposer, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,patient-Y,theme-L], imposer, E, Conds, [appl(generic,Y),drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [variable(Y),event(L)], EVs, E-Pred). default_semantics(inviter, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,patient-Y,theme-L], inviter, E, Conds, [appl(generic,Y),drs_label(L,merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [variable(Y),event(L)], EVs, E-Pred). default_semantics(laisser, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(laisser,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F))),bool(appl(temps,E),subseteq,appl(temps,L))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(laisser, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(laisser,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F))),bool(appl(temps,E),subseteq,appl(temps,L))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(obliger, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(à))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(obliger,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(signifier, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(signifier,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(suggérer, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(suggérer,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(recommander, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(de))))), lambda(INF, lambda(NP, lambda(E, appl(NP,lambda(X,drs(EVs,[appl(event,E),appl(recommander,E),appl(appl(agent,X),E),appl(appl(theme,L),E),drs_label(L,merge(drs([variable(Y),event(F)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]))))))) :- pos_time(ver:TIME, [event(L)], EVs, E-Pred). % entendre/voir + INF, existential instead of generic % = entendre + inf (existential object) default_semantics(entendre, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(X,drs(EVs,Conds))))))) :- SType = inf(_), add_roles([agent-X,patient-Y,theme-L], entendre, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [event(L),variable(Y)], EVs, E-Pred). % = voir + inf (existential object) default_semantics(voir, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(X,drs(EVs,Conds))))))) :- SType = inf(_), add_roles([agent-X,patient-Y,theme-L], voir, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [event(L),variable(Y)], EVs, E-Pred). % TODO % = consister + AINF % contribuer + AINF % demander + AINF % porter + AINF % rester + AINF % revenir + AINF % suffir + AINF % travailler + AINF (?) % équivaloir (?) % parler + DEINF (?) % proposer + DEINF (?) % valoir + DEINF % = il vaut (mieux) INF default_semantics(valoir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(INF, lambda(_NP, lambda(E, drs(EVs,Conds))))) :- SType = inf(_), add_roles([theme-L], valoir, E, Conds, [drs_label(L,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(convenir, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(X,drs(EVs,Conds))))))) :- SType = inf(_), add_roles([agent-X,theme-L], convenir_de, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Pred]), pos_time(POS, [event(L)], EVs, E-Pred). default_semantics(importer, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(PRP))))), lambda(INF, lambda(_NP, lambda(E, drs(EVs,Conds))))) :- combine_prep_word(PRP, importer, PW), add_roles([theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(suffire, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(PRP))))), lambda(INF, lambda(_NP, lambda(E, drs(EVs,Conds))))) :- combine_prep_word(PRP, suffire, PW), add_roles([theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % =================== % = subject control = % =================== % = destiner + ainf % = viser + ainf % = vouloir + inf % P: type(np) -> type(inf) (inf) % X: type(np) (sujet) % type(np) = (e->t)->t default_semantics(vouloir, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), Sem) :- sem_tv_subject_control(vouloir, POS, Sem). default_semantics(savoir, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(_))))), Sem) :- sem_tv_subject_control(savoir, POS, Sem). % = penser + inf % the subject is not *necessarily* the subject of the infinitive clause here default_semantics(penser, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(PRP))))), Sem) :- combine_prep_word(PRP, penser, PW), sem_tv_subject_control(PW, POS, Sem). % = venir + inf default_semantics(venir, POS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(inf(base))))), Sem) :- sem_tv_subject_control(venir, POS, Sem). % = essayer % =================== % = object control = % =================== % = pousser + ainf + np default_semantics(pousser, POS, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(à))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(Y,appl(NPS,lambda(X,drs(EVs,Conds)))))))))) :- add_roles([agent-X,patient-Y,theme-L], pousser_à, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [event(L)], EVs, E-Pred). % = pousser + ainf (generic object) default_semantics(pousser, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(X,drs(EVs,[appl(generic,Y)|Conds]))))))) :- SType = inf(_), add_roles([agent-X,patient-Y,theme-L], pousser_à, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [variable(Y),event(L)], EVs, E-Pred). % = permettre + deinf default_semantics(permettre, POS, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(X,drs(EVs,[appl(generic,Y)|Conds]))))))) :- SType = inf(_), add_roles([agent-X,patient-Y,theme-L], permettre, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [variable(Y),event(L)], EVs, E-Pred). % = permettre + deinf + pp_a default_semantics(permettre, POS, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(SType)))),lit(pp(PType))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(Y,appl(NPS,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(_), PType = à, add_roles([agent-X,patient-Y,theme-L], permettre, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Pred]), pos_time(POS, [event(L)], EVs, E-Pred). % RAISING + INF % = sembler default_semantics(sembler, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(D0)))), lambda(P,lambda(X,lambda(E,drs(EVs,Conds))))) :- D0 = inf(Prep), combine_prep_word(Prep, sembler, PW), add_roles([theme-L], PW, E, Conds, [drs_label(L,appl(appl(P,X),E))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % = convenir default_semantics(convenir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(D0)))), lambda(P,lambda(X,lambda(E,drs(EVs,Conds))))) :- D0 = inf(Prep), combine_prep_word(Prep, convenir, PW), add_roles([theme-L], PW, E, Conds, [drs_label(L,appl(appl(P,X),E))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % = paraître default_semantics(paraître, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(D0)))), lambda(P,lambda(X,lambda(E,drs(EVs,[appl(event,E)|Conds]))))) :- D0 = inf(_), add_roles([theme-L], paraître, E, Conds, [drs_label(L,appl(appl(P,X),E))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % = aider + ainf + np default_semantics(aider, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(à))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], aider_à, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = convaincre default_semantics(convaincre, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(de))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], convaincre_de, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = contraindre default_semantics(contraindre, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(à))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], contraindre_à, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = persuader + deinf + np default_semantics(persuader, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(de))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], persuader_de, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = demander + deinf + pp_a default_semantics(demander, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(de))))),lit(pp(à))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], demander_à_de, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = demander + deinf + np default_semantics(demander, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(de))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], demander_à_de, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). % = laisser + inf default_semantics(laisser, ver:TIME, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(_))))),lit(np(_,_,_))), lambda(NPO, lambda(DEINF, lambda(NPS, lambda(E, appl(NPO,lambda(X,appl(NPS,lambda(Y,drs(EVs,List)))))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-Y,patient-X,theme-Lab], laisser, E, List, [drs_label(Lab,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Prp,appl(Prp,X))),F)))|Tm]). default_semantics(laisser, ver:TIME, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(DEINF,lambda(NPS,lambda(E,appl(NPS, lambda(X, drs(EVs,List))))))) :- pos_time(ver:TIME, [event(Lab)], EVs, E-Tm), add_roles([agent-X,patient-Y,theme-Lab], laisser, E, List, [drs_label(Lab,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(DEINF,lambda(Prp,appl(Prp,Y))),F)))|Tm]). % voir+np+inf, faire+np+inf % note: the subseteq relation is a bit too strong for "faire", where % the Allen relations E < F, E m F and E o F should be possible as well % eg. in the case of indirectly making someone do something % It is not clear if these cases are truly factive. default_semantics(voir, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))),lit(np(_,_,_))), lambda(NPO, lambda(INF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, voir, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[bool(E,subseteq,F)]),appl(appl(INF,lambda(P,appl(P,X))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(voir, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(INF, lambda(NPO, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, voir, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[bool(E,subseteq,F)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(faire, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))),lit(np(_,_,_))), lambda(NPO, lambda(INF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, voir, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[bool(E,subseteq,F)]),appl(appl(INF,lambda(P,appl(P,X))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(faire, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(INF, lambda(NPO, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, voir, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[bool(E,subseteq,F)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). default_semantics(Word, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))),lit(np(_,_,_))), lambda(NPO, lambda(INF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, Word, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % voir+inf+np, faire+inf+np default_semantics(Word, ver:TIME, dr(0,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(INF, lambda(NPO, lambda(NPS, lambda(E, appl(NPS,lambda(Y,appl(NPO,lambda(X,drs(EVs,Conds)))))))))) :- SType = inf(Prep), combine_prep_word(Prep, Word, PW), add_roles([agent-Y,patient-X,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(INF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % = default case for verbs having an infintive group as an argument; default to subject control default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(s(SType)))), lambda(DEINF, lambda(NPS, lambda(E, appl(NPS,lambda(Y,drs(EVs,Conds))))))) :- SType = inf(Prep), combine_prep_word(Prep, Word, PW), add_roles([agent-Y,theme-L], PW, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(appl(DEINF,lambda(P,appl(P,Y))),F)))|Pred]), pos_time(ver:TIME, [event(L)], EVs, E-Pred). % transitive - sentential complement (factive verbs) default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(_))), lambda(SQ,lambda(NP,lambda(E,presup(merge(drs([event(F)],[]),appl(SQ,F)),appl(NP,lambda(X,drs(EVs, Conds)))))))) :- factive(Word), !, add_roles([agent-X,theme-F], Word, E, Conds, List), pos_time(ver:TIME, [], EVs, E-List). default_semantics(souvenir, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),lit(s(q))), lambda(SQ,lambda(_,lambda(NP,lambda(E,presup(merge(drs([event(F)],[]),appl(SQ,F)),appl(NP,lambda(X,drs(EVs, Conds))))))))) :- add_roles([agent-X,theme-L], se_souvenir, E, Conds, [bool(appl(temps,F),<,appl(temps,E)),drs([],[drs_label(L,appl(SQ,F))])|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(pouvoir, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),lit(s(q))), lambda(SQ,lambda(_CLR,lambda(_SU,lambda(E,drs(EVs, Conds)))))) :- add_roles([theme-L], se_pouvoir, E, Conds, [drs([event(F)],[drs_label(L,appl(SQ,F))])|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(trouver, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),lit(s(q))), lambda(SQ,lambda(_CLR,lambda(_SU,lambda(E,presup(merge(drs([event(F)],[]),appl(SQ,F)),drs(EVs,Conds))))))) :- add_roles([theme-L], se_trouver, E, Conds, [drs([],[drs_label(L,appl(SQ,F))])|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(souvenir, ver:TIME, dr(0,dl(_,lit(cl_r),dl(_,lit(np(_,_,_)),lit(s(_)))),dl(0,lit(np(_,_,_)),lit(s(inf(de))))), lambda(DEINF,lambda(_REFL,lambda(NP,lambda(E,appl(NP,lambda(X,presup(merge(drs([event(F)],[]),appl(appl(DEINF,lambda(Pr,appl(Pr,X))),F)),drs(EVs, Conds))))))))) :- add_roles([agent-X,theme-L], se_souvenir_de, E, Conds, [bool(appl(temps,F),<,appl(temps,E)),drs_label(L,appl(appl(DEINF,lambda(Pr,appl(Pr,X))),F))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). % = transitive - sentential complement (raising: "il semble que ..." etc.) default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lambda(SQ,lambda(_NP,lambda(E,drs(EVs,Conds))))) :- raising_verb(Word), !, add_roles([theme-L], Word, E, Conds, [drs_label(L,appl(SQ,F))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dr(0, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lit(pp(à))), lambda(PPA,lambda(SQ,lambda(_NP,lambda(E,appl(PPA,lambda(X,drs(EVs,Conds)))))))) :- factive(Word), !, combine_prep_word(à, Word, PW), add_roles([patient-X,theme-L], PW, E, Conds, [drs_label(L,appl(SQ,F))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dr(0, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lit(pp(à))), lambda(PPA,lambda(SQ,lambda(_NP,lambda(E,appl(PPA,lambda(X,presup(merge(drs([event(F)],[]),appl(SQ,F)),drs(EVs,Conds))))))))) :- raising_verb(Word), !, combine_prep_word(à, Word, PW), add_roles([patient-X,theme-L], PW, E, Conds, [drs_label(L,appl(SQ,F))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dr(0, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lit(pp(à))), lambda(PPA,lambda(SQ,lambda(_NP,lambda(E,appl(PPA,lambda(X,drs(EVs,Conds)))))))) :- combine_prep_word(à, Word, PW), add_roles([patient-X,theme-L], PW, E, Conds, [drs_label(L,appl(SQ,F))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). default_semantics(falloir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lambda(SQ,lambda(_NP,lambda(E,drs(EVs,Conds))))) :- add_roles([theme-L], il_faut, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). default_semantics(faillir, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lambda(SQ,lambda(_NP,lambda(E,drs(EVs,Conds))))) :- add_roles([theme-L], il_faut, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). % corrects "il faut" as form of "faillir" % = transitive - sentential complement (non-factive verbs, non-raising verbs, such as "croire") default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))), lambda(SQ,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], Word, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(dire, ver:TIME, dr(0,dl(0,lit(cl_r),dl(0,lit(np(_,_,_)),lit(s(_)))),lit(s(q))), lambda(SQ,lambda(_,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,Conds)))))))) :- add_roles([agent-X,theme-L], se_dire, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(_))), lambda(SQ,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], Word, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). % = adverbially used verbs "dit, souligne, déclare, explique, précise, constate, note, rappelle " etc. default_semantics(Word, ver:TIME, dr(0,dl(1,lit(s(STp)),lit(s(STp))),lit(np(_,_,_))), lambda(NP,lambda(SQ,lambda(E,appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], Word, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(F),event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dl(1,lit(s(STp)),dr(0,lit(s(STp)),lit(np(_,_,_)))), lambda(SQ,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], Word, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). % = past participle/infinitive arguments selecting a sentence default_semantics(Word, ver:TIME, dl(1,lit(s(_)),dl(_,lit(np(_,_,_)),lit(s(_)))), lambda(SQ,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,Conds))))))) :- add_roles([agent-X,theme-L], Word, E, Conds, [drs_label(L,merge(drs([event(F)],[]),appl(SQ,F)))|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). % = VP-level adverbs default_semantics(W, adv, dr(_,dr(_,lit(np(N1,N2,N3)),lit(s(ST))),dl(_,lit(np(N1,N2,N3)),lit(s(ST)))), lambda(VP, lambda(NP, lambda(E, merge(drs([],[appl(W,E)]),appl(appl(VP,NP),E)))))). default_semantics(W, adv, dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(ST))),dl(_,lit(np(N1,N2,N3)),lit(s(ST)))), lambda(VP, lambda(NP, lambda(E, merge(drs([],[appl(W,E)]),appl(appl(VP,NP),E)))))). default_semantics(W, adv, dl(_,dl(_,lit(np(N1,N2,N3)),lit(s(ST))),dl(_,lit(np(N1,N2,N3)),lit(s(ST)))), lambda(VP, lambda(NP, lambda(E, merge(drs([],[appl(W,E)]),appl(appl(VP,NP),E)))))). default_semantics(W, adv, dr(0,dl(0,lit(cl(X)),dl(0,lit(np(NA,NB,NC)),lit(s(S1)))),dl(0,lit(cl(X)),dl(0,lit(np(NA,NB,NC)),lit(s(S1))))), lambda(VP, lambda(CL, lambda(NP, lambda(E, merge(drs([],[appl(W,E)]),appl(appl(appl(VP,CL),NP),E))))))). default_semantics(W, adv, dr(0,dl(0,lit(cl_r),dl(0,lit(np(NA,NB,NC)),lit(s(S1)))),dl(0,lit(cl_r),dl(0,lit(np(NA,NB,NC)),lit(s(S1))))), lambda(VP, lambda(CL, lambda(NP, lambda(E, merge(drs([],[appl(W,E)]),appl(appl(appl(VP,CL),NP),E))))))). % = raising verbs with adjectives: sembler, paraître default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Temp),drs([],Conds)))))))) :- raising_verb(Word), add_roles([theme-L], Word, E, Conds, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))]), pos_time(ver:TIME, [event(L)], EVs, E-Temp). default_semantics(Word, ver:TIME, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(PPA))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(PP,lambda(NP,lambda(E,appl(NP,lambda(X,appl(PP,lambda(Y,presup(drs(EVs,Temp),drs([],Conds))))))))))) :- ( PPA == a ; PPA == à ), raising_verb(Word), add_roles([experiencer-Y,patient-X,theme-L], Word, E, Conds, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))]), pos_time(ver:TIME, [event(L)], EVs, E-Temp). % = copula % eg. rendre [gen(x)] heurex % laisse [gen(x)] rêveur default_semantics(laisser, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,drs(EVs,[appl(generic,Y)|List]))))))) :- add_roles([agent-X,patient-Y,theme-L], laisser, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))|Tm]), pos_time(ver:TIME, [event(L),variable(Y)], EVs, E-Tm). default_semantics(rendre, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,drs(EVs,[appl(generic,Y)|List]))))))) :- add_roles([agent-X,patient-Y,theme-L], rendre, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))|Tm]), pos_time(ver:TIME, [event(L),variable(Y)], EVs, E-Tm). % = copula - verb initial and subject inversion %default_semantics(être, ver:pres, dr(_,dr(_,lit(s(_)),dl(0,lit(n),lit(n))), lit(np(nom,_,_))), lambda(NP,lambda(Adj,lambda(E,appl(NP,lambda(X,appl(appl(Adj,lambda(_,drs([],[]))),sub(X,E)))))))). %default_semantics(être, ver:pres, dr(_,dr(_,dl(0,lit(n),lit(n)),lit(s(_))), lit(np(nom,_,_))), lambda(NP,lambda(Adj,lambda(E,appl(NP,lambda(X,appl(appl(Adj,lambda(_,drs([],[]))),sub(X,E)))))))). default_semantics(être, ver:TIME, dr(_,dr(_,lit(s(_)),dl(0,lit(n),lit(n))), lit(np(nom,_,_))), lambda(NP,lambda(Adj,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Pres),merge(drs([variable(Y)],[bool(X,is_at(E),Y)]),appl(appl(Adj,lambda(_,drs([],[]))),Y))))))))) :- pos_time(ver:TIME, [], EVs, E-Pres). default_semantics(être, ver:TIME, dr(_,dl(0,dl(0,lit(n),lit(n)),lit(s(_))), lit(np(nom,_,_))), lambda(NP,lambda(Adj,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Pres),merge(drs([variable(Y)],[bool(X,is_at(E),Y)]),appl(appl(Adj,lambda(_,drs([],[]))),Y))))))))) :- pos_time(ver:TIME, [], EVs, E-Pres). default_semantics(Word, ver:TIME, dr(_,dr(_,lit(s(_)),dl(0,lit(n),lit(n))), lit(np(nom,_,_))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,List))))))) :- get_roles(Word, [np, adj], [SRole, ARole]), add_roles([SRole-X,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))|Tm]), pos_time(ver:TIME, [event(L)], EVs, E-Tm). % = copula - verb second default_semantics(être, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Pres),merge(drs([variable(Y)],[bool(X,is_at(E),Y)]),appl(appl(Adj,lambda(_,drs([],[]))),Y))))))))) :- pos_time(ver:TIME, [], EVs, E-Pres). %default_semantics(être, ver:TNS, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Time),appl(appl(Adj,lambda(_,drs([],[]))),sub(X,E))))))))) :- % pos_time(ver:TNS, [], EVs, E-Time). % "Jean est content que Marie dort." default_semantics(être, ver:TNS, dr(_,dr(0,dl(_,lit(np(_,_,_)),lit(s(_))),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(S,lambda(NP,lambda(E,appl(NP,lambda(X,presup(drs(EVs,Time),merge(merge(drs([event(F)],[]),appl(S,F)),appl(appl(Adj,lambda(_,drs([],[]))),sub(X,E))))))))))) :- pos_time(ver:TNS, [], EVs, E-Time). % "il est vrai/probable que" % TODO: distinguish from "il est content que Marie dort." (above) etc. for this we need % to distinguish anaphoric "il" from expletive pseudo-il default_semantics(être, ver:TNS, dr(_,dr(0,dl(_,lit(np(_,_IL,_)),lit(s(_))),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(S,lambda(_NP,lambda(E,presup(drs(EVs,Time),merge(merge(drs([event(F)],[]),appl(S,F)),appl(appl(Adj,lambda(_,drs([],[]))),sub(F,E))))))))) :- pos_time(ver:TNS, [], EVs, E-Time). default_semantics(Word, ver:TIME, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,drs(EVs,List))))))) :- get_roles(Word, [np, adj], [SRole, ARole]), add_roles([SRole-X,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))|Tm]), pos_time(ver:TIME, [event(L)], EVs, E-Tm). % = verbs taking adjective + np default_semantics(Word, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(OBJ,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,drs(EVs,Conds)))))))))) :- get_roles(Word, [np, np, adj], [SRole, ORole, ARole]), add_roles([SRole-X,ORole-Y,ARole-L], Word, E, Conds, [drs([],[drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))])|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). default_semantics(Word, ver:TIME, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))),lit(np(_,_,_))), lambda(OBJ,lambda(Adj,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,drs(EVs,Conds)))))))))) :- get_roles(Word, [np, np, adj], [SRole, ORole, ARole]), add_roles([SRole-X,ORole-Y,ARole-L], Word, E, Conds, [drs([],[drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))])|List]), pos_time(ver:TIME, [event(L)], EVs, E-List). % = past and present participles used as adjectives default_semantics(W, ver:pper, dl(_,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([event(E),variable(X)],Conds),appl(P,V))))) :- get_roles(W, [np, np], [SubjectRole, ObjectRole]), add_roles([SubjectRole-X,ObjectRole-V], W, E, Conds, []). default_semantics(W, ver:pper, dr(_,dl(_,lit(n),lit(n)),lit(pp(par))), lambda(Q,lambda(P,lambda(V,merge(appl(Q,lambda(Z,drs([event(E)],Conds))),appl(P,V)))))) :- get_roles(W, [np, np], [SubjectRole, ObjectRole]), add_roles([SubjectRole-Z,ObjectRole-V], W, E, Conds, []). default_semantics(W, ver:pper, dr(_,dl(_,lit(n),lit(n)),lit(pp(PRP))), lambda(Q,lambda(P,lambda(V,merge(appl(Q,lambda(Z,drs([event(E),variable(X)],[appl(generic,X)|Conds]))),appl(P,V)))))) :- get_roles(W, [np, np, pp(PRP)], [ArgRole1, ArgRole2, ArgRole3]), combine_prep_word(PRP, W, PW), add_roles([ArgRole1-X,ArgRole2-V,ArgRole3-Z], PW, E, Conds, []). default_semantics(W, ver:pper, dr(_,dr(0,dl(_,lit(n),lit(n)),lit(pp(par))),lit(pp(PRP))), lambda(R,lambda(Q,lambda(P,lambda(V,merge(appl(R,lambda(Z,appl(Q,lambda(X,drs([event(E)],Conds))))),appl(P,V))))))) :- get_roles(W, [np, np, pp(PRP)], [ArgRole1, ArgRole2, ArgRole3]), combine_prep_word(PRP, W, PW), add_roles([ArgRole1-X,ArgRole2-V,ArgRole3-Z], PW, E, Conds, []). default_semantics(W, ver:pper, dr(_,dr(0,dl(_,lit(n),lit(n)),lit(pp(PRP))),lit(pp(par))), lambda(Q,lambda(R,lambda(P,lambda(V,merge(appl(R,lambda(Z,appl(Q,lambda(X,drs([event(E)],Conds))))),appl(P,V))))))) :- get_roles(W, [np, np, pp(PRP)], [ArgRole1, ArgRole2, ArgRole3]), combine_prep_word(PRP, W, PW), add_roles([ArgRole1-X,ArgRole2-V,ArgRole3-Z], PW, E, Conds, []). default_semantics(W, ver:pper, dr(_,dl(_,lit(n),lit(n)),dl(_,lit(n),lit(n))), lambda(A,lambda(P,lambda(V,merge(drs([event(E),variable(X)],[appl(generic,X)|Conds]),appl(P,V)))))) :- get_roles(W, [np, np, adj], [ArgRole1, ArgRole2, ArgRole3]), add_roles([ArgRole1-X,ArgRole2-V,ArgRole3-L], W, E, Conds, [drs_label(L,appl(appl(A,lambda(_,drs([],[]))),V))]). default_semantics(W, ver:ppre, dr(_,dl(_,lit(n),lit(n)),lit(np(_,_,_))), lambda(Q,lambda(P,lambda(V, merge(appl(Q,lambda(Z,drs([event(E),variable(X)],[appl(generic,X)|Conds]))),appl(P,V)))))) :- get_roles(W, [np, np, np], [SubjectRole, ObjectRole, Arg]), add_roles([SubjectRole-X,ObjectRole-V,Arg-Z], W, E, Conds, []). default_semantics(venir, ver:pper, dr(_,dl(_,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(base))))), lambda(INF, lambda(N, lambda(X, merge(appl(N,X),drs([event(E),event(F),event(L)],Conds)))))) :- add_roles([agent-X,theme-L], venir, E, Conds, [drs_label(L,appl(appl(INF,lambda(P1,appl(P1,X))),F))]). default_semantics(passer, ver:pper, dr(_,dl(_,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(base))))), lambda(INF, lambda(N, lambda(X, merge(appl(N,X),drs([event(E),event(F),event(L)],Conds)))))) :- add_roles([agent-X,theme-L], passer, E, Conds, [drs_label(L,appl(appl(INF,lambda(P1,appl(P1,X))),F))]). default_semantics(V, ver:pper, dr(_,dl(_,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(IPP))))), lambda(INF, lambda(N, lambda(X, merge(appl(N,X),drs([event(E),event(F),event(L),variable(Y)],[appl(generic,Y)|Conds])))))) :- get_roles(V, [np, np, inf(IPP)], [ARole1,ARole2,ARole3]), add_roles([ARole1-Y,ARole2-X,ARole3-L], V, E, Conds, [drs_label(L,appl(appl(INF,lambda(P1,appl(P1,X))),F))]). % = inversed verb forms default_semantics(Word, ver:TIME, dr(0, dr(0,lit(s(S1)), lit(np(A,B,C))), dl(0,lit(np(D,E,F)), lit(s(S2)))), Sem) :- default_semantics(Word, ver:TIME, dr(0, dl(0, lit(np(A,B,C)), lit(s(S1))), dl(0, lit(np(D,E,F)), lit(s(S2)))), Sem). % = prepositions - arguments default_semantics(Word, prp, dr(_,lit(pp(PRP)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[]),appl(P,X)),appl(Q,X))))) :- ( var(PRP) -> PRP = Word ; true ). default_semantics(Word, prp, dr(_,lit(pp(PRP)),lit(np(_,_,_))), lambda(X,X)) :- ( var(PRP) -> PRP = Word ; true ). default_semantics(Word, prp:det, dr(_,lit(pp(PRP)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[]),appl(P,X)),appl(Q,X))))) :- ( var(PRP) -> PRP = Word ; true ). % de NUM à NUM NOM %default_semantics(Word, nam, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[appl(appl(nommé,Word),X)]),appl(P,X)))). % "de X à " %default_semantics('à', prp, dr(0,dl(0,dr(0,lit(np(_,_,_)),n),dl(0,dr(0,pp_de,lit(np(_,_,_))),dr(0,pp_a,n))),dr(0,lit(np(_,_,_)),n)), lambda(P,lambda(Q,lambda(_,lambda(X, lambda(R,XXXX)))))). default_semantics(_, pun, dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). default_semantics(_, pun, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),appl(N,X)))))))). default_semantics(_, pun, dr(0,dl(0,lit(s(Z)),lit(s(Z))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[appl(appl(narration,F),E)]),merge(appl(P,E),appl(Q,F))))))). default_semantics(_, pun, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(N,lambda(E,merge(merge(drs([],[]),appl(appl(Q,N),E)),appl(appl(P,N),_))))))). default_semantics(_, pun, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(P,lambda(Q,lambda(X,merge(appl(P,X),appl(Q,X)))))). default_semantics(_, pun, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,lambda(X,appl(P,X))),appl(NP1,lambda(Y,appl(P,Y)))))))). default_semantics(_, pun, dr(0,dl(0,lit(pp(_)),lit(pp(_))),lit(pp(_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,lambda(X,appl(P,X))),appl(NP1,lambda(Y,appl(P,Y)))))))). default_semantics(_, pun:cit, dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). default_semantics(_, pun:cit, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),appl(N,X)))))))). default_semantics(_, pun:cit, dr(0,dl(0,lit(s(Z)),lit(s(Z))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[appl(appl(narration,F),E)]),merge(appl(P,E),appl(Q,F))))))). default_semantics(_, pun:cit, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(N,lambda(E,merge(merge(drs([],[]),appl(appl(Q,N),E)),appl(appl(P,N),_))))))). default_semantics(_, pun:cit, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(P,lambda(Q,lambda(X,merge(appl(P,X),appl(Q,X)))))). default_semantics(_, pun:cit, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,lambda(X,appl(P,X))),appl(NP1,lambda(Y,appl(P,Y)))))))). default_semantics(_, pun:cit, dr(0,dl(0,lit(pp(_)),lit(pp(_))),lit(pp(_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,lambda(X,appl(P,X))),appl(NP1,lambda(Y,appl(P,Y)))))))). % = adjective % = adjectives which are subsective % = subsective prefixed adjectives % NOTE: a *subsective* adjective is one such that the interpretation of "A N" is a % a subset of the interpretation of "N", eg. "grand président" is a subset of % "président" (but not equal to "président(X) & grand(X)" as an intersective % adjective) unlike "ancien président". % Subsective is the default (intersective is the default for postfixed adjectives). % For the nonsubsective cases, we list them separately: we distinguish two more % case "privative" and (simple) "nonsubsective". % = privative adjectives % NOTE: a *privative* adjective is one such that the interpretation of "A N" % implies that the interpretation of "N" does *not* hold, eg. "faux billet" % "emploi fictif" (not everyone agrees that such a class actually exists % and maybe we should simply treat these as non-subsective adjectives) default_semantics(W, adj, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_privative_adjective(W). default_semantics(W, ver:ppre, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_privative_adjective(W). default_semantics(W, ver:pper, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_privative_adjective(W). default_semantics(W, adj, dl(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- postfixed_privative_adjective(W). default_semantics(W, ver:ppre, dl(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- postfixed_privative_adjective(W). default_semantics(W, ver:pper, dl(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(W,S)])))) :- postfixed_privative_adjective(W). % = non-subsective prefixed adjectives default_semantics(W, adj, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_nonsubsective_adjective(W). default_semantics(W, ver:ppre, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_nonsubsective_adjective(W). default_semantics(W, ver:pper, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)])))) :- prefixed_nonsubsective_adjective(W). % = default to subsective default_semantics(W, adj, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))). default_semantics(W, ver:ppre, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))). default_semantics(W, ver:pper, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))). % = subsective postfixed (eg. "grand") %default_semantics(W, adj, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). %default_semantics(W, ver:ppre, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). %default_semantics(W, ver:pper, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). %default_semantics(W, adj, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). %default_semantics(W, ver:ppre, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). %default_semantics(W, ver:pper, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([event(S)],[drs_label(S,appl(P,X)),appl(W,S)]))))) :- % postfixed_subsective_adjective(W). % relativizers default_semantics(auquel, pro:rel, dr(0, dl(0, lit(n), lit(n)), dr(0,lit(s(_)),dia(1,box(1,lit(pp(Prp)))))), lambda(VP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(appl(VP,lambda(Q,appl(Q,X))),E),appl(N,X))))))) :- ( Prp == à ; Prp == a ). default_semantics(auquel, pro:rel, dr(0, dl(0, lit(n), lit(n)), lit(s(_))), lambda(S, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(S,E),merge(appl(N,X),drs([],[appl(appl(à,X),E)])))))))). default_semantics(auxquels, pro:rel, dr(0, dl(0, lit(n), lit(n)), dr(0,lit(s(_)),dia(1,box(1,lit(pp(Prp)))))), lambda(VP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(appl(VP,lambda(Q,appl(Q,X))),E),appl(N,X))))))) :- ( Prp == à ; Prp == a ). default_semantics(auxquels, pro:rel, dr(0, dl(0, lit(n), lit(n)), lit(s(_))), lambda(S, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(S,E),merge(appl(N,X),drs([],[appl(appl(à,X),E)])))))))). default_semantics(auxquelles, pro:rel, dr(0, dl(0, lit(n), lit(n)), dr(0,lit(s(_)),dia(1,box(1,lit(pp(Prp)))))), lambda(VP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(appl(VP,lambda(Q,appl(Q,X))),E),appl(N,X))))))) :- ( Prp == à ; Prp == a ). default_semantics(auxquelles, pro:rel, dr(0, dl(0, lit(n), lit(n)), lit(s(_))), lambda(S, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(S,E),merge(appl(N,X),drs([],[appl(appl(à,X),E)])))))))). default_semantics(lequel, pro:rel, dr(0, dl(0, dr(0, lit(pp(Prp)), lit(np(_,_,_))), dl(0, lit(n), lit(n))), dr(0,lit(s(_)),dia(1,box(1,lit(pp(Prp)))))), lambda(VP, lambda(_PP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(appl(VP,lambda(Q,appl(Q,X))),E),appl(N,X)))))))). default_semantics(lequel, pro:rel, dr(0, dl(0, dr(0, lit(pp(Prp)), lit(np(_,_,_))), dl(0, lit(n), lit(n))), lit(s(_))), lambda(S, lambda(_PP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(S,E),merge(appl(N,X),drs([],[Term]))))))))) :- ( var(Prp) -> /* default, make sure this doesn't occur ! */ Term = appl(appl(prep,X),E) ; Term = appl(appl(Prp,X),E) ). % ===================================== % = Default semantics without POS tag = % ===================================== default_semantics(_, let, drs([],[])). default_semantics(alors, dr(0,dl(_,lit(s(Z)),lit(s(Z))),lit(s(q))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). default_semantics(alors, dr(0,dr(0,lit(s(Z)),lit(s(Z))),lit(s(q))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). default_semantics(tandis, dr(0,dl(_,lit(s(Z)),lit(s(Z))),lit(s(q))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). default_semantics(tandis, dr(0,dr(0,lit(s(Z)),lit(s(Z))),lit(s(q))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). default_semantics(et, dr(0,dl(0,dr(0,lit(s(_)),dia(1,box(1,X))),dr(0,lit(s(_)),box(1,dia(1,X)))),dr(0,lit(s(_)),dia(1,box(1,X)))), lambda(P2,lambda(P1,lambda(V,lambda(E,merge(appl(appl(P1,V),E),merge(drs([event(E2)],[]),appl(appl(P2,V),E2)))))))). default_semantics(W, dl(1,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), lambda(Adj, lambda(P,lambda(V,merge(appl(appl(Adj,P),V),drs([event(E)],[appl(W,E),bool(E,=,'event?')])))))). default_semantics(W, dr(0,dl(1,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),lit(pp(Prp))), lambda(PP,lambda(Adj, lambda(P,lambda(V,merge(appl(appl(Adj,P),V),appl(PP,lambda(X,drs([event(E)],[appl(appl(PW,X),E),bool(E,=,'event?')]))))))))) :- combine_prep_word(Prp, W, PW). default_semantics(W, dr(0,dl(1,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),lit(np(_,_,_))), lambda(NP,lambda(Adj, lambda(P,lambda(V,merge(appl(appl(Adj,P),V),appl(NP,lambda(X,drs([event(E)],[appl(appl(W,X),E),bool(E,=,'event?')]))))))))). default_semantics(W, dr(0,dl(1,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),lit(n)), lambda(N,lambda(Adj, lambda(P,lambda(V,merge(appl(appl(Adj,P),V),merge(merge(drs([variable(X)],[]),appl(N,X)),drs([event(E)],[appl(appl(W,X),E),bool(E,=,'event?')])))))))). default_semantics(a, dr(0,dl(0,lit(cl_y),dl(0,lit(np(nom,il,3-s)),dl(1,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))))),lit(np(_,_,_))), lambda(NP,lambda(_Y,lambda(_IL,lambda(Adj, lambda(P,lambda(V,merge(appl(appl(Adj,P),V),appl(NP,lambda(X,drs([event(E)],[appl(appl(il_y_a,X),E),bool(E,=,'event?')]))))))))))). % = adjective + ainf % "susceptible de ..." default_semantics(W, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(PRP))))), lambda(AINF,lambda(N,lambda(X,merge(appl(N,X),drs([event(Th)],[appl(appl(PW,Th),X),drs_label(Th,merge(drs([event(E)],[]),appl(appl(AINF,lambda(P,appl(P,X))),E)))])))))) :- combine_prep_word(PRP, W, PW). % "tough" constructions, eg. "facile à lire" default_semantics(W, dr(0,dl(0,lit(n),lit(n)),dr(0,dl(0,lit(np(_,_,_)),lit(s(inf(PRP)))),dia(1,box(1,lit(np(_,_,_)))))), lambda(TV, lambda(N, lambda(X, merge(appl(N,X)),drs([event(L),variable(Y)],[generic(Y),appl(appl(PW,L),X),drs_label(L,merge(drs([event(E)],[]),appl(appl(appl(TV,lambda(P1,appl(P1,X))),lambda(P2,appl(P2,Y))),E)))]))))) :- combine_prep_word(PRP, W, PW). % = intransitive default_semantics(Word, dl(_,lit(np(_,_,_)),lit(s(_))), lambda(NPS,lambda(E,appl(NPS,lambda(X,drs([],Conds)))))) :- get_roles(Word, [np], [SRole]), add_roles([SRole-X], Word, E, Conds, []). % = intransitive - verb initial default_semantics(Word, dr(_,lit(s(_)),lit(np(_,_,_))), lambda(NPS,lambda(E,appl(NPS,lambda(X,drs([],Conds)))))) :- get_roles(Word, [np], [SRole]), add_roles([SRole-X], Word, E, Conds, []). % = transitive - SVO default_semantics(Word, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))), lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs([],Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, []). % = transitive - verb initial default_semantics(Word, dr(_,dr(_,lit(s(_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NPS,lambda(NPO,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs([],Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, []). % = transitive - verb final default_semantics(Word, dl(_,lit(np(_,_,_)),dl(_,lit(np(_,_,_)),lit(s(_)))), lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,drs([],Conds))))))))) :- get_roles(Word, [np,np], [SRole,ORole]), add_roles([SRole-X,ORole-Y], Word, E, Conds, []). % = ditransitive default_semantics(Word, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),lit(np(_,_,_))), lambda(P, lambda(Q, lambda(R, lambda(E, appl(R,lambda(X,appl(Q,lambda(Y,appl(P,lambda(Z,drs([],Conds)))))))))))) :- get_roles(Word, [np,np,np], [SRole,ORole,IRole]), add_roles([SRole-X,ORole-Y,IRole-Z], Word, E, Conds, []). % = ditransitive + (np + pp) default_semantics(Word, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(Prep))),lit(np(_,_,_))), lambda(P, lambda(Q, lambda(R, lambda(E, appl(R,lambda(X,appl(Q,lambda(Y,appl(P,lambda(Z,drs([],Conds)))))))))))) :- get_roles(Word, [np,np,pp(Prep)], [SRole,ORole,PRole]), combine_prep_word(Prep, Word, PrepWord), add_roles([SRole-X,ORole-Y,PRole-Z], PrepWord, E, Conds, []). % = ditransitive + (np + pp) verb-initial default_semantics(Word, dr(_,dr(_,dr(_,lit(s(_)),lit(pp(Prep))),lit(np(_,_,_))),lit(np(_,_,_))), lambda(R, lambda(Q, lambda(P, lambda(E, appl(R,lambda(X,appl(Q,lambda(Y,appl(P,lambda(Z,drs([],Conds)))))))))))) :- get_roles(Word, [np,np,pp(Prep)], [SRole,ORole,PRole]), combine_prep_word(Prep, Word, PrepWord), add_roles([SRole-X,ORole-Y,PRole-Z], PrepWord, E, Conds, []). % = transitive + pp default_semantics(Word, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(pp(Prep))), lambda(PP,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(PP,lambda(Y,drs([],Conds))))))))) :- get_roles(Word, [np,pp(Prep)], [SRole,PRole]), combine_prep_word(Prep, Word, PrepWord), add_roles([SRole-X,PRole-Y], PrepWord, E, Conds, []). % = transitive + prep + np % assume POS-tagger error and use the VER:pres tag to calculate the semantics default_semantics(Word, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(pp(Prep)))),lit(np(_,_,_))), Sem) :- default_semantics(Word, ver:pres, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(_,lit(np(_,_,_)),lit(pp(Prep)))),lit(np(_,_,_))), Sem). % = prepositions - noun modifiers default_semantics(W, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, merge(appl(N2,X),merge(drs([variable(Y)],[appl(appl(W,Y),X)]),appl(N1,Y))))))). default_semantics(W, dr(0,dl(0,lit(n),lit(n)),lit(np(_,_,_))), lambda(NP, lambda(N, lambda(X, merge(appl(N,X),appl(NP,lambda(Y,drs([],[appl(appl(W,Y),X)])))))))). default_semantics(W, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))),lambda(P,lambda(Q,lambda(Z,appl(Q,lambda(Y,appl(P,lambda(X,merge(drs([],[appl(appl(W,X),Y)]),appl(Z,Y)))))))))). default_semantics(W, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)),lambda(P,lambda(NP,lambda(Q,appl(NP,lambda(Y,merge(drs([variable(X)],[appl(appl(W,X),Y)]),merge(appl(Q,X),appl(P,X))))))))). % = prepositions - noun modifiers having preposition as argument (eg. "deux d'entre nous") default_semantics(W, dr(0,dl(0,lit(n),lit(n)),lit(pp(Prp))), lambda(NP, lambda(N, lambda(X, merge(appl(NP,lambda(Y,drs([],[appl(appl(Functor,Y),X)]))),appl(N,X)))))) :- combine_prep_word(Prp, W, Functor). default_semantics(W, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(pp(Prp))),lambda(P,lambda(Q,lambda(Z,merge(appl(P,lambda(X,appl(Q,lambda(Y,drs([],[appl(appl(Functor,X),Y)]))))),appl(Z,X)))))) :- combine_prep_word(Prp, W, Functor). % idiom: "à travers" % TODO: this is a bit of a hack, change this to a true multi-word expression default_semantics('A', dr(0,dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(np(_,_,_))),lit(n)), lambda(_N,lambda(NP,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(Y,drs([],[appl(appl(à_travers,Y),E)]))))))))). default_semantics('À', dr(0,dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(np(_,_,_))),lit(n)), lambda(_N,lambda(NP,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(Y,drs([],[appl(appl(à_travers,Y),E)]))))))))). default_semantics(à, dr(0,dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(np(_,_,_))),lit(n)), lambda(_N,lambda(NP,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(Y,drs([],[appl(appl(à_travers,Y),E)]))))))))). default_semantics(à, dr(0,dr(0,dl(1,lit(s(SS)),lit(s(SS))),lit(np(_,_,_))),lit(n)), lambda(_N,lambda(NP,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(Y,drs([],[appl(appl(à_travers,Y),E)]))))))))). % NP modifiers default_semantics(monsieur, dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(monsieur, Sem). default_semantics('Monsieur', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(monsieur, Sem). default_semantics('M', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(monsieur, Sem). default_semantics('M.', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(monsieur, Sem). default_semantics(madame, dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(madame, Sem). default_semantics('Madame', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(madame, Sem). default_semantics('Mme', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(madame, Sem). default_semantics('Mme.', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics(madame, Sem). default_semantics('maître', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics('maître', Sem). default_semantics('Maître', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics('maître', Sem). default_semantics('Me', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics('maître', Sem). default_semantics('Me.', dr(_,lit(np(_,_,_)),lit(np(_,_,_))), Sem) :- title_semantics('maître', Sem). default_semantics(W, dr(_,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(W,X)]))))))). default_semantics(W, dl(_,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(W,X)]))))))). % = prepositions - arguments default_semantics(Word, dr(_,lit(pp(PRP)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[]),appl(P,X)),appl(Q,X))))) :- ( var(PRP) -> PRP = Word ; true ). default_semantics(Word, dr(_,lit(pp(PRP)),lit(np(_,_,_))), lambda(X,X)) :- ( var(PRP) -> PRP = Word ; true ). % = noun phrases - except for names default_semantics(Word, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[appl(Word,X)]),appl(P,X)))). % = nouns default_semantics(W, lit(n), lambda(X,drs([],[appl(W,X)]))). % = adjective % = postfixed adjective is intersective default_semantics(Word, dl(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[appl(Word,V)]),appl(P,V))))). default_semantics(Word, dr(0,lit(n),lit(n)), lambda(P,lambda(V, merge(drs([],[appl(Word,V)]),appl(P,V))))). % = adjective + preposition "inférieur à", etc. default_semantics(Word, dr(0,dl(0,lit(n),lit(n)),lit(pp(Prep))), lambda(Prp,lambda(N,lambda(X,merge(appl(N,X),appl(Prp,lambda(Y,drs([],[appl(appl(PrepWord,Y),X)])))))))) :- combine_prep_word(Prep, Word, PrepWord). % = adverb + preposition "lors de", etc. default_semantics(Word, dr(0,dl(1,lit(s(X)),lit(s(X))),lit(pp(Prep))), lambda(Prp,lambda(S,lambda(E,merge(appl(S,E),appl(Prp,lambda(Y,drs([],[appl(appl(PrepWord,Y),E)])))))))) :- combine_prep_word(Prep, Word, PrepWord). default_semantics(Word, dr(0,dr(0,lit(s(X)),lit(s(X))),lit(pp(Prep))), lambda(Prp,lambda(S,lambda(E,merge(appl(S,E),appl(Prp,lambda(Y,drs([],[appl(appl(PrepWord,Y),E)])))))))) :- combine_prep_word(Prep, Word, PrepWord). % = intensifiers default_semantics(Word, dr(_,dr(_,lit(n),lit(n)),dr(_,lit(n),lit(n))), Sem) :- intensifier_semantics(Word, Sem). default_semantics(Word, dr(_,dl(_,lit(n),lit(n)),dl(_,lit(n),lit(n))), Sem) :- intensifier_semantics(Word, Sem). % = adverb intensifier default_semantics(Word, dr(0,dl(1,lit(s(ST)),lit(s(ST))),dl(1,lit(s(ST)),lit(s(ST)))), lambda(Adv, lambda(S, lambda(E, merge(appl(S,E),drs([event(Lab)], [appl(appl(Word,Lab),E),drs_label(Lab,appl(appl(Adv,lambda(_,drs([],[]))),E))])))))). default_semantics(Word, dr(0,dr(0,lit(s(ST)),lit(s(ST))),dr(0,lit(s(ST)),lit(s(ST)))), lambda(Adv, lambda(S, lambda(E, merge(appl(S,E),drs([event(Lab)], [appl(appl(Word,Lab),E),drs_label(Lab,appl(appl(Adv,lambda(_,drs([],[]))),E))])))))). % this is not entirely right, but hard to do differently given the choice to make an argument pp essentially vacuous semantically default_semantics(Word, dr(0,lit(pp(P)),lit(pp(P))), lambda(PP, lambda(Q, appl(PP,lambda(X,merge(appl(PP,Q),drs([],[appl(Word,X)]))))))). default_semantics(Word, dr(0,dr(0,lit(pp(P)),lit(pp(P))),lit(n)), lambda(N, lambda(PP, lambda(Q, appl(PP,lambda(X,merge(appl(PP,Q),merge(drs([variable(Y)],[appl(appl(Word,X),Y)]),appl(N,Y))))))))). % = generic determiner type (used for example for adjectives in noun phrases without determiner) default_semantics(W, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[appl(W,X)]),appl(P,X)),appl(Q,X))))). % = adverbs - sentence modifiers default_semantics(maintenant, dl(1,lit(s(ST)),lit(s(ST))), lambda(P,lambda(E,merge(appl(P,E),drs([],[bool(appl(temps,E),overlaps,maintenant)]))))). default_semantics(W, dl(1,lit(s(ST)),lit(s(ST))), lambda(P,lambda(E,merge(appl(P,E),drs([],[bool(appl(temps,E),subseteq,W)]))))) :- temporal_adverb(W), !. default_semantics(W, dl(1,lit(s(ST)),lit(s(ST))), lambda(P,lambda(E,merge(appl(P,E),drs([],[appl(W,E)]))))). default_semantics(W, dr(0,lit(s(ST)),lit(s(ST))), lambda(P,lambda(E,merge(appl(P,E),drs([],[appl(W,E)]))))). % = adverbs - infinitives with "à", "de", "par" and "pour" default_semantics('d\'', dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(SS))),dl(_,lit(np(N1,N2,N3)),lit(s(inf(_))))), lambda(X,X)) :- SS = inf(de). default_semantics(de, dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(SS))),dl(_,lit(np(N1,N2,N3)),lit(s(inf(_))))), lambda(X,X)) :- SS = inf(de). default_semantics(à, dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(SS))),dl(_,lit(np(N1,N2,N3)),lit(s(inf(_))))), lambda(X,X)) :- SS = inf(à). default_semantics(pour, dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(SS))),dl(_,lit(np(N1,N2,N3)),lit(s(inf(_))))), lambda(X,X)) :- SS = inf(pour). default_semantics(par, dr(_,dl(_,lit(np(N1,N2,N3)),lit(s(SS))),dl(_,lit(np(N1,N2,N3)),lit(s(inf(_))))), lambda(X,X)) :- SS = inf(par). % infinitives with "à" and "de" used as adjectives default_semantics(de, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(N,lambda(X,merge(appl(N,X),drs([event(Lab)],[appl(appl(de,Lab),X),drs_label(Lab,merge(drs([event(E),variable(Y)],[appl(generic,Y)]),appl(appl(VP,lambda(P,appl(P,Y))),E)))])))))). default_semantics('d\'', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(N,lambda(X,merge(appl(N,X),drs([event(Lab)],[appl(appl(de,Lab),X),drs_label(Lab,merge(drs([event(E),variable(Y)],[appl(generic,Y)]),appl(appl(VP,lambda(P,appl(P,Y))),E)))])))))). default_semantics(à, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(N,lambda(X,merge(appl(N,X),drs([event(Lab)],[appl(appl(à,Lab),X),drs_label(Lab,merge(drs([event(E),variable(Y)],[appl(generic,Y)]),appl(appl(VP,lambda(P,appl(P,Y))),E)))])))))). % = copula - verb initial default_semantics(Word, dr(_,dr(_,lit(s(_)),dl(0,lit(n),lit(n))), np), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,drs([event(L)],List))))))) :- get_roles(Word, [np, adj], [SRole, ARole]), add_roles([SRole-X,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))]). % = copula - verb second default_semantics(Word, dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(NP,lambda(E,appl(NP,lambda(X,drs([event(L)],List))))))) :- get_roles(Word, [np, adj], [SRole, ARole]), add_roles([SRole-X,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),X))]). default_semantics(Word, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(OBJ,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,drs([event(L)],List)))))))))) :- get_roles(Word, [np, np, adj], [SRole, ORole, ARole]), add_roles([SRole-X,ORole-Y,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))]). default_semantics(Word, dr(_,dr(_,dl(_,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))),lit(np(_,_,_))), lambda(OBJ,lambda(Adj,lambda(SUJ,lambda(E,appl(SUJ,lambda(X,appl(OBJ,lambda(Y,drs([event(L)],List)))))))))) :- get_roles(Word, [np, np, adj], [SRole, ORole, ARole]), add_roles([SRole-X,ORole-Y,ARole-L], Word, E, List, [drs_label(L,appl(appl(Adj,lambda(_,drs([],[]))),Y))]). default_semantics(de, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([event(L)],[appl(appl(de,L),X),drs_label(L,appl(appl(VP,lambda(P,appl(P,_))),_))])))))))). default_semantics('d\'', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([event(L)],[appl(appl(de,L),X),drs_label(L,appl(appl(VP,lambda(P,appl(P,_))),_))])))))))). default_semantics(à, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),lit(s(inf(_))))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([event(L)],[appl(appl(de,L),X),drs_label(L,appl(appl(VP,lambda(P,appl(P,_))),_))])))))))). % = adverbial prepositions default_semantics(W, dr(0,dl(_,lit(s(ST)),lit(s(ST))),lit(n)), lambda(N,lambda(S,lambda(E,merge(merge(drs([variable(X)],[appl(appl(W,X),E)]),appl(N,X)),appl(S,E)))))). default_semantics(W, dr(0,dr(_,lit(s(ST)),lit(s(ST))),lit(n)), lambda(N,lambda(S,lambda(E,merge(merge(drs([variable(X)],[appl(appl(W,X),E)]),appl(N,X)),appl(S,E)))))). default_semantics(W, dr(0,dl(_,lit(s(ST)),lit(s(ST))),lit(np(acc,_,_))), lambda(NP,lambda(S,lambda(E,merge(appl(NP,lambda(X,drs([],[appl(appl(W,X),E)]))),appl(S,E)))))). default_semantics(W, dr(0,dr(_,lit(s(ST)),lit(s(ST))),lit(np(acc,_,_))), lambda(NP,lambda(S,lambda(E,merge(appl(NP,lambda(X,drs([],[appl(appl(W,X),E)]))),appl(S,E)))))). default_semantics(W, dr(0,dl(_,dl(0,lit(np(A,B,C)),lit(s(ST))),dl(0,lit(np(A,B,C)),lit(s(ST)))),lit(np(acc,_,_))), lambda(NPO,lambda(VP,lambda(NP,lambda(E,merge(appl(NPO,lambda(X,drs([],[appl(appl(W,X),E)]))),appl(appl(VP,NP),E))))))). default_semantics(W, dr(0,dr(_,dl(0,lit(np(A,B,C)),lit(s(ST))),dl(0,lit(np(A,B,C)),lit(s(ST)))),lit(np(acc,_,_))), lambda(NPO,lambda(VP,lambda(NP,lambda(E,merge(appl(NPO,lambda(X,drs([],[appl(appl(W,X),E)]))),appl(appl(VP,NP),E))))))). % "beaucoup de" etc. n/pp default_semantics(Word, dr(0,lit(n),lit(pp(PRP))), lambda(PP, lambda(_,appl(PP,lambda(X,drs([],[appl(PW,X)])))))) :- combine_prep_word(PRP, Word, PW). % "beaucoup de" etc. np/pp default_semantics(Word, dr(0,lit(np(_,_,_)),lit(pp(PRP))), lambda(PP,lambda(P,appl(PP,lambda(X,merge(appl(P,X),drs([],[appl(PW,X)]))))))) :- combine_prep_word(PRP, Word, PW). default_semantics(Word, dr(0,lit(cs),lit(s(_))), Sem) :- Word \== que, Word \== 'qu\'', Sem = lambda(S,lambda(E,merge(drs([],[appl(Word,E)]),appl(S,E)))). default_semantics(Word, lit(s(_)), lambda(E,drs([],[appl(Word,E)]))). % ============================================================ % Lexicon % ============================================================ % de X a Y lex('Est', n, lambda(X,drs([],[appl('Est',X)]))). % explicitly added to correct stemmer errors ("est" as form of "etre) lex('Nord', n, lambda(X,drs([],[appl('Nord',X)]))). lex('Sud', n, lambda(X,drs([],[appl('Sud',X)]))). lex('Ouest', n, lambda(X,drs([],[appl('Ouest',X)]))). lex(à, dr(0,dl(0,pp_de,dl(0,n,n)),np), lambda(NP, lambda(PP, lambda(N, lambda(X, appl(PP,lambda(Z,appl(NP,lambda(Y,merge(appl(N,X),drs([],[appl(appl(start,Y),X),appl(appl(end,Z),X)]))))))))))). lex(autour, dr(0,pp_a,pp_de), lambda(PP,lambda(P,appl(PP,lambda(X,merge(drs([variable(Y)],[appl(appl(autour_de,Y),X)]),appl(P,Y))))))). lex('au-dessus', dr(0,pp_a,pp_de), lambda(PP,lambda(P,appl(PP,lambda(X,merge(drs([variable(Y)],[appl(appl(au_dessus_de,Y),X)]),appl(P,Y))))))). lex('au-delà', dr(0,pp_a,pp_de), lambda(PP,lambda(P,appl(PP,lambda(X,merge(drs([variable(Y)],[appl(appl(au_delà_de,Y),X)]),appl(P,Y))))))). lex(plutôt, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(drs([event(L),event(F)],[drs_label(L,appl(S1,F)),appl(appl(plutôt_que,F),E)]),appl(S2,E)))))). % "y compris" lex(compris, dr(0,dl(0,cl_y,dl(1,s,s)),dl(1,s,s)), lambda(SS,lambda(_,lambda(S,lambda(E,merge(merge(drs([event(F)],[]),appl(appl(SS,lambda(_,drs([],[bool(F,subseteq,E)]))),F)),appl(S,E))))))). % "tout" is "tout en VPR" constructions is considered semantically vacuous (admittedly a simplification, but hard to do better!) lex(tout, dr(0,dl(0,dl(0,np,s),dl(0,np,s)),dl(0,dl(0,np,s),dl(0,np,s))), lambda(X,X)). lex(tout, dr(0,dl(0,dr(0,s,np),dr(0,s,np)),dl(0,dr(0,s,np),dr(0,s,np))), lambda(X,X)). lex(tout, dr(0,dr(0,dl(0,np,s),dl(0,np,s)),dr(0,dl(0,np,s),dl(0,np,s))), lambda(X,X)). lex(avoir, dr(0,dl(0,lit(np(A1,A2,A3)),lit(s(II))),dl(0,lit(np(A1,A2,A3)),lit(s(PP)))), lambda(PPART,lambda(NP,lambda(E, appl(NP,lambda(X,merge(drs([event(F)],[bool(appl(temps,F),<,appl(temps,E))]),appl(appl(PPART,lambda(Prp,appl(Prp,X))),F)))))))) :- II == inf, PP == ppart. lex(en_une_heure, dl(1,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(sub(mésure,heure),appl(temps,E)),=,1)]))))). lex(pendant_une_heure, dl(1,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(sub(mésure,heure),appl(temps,E)),=,1)]))))). lex(le_soir, dr(0,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,soir)]))))). lex(le_31, dr(0,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,appl(jour,31))]))))). lex(a_six_heures_du_matin, dl(1,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[bool(appl(temps,E),overlaps,'06:00')]))))). lex(dans_dix_minutes, dr(0,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[drs([event(E1)],[bool(maintenant,abuts,E1),bool(E1,abuts,E),bool(appl(sub(mésure,minutes),E1),=,10)])]))))). lex(dans_dix_minutes, dl(1,lit(s(SX)),lit(s(SX))), lambda(S,lambda(E,merge(appl(S,E),drs([],[drs([event(E1)],[bool(maintenant,abuts,E1),bool(E1,abuts,E),bool(appl(sub(mésure,minutes),E1),=,10)])]))))). lex(unique, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,neq,X)]),appl(P,Y)))]))))). lex(unique, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,neg,X)]),appl(P,Y)))]))))). lex(que, dr(0,lit(np(A,B,C)),lit(np(A,B,C))), lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'context?'),bool(num(Y),>,1),bool(X,atomic_sub,Y),bool(drs([variable(Z)],[bool(Z,atomic_sub,Y),bool(Z,neq,X)]),->,drs([],[not(appl(P,Z))]))]))))))). lex('qu\'', dr(0,lit(np(A,B,C)),lit(np(A,B,C))), lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'context?'),bool(num(Y),>,1),bool(X,atomic_sub,Y),bool(drs([variable(Z)],[bool(Z,atomic_sub,Y),bool(Z,neq,X)]),->,drs([],[not(appl(P,Z))]))]))))))). lex(que, dr(0,dl(0,np,s),dl(0,np,s)),lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P1,appl(P1,X))),E),drs([event(F)],[bool(F,=,'context?'),bool(num(F),>,1),bool(E,atomic_sub,F),bool(drs([variable(G)],[bool(G,atomic_sub,F),bool(G,neq,E)]),->,drs([],[not(appl(appl(VP,lambda(P1,appl(P1,X))),G))]))])))))))). lex('qu\'', dr(0,dl(0,np,s),dl(0,np,s)),lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P1,appl(P1,X))),E),drs([event(F)],[bool(F,=,'context?'),bool(num(F),>,1),bool(E,atomic_sub,F),bool(drs([variable(G)],[bool(G,atomic_sub,F),bool(G,neq,E)]),->,drs([],[not(appl(appl(VP,lambda(P1,appl(P1,X))),G))]))])))))))). lex('Rien', lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[]),->,drs([],[not(appl(Q,X))]))]))). lex(rien, lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[]),->,drs([],[not(appl(Q,X))]))]))). % eg. "Jean a rien vu" lex(rien, dr(0,dl(0,np,s),dr(0,dl(0,np,s),np)), lambda(TV,appl(TV,lambda(Q,drs([],[bool(drs([variable(X)],[]),->,drs([],[not(appl(Q,X))]))]))))). lex(personne, lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[appl(humain,X)]),->,drs([],[not(appl(Q,X))]))]))). lex('Personne', lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[appl(humain,X)]),->,drs([],[not(appl(Q,X))]))]))). lex(nul, lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[appl(humain,X)]),->,drs([],[not(appl(Q,X))]))]))). lex('Nul', lit(np(_,_,_)), lambda(Q,drs([],[bool(drs([variable(X)],[appl(humain,X)]),->,drs([],[not(appl(Q,X))]))]))). lex(non, dr(0,dl(0,n,n),dl(0,n,n)), lambda(ADJ,lambda(N,lambda(X,merge(drs([],[not(appl(appl(ADJ,lambda(_,drs([],[]))),X))]),appl(N,X)))))). lex(non, dr(0,dr(0,n,n),dr(0,n,n)), lambda(ADJ,lambda(N,lambda(X,merge(drs([],[not(appl(appl(ADJ,lambda(_,drs([],[]))),X))]),appl(N,X)))))). lex(non, dl(1,dl(0,n,n),dl(0,n,n)), lambda(ADJ,lambda(N,lambda(X,merge(drs([],[not(appl(appl(ADJ,lambda(_,drs([],[]))),X))]),appl(N,X)))))). lex('non-', dr(0,dl(0,n,n),dl(0,n,n)), lambda(ADJ,lambda(N,lambda(X,merge(drs([],[not(appl(appl(ADJ,lambda(_,drs([],[]))),X))]),appl(N,X)))))). lex('non-', dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([],[not(appl(P,X))])))). lex(non, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([],[not(appl(P,X))])))). lex(non, dr(0,dl(1,s,s),dl(1,s,s)), lambda(SMOD,lambda(S,lambda(E,merge(appl(S,E),drs([],not(appl(appl(SMOD,lambda(_,[])),E)))))))). lex(non, dr(0,dr(0,s,s),dr(0,s,s)), lambda(SMOD,lambda(S,lambda(E,merge(appl(S,E),drs([],not(appl(appl(SMOD,lambda(_,[])),E)))))))). % TODO: the semantics of the prefix "quasi-" given here is just the standard semantics for a % privative adjective, eg. "quasi-total" implies "not(total)" but says nothing about the % perceived (or implied) closeness to being total. It would be nice to do better than this. lex('quasi-', dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([variable(X),event(S)],[not(appl(P,X)),drs_label(S,appl(P,X)),appl(quasi,S)])))). % lex('-t-elle', dl(1,s,s), lambda(X,X)). lex('-elle', dl(1,s,s), lambda(X,X)). lex('-elles', dl(1,s,s), lambda(X,X)). lex('-t-il', dl(1,s,s), lambda(X,X)). lex('-il', dl(1,s,s), lambda(X,X)). lex('-ils', dl(1,s,s), lambda(X,X)). % ancien/futur % NOTE: the prefix "ex-" is treated as synonymous with "ancien" lex('ex-', dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),<,ref_time)])))). lex(ancien, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),<,ref_time)])))). lex(ancienne, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),<,ref_time)])))). lex(anciens, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),<,ref_time)])))). lex(anciennes, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),<,ref_time)])))). lex(futur, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),>,ref_time)])))). lex(future, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),>,ref_time)])))). lex(futurs, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),>,ref_time)])))). lex(futures, dr(0,lit(n),lit(n)), lambda(P,lambda(X,drs([event(S)],[drs_label(S,appl(P,X)),bool(appl(temps,S),>,ref_time)])))). lex(multiples, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(drs([],[bool(num(X),>,c)]),appl(P,X))))). lex(nombreux, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(drs([],[bool(num(X),>,c)]),appl(P,X))))). lex(nombreuses, dr(0,lit(n),lit(n)), lambda(P,lambda(X,merge(drs([],[bool(num(X),>,c)]),appl(P,X))))). lex(mêmes, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[bool(X,=,?)]),appl(P,X))))). lex(même, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([],[bool(X,=,?)]),appl(P,X))))). lex(moins, dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SQ,lambda(P,lambda(X,merge(appl(appl(Adj,P),X),drs([event(L1),event(L2)],[drs_label(L1,SQ),drs_label(L2,appl(appl(Adj,P),X)),bool(appl(mésure,L2),<,appl(mésure,L1))]))))))). lex(plus, dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SQ,lambda(P,lambda(X,merge(appl(appl(Adj,P),X),drs([event(L1),event(L2)],[drs_label(L1,SQ),drs_label(L2,appl(appl(Adj,P),X)),bool(appl(mésure,L2),>,appl(mésure,L1))]))))))). lex(aussi, dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SQ,lambda(P,lambda(X,merge(appl(appl(Adj,P),X),drs([event(L1),event(L2)],[drs_label(L1,SQ),drs_label(L2,appl(appl(Adj,P),X)),bool(appl(mésure,L2),=,appl(mésure,L1))]))))))). lex(si, dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SQ,lambda(P,lambda(X,merge(appl(appl(Adj,P),X),drs([event(L1),event(L2),event(F)],[drs_label(L1,appl(SQ,F)),drs_label(L2,appl(appl(Adj,P),X)),bool(appl(mésure,L2),>,c),appl(appl(cause,L1),L2)]))))))). lex(tellement, dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), lambda(Adj,lambda(SQ,lambda(P,lambda(X,merge(appl(appl(Adj,P),X),drs([event(L1),event(L2),event(F)],[drs_label(L1,appl(SQ,F)),drs_label(L2,merge(appl(appl(Adj,P),X),drs([],[bool(appl(mésure,L2),>,c)]))),appl(appl(cause,L1),L2)]))))))). %lex(toujours, dl(1,s,s), lambda(S,lambda(E,drs([],drs([event(X)],[ lex(que, dr(0,lit(s(q)),lit(np(_,_,_))), Sem) :- semantics(dot_np, Sem). % "C' est dans le jardin que Marie dort" lex(est, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(s(q))),lit(pp(PRP))), lambda(PP, lambda(CS, lambda(_NP, lambda(E,merge(appl(PP,lambda(X,drs([],[appl(appl(PRP,X),E)]))),appl(CS,E))))))). lex('En', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))),F),merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,appl(temps,F))]))))))). lex('En', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))),F),merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,appl(temps,F))]))))))). lex(en, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))),F),merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,appl(temps,F))]))))))). lex(en, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))),F),merge(appl(S,E),drs([],[bool(appl(temps,E),subseteq,appl(temps,F))]))))))). lex('En', dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('En', dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_ppres)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(en, dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_ppres)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('Pour', dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_inf)), lambda(VPInf,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(merge(drs([event(F)],[]),appl(appl(VPInf,lambda(Q,appl(Q,X))),F)),drs([],[appl(appl(goal,F),E)])))))))))). lex('Pour', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex('Pour', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(pour, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(pour, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(pour, dr(0,dr(0,dl(0,np,s),dl(0,np,s)),dl(0,np,s_inf)), lambda(VPInf,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(merge(drs([event(F)],[]),appl(appl(VPInf,lambda(Q,appl(Q,X))),F)),drs([],[appl(appl(goal,F),E)])))))))))). lex(pour, dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_inf)), lambda(VPInf,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(merge(drs([event(F)],[]),appl(appl(VPInf,lambda(Q,appl(Q,X))),F)),drs([],[appl(appl(goal,F),E)])))))))))). lex(pour, dr(0,dl(0,dl(0,np,s),dl(0,np,s)),dl(0,np,s_inf)), lambda(VPInf,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(merge(drs([event(F)],[]),appl(appl(VPInf,lambda(Q,appl(Q,X))),F)),drs([],[appl(appl(goal,F),E)])))))))))). lex(pour, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex('Sans', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(merge(appl(S,E),drs([variable(X),event(F)],[bool(X,=,'?'),bool(E,subseteq,F)])),drs([],[appl(appl(VP,lambda(P,not(appl(P,X)))),F)])))))). lex('Sans', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(merge(appl(S,E),drs([variable(X),event(F)],[bool(X,=,'?'),bool(E,subseteq,F)])),drs([],[appl(appl(VP,lambda(P,not(appl(P,X)))),F)])))))). lex(sans, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(merge(appl(S,E),drs([variable(X),event(F)],[bool(X,=,'?'),bool(E,subseteq,F)])),drs([],[appl(appl(VP,lambda(P,not(appl(P,X)))),F)])))))). lex(sans, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(merge(appl(S,E),drs([variable(X),event(F)],[bool(X,=,'?'),bool(E,subseteq,F)])),drs([],[appl(appl(VP,lambda(P,not(appl(P,X)))),F)])))))). lex(sans, dr(0,dl(0,dl(0,np,s),dl(0,np,s)),dl(0,np,s_inf)), lambda(VPInf,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),drs([event(F)],[bool(E,subseteq,F),not(appl(appl(VPInf,lambda(Q,appl(Q,X))),F))]))))))))). lex(sans, dr(0,dl(1,dl(0,np,s),dl(0,np,s)),dl(0,np,s_inf)), lambda(VPInf,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),drs([event(F)],[bool(E,subseteq,F),not(appl(appl(VPInf,lambda(Q,appl(Q,X))),F))]))))))))). lex(sans, dr(0,dl(0,np,np),dl(0,np,s_inf)), lambda(VPInf, lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([event(E),variable(Y)],[appl(generic,Y),not(appl(appl(VPInf,lambda(Q,appl(Q,Y))),E))])))))))). lex('Faute', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(S,E),merge(drs([variable(X),event(F)],[appl(appl(faute_de,E),F),appl(appl(explanation,E),F),bool(X,=,'context?')]),drs([],[not(appl(appl(VP,lambda(P,appl(P,X))),F))]))))))). lex(faute, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(S,E),merge(drs([variable(X),event(F)],[appl(appl(faute_de,E),F),appl(appl(explanation,E),F),bool(X,=,'context?')]),drs([],[not(appl(appl(VP,lambda(P,appl(P,X))),F))]))))))). lex('Quitte', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_ainf)), lambda(VP,lambda(S,lambda(E,merge(merge(drs([event(F)],[]),appl(appl(VP,lambda(P,appl(P,X))),F)),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(quitte_à,F),E),bool(X,=,'context?')]))))))). lex(quitte, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_ainf)), lambda(VP,lambda(S,lambda(E,merge(merge(drs([event(F)],[]),appl(appl(VP,lambda(P,appl(P,X))),F)),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(quitte_à,F),E),bool(X,=,'context?')]))))))). lex('Jusqu\'', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_ainf)), lambda(VP,lambda(S,lambda(E,merge(merge(drs([event(F)],[]),appl(appl(VP,lambda(P,appl(P,X))),F)),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(jusque_à,F),E),appl(appl(result,F),E),bool(X,=,'context?')]))))))). lex('jusqu\'', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_ainf)), lambda(VP,lambda(S,lambda(E,merge(merge(drs([event(F)],[]),appl(appl(VP,lambda(P,appl(P,X))),F)),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(jusqu_à,F),E),appl(appl(result,F),E),bool(X,=,'context?')]))))))). lex('Avant', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex('Avant', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,appl(agent,E))]))))))). lex(avant, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex(avant, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex('Avant', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex('Avant', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex(avant, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex(avant, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[bool(appl(temps,E),'<',appl(temps,F)),bool(X,=,'context?')]))))))). lex('Avant', dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('Avant', dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_deinf)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(avant, dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_deinf)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(avant, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(avant, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(avant, dr(0,dl(1,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('Après', dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_inf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('Après', dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_inf)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(après, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_inf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(après, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_inf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(après, dr(0,dl(1,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_inf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(après, dr(0,dr(0,dr(0,s,dl(0,np,s)),np),dl(0,np,s_inf)), lambda(VPD,lambda(NP,lambda(VP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),<,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('En', dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(en, dr(0,dl(0,dl(0,np,s),dl(0,np,s)),dl(0,np,s_ppres)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(en, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(en, dr(0,dl(1,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_ppres)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[bool(appl(temps,E),subseteq,appl(temps,F))]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex('Après', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X)],[bool(appl(temps,F),'<',appl(temps,E)),bool(X,=,'context?')]))))))). lex('Après', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X)],[bool(appl(temps,F),'<',appl(temps,E)),bool(X,=,'context?')]))))))). lex(après, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X)],[bool(appl(temps,F),'<',appl(temps,E)),bool(X,=,'context?')]))))))). lex(après, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X)],[bool(appl(temps,F),'<',appl(temps,E)),bool(X,=,'context?')]))))))). lex('Afin', dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex('Afin', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(afin, dr(0,dr(0,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(afin, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VP,lambda(S,lambda(E,merge(appl(appl(VP,lambda(P,appl(P,X))),F),merge(appl(S,E),drs([variable(X),event(F)],[appl(appl(goal,F),E),bool(X,=,appl(agent,E))]))))))). lex(afin, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(ST))),dl(0,lit(np(_,_,_)),lit(s(ST)))),dl(0,lit(np(_,_,_)),s_deinf)), lambda(VPD,lambda(VP,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(VP,lambda(P,appl(P,X))),E),merge(drs([event(F)],[appl(appl(goal,F),E)]),appl(appl(VPD,lambda(Q,appl(Q,X))),F)))))))))). lex(aussi, dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,merge(appl(NP,lambda(X,drs([event(E),variable(Y)],[appl(appl(agent,X),E),bool(E,=,'event?')]))),appl(P,X))))). % Lexconn gives only "result" for sentence-initial "aussi" lex('Aussi', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(result,E),F)]),appl(S,E))))). lex(aussi, dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(result,E),F)]),appl(S,E))))). lex(aussi, dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(parallel,E),F)]),appl(S,E))))). lex('aussitôt', dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(narration,E),F)]),\/,drs([],[appl(appl(result,E),F)])),bool(appl(temps,F),abuts,appl(temps,E))]),appl(S,E))))). lex('aussitôt', dr(0,dl(0,np,s),dl(0,np,s)), lambda(VP,lambda(NP,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(narration,E),F)]),\/,drs([],[appl(appl(result,E),F)])),bool(appl(temps,F),abuts,appl(temps,E))]),appl(appl(VP,NP),E)))))). lex('également', dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(parallel,E),F)]),appl(S,E))))). lex('également', dr(0,dl(0,np,s),dl(0,np,s)), lambda(VP,lambda(NP,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(parallel,E),F)]),appl(appl(VP,NP),E)))))). % = proper nouns - French lex('Là', dr(0,lit(s(_)),lit(s(_))), lambda(S,lambda(E,merge(drs([variable(X)],[bool(X,=,'lieu?'),appl(appl(lieu,X),E)]),appl(S,E))))). lex('là', dr(0,lit(s(_)),lit(s(_))), lambda(S,lambda(E,merge(drs([variable(X)],[bool(X,=,'lieu?'),appl(appl(lieu,X),E)]),appl(S,E))))). lex('là', dl(1,lit(s(_)),lit(s(_))), lambda(S,lambda(E,merge(drs([variable(X)],[bool(X,=,'lieu?'),appl(appl(lieu,X),E)]),appl(S,E))))). lex('Je', lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex('J', lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex('J\'', lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex(je, lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex('-je', lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex(j, lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex('j\'', lit(np(nom,g,1-s)), lambda(P,merge(drs([variable(X)],[appl(orateur,X)]),appl(P,X)))). lex('Nous', lit(np(_,_,1-p)), lambda(P,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,Y)))). lex(nous, lit(np(_,_,1-p)), lambda(P,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,Y)))). lex('-nous', lit(np(_,_,1-p)), lambda(P,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,Y)))). lex('On', lit(np(nom,g,3-s)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). lex(on, lit(np(nom,g,3-s)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). lex('-on', lit(np(nom,g,3-s)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). lex('Tu', lit(np(nom,g,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('T', lit(np(_,_,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('T\'', lit(np(_,_,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex(te, lit(np(_,_,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('-tu', lit(np(nom,g,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex(tu, lit(np(nom,g,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex(toi, lit(np(nom,g,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('-toi', lit(np(nom,g,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex(t, lit(np(_,_,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('t\'', lit(np(_,_,2-s)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('Vous', lit(np(_,_,2-p)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex(vous, lit(np(_,_,2-p)), lambda(P,merge(drs([variable(X)],[appl(auditeur,X)]),appl(P,X)))). lex('Certains', lit(np(_,_,_)), lambda(P,merge(drs([],[bool(num(X),>,1)]),appl(P,X)))). lex(certains, lit(np(_,_,_)), lambda(P,merge(drs([],[bool(num(X),>,1)]),appl(P,X)))). lex('Certaines', lit(np(_,_,_)), lambda(P,merge(drs([],[bool(num(X),>,1)]),appl(P,X)))). lex(certaines, lit(np(_,_,_)), lambda(P,merge(drs([],[bool(num(X),>,1)]),appl(P,X)))). lex(minimum, lit(n), lambda(X,drs([],[not(drs([variable(Y)],[bool(Y,=,'context?'),bool(Y,<,X)]))]))). lex(maximum, lit(n), lambda(X,drs([],[not(drs([variable(Y)],[bool(Y,=,'context?'),bool(Y,>,X)]))]))). lex(minimal, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,<,X)]),appl(P,Y)))]))))). lex(minimaux, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,<,X)]),appl(P,Y)))]))))). lex(minimale, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,<,X)]),appl(P,Y)))]))))). lex(minimales, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,<,X)]),appl(P,Y)))]))))). lex(maximal, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,>,X)]),appl(P,Y)))]))))). lex(maximaux, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,>,X)]),appl(P,Y)))]))))). lex(maximale, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,>,X)]),appl(P,Y)))]))))). lex(maximales, dl(0,lit(n),lit(n)), lambda(P,lambda(X,merge(appl(P,X),drs([],[not(merge(drs([variable(Y)],[bool(Y,>,X)]),appl(P,Y)))]))))). lex('Il', lit(np(nom,il,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex('Elle', lit(np(_,n,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex(il, lit(np(nom,il,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex('-il', lit(np(nom,il,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex('-t-il', lit(np(nom,il,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex(ils, lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X),variable(Y)],[bool(num(X),>,1),bool(Y,atomic_sub,X),bool(Y,=,'masculin?')]),appl(P,X)))). lex('-ils', lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X),variable(Y)],[bool(num(X),>,1),bool(Y,atomic_sub,X),bool(Y,=,'masculin?')]),appl(P,X)))). lex('Ils', lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X),variable(Y)],[bool(num(X),>,1),bool(Y,atomic_sub,X),bool(Y,=,'masculin?')]),appl(P,X)))). lex(elles, lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X)],[bool(num(X),>,1),bool(X,=,'feminin?')]),appl(P,X)))). lex('-elles', lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X)],[bool(num(X),>,1),bool(X,=,'feminin?')]),appl(P,X)))). lex('-t-elles', lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X)],[bool(num(X),>,1),bool(X,=,'feminin?')]),appl(P,X)))). lex('Elles', lit(np(nom,il,3-p)), lambda(P,merge(drs([variable(X)],[bool(num(X),>,1),bool(X,=,'feminin?')]),appl(P,X)))). lex(elle, lit(np(_,_,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex('-elle', lit(np(_,_,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex('-t-elle', lit(np(_,_,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex('l\'', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex(lui, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('-lui', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex(y, lit(cl_y), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex(leur, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?'),appl(plural,X)]),appl(P,X)))). lex('-leur', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?'),appl(plural,X)]),appl(P,X)))). lex(le, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex('-le', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'masculin?')]),appl(P,X)))). lex(la, lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex('-la', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[bool(X,=,'feminin?')]),appl(P,X)))). lex(se, lit(np(acc,refl,_)), lambda(P,appl(P,_))). lex(se, lit(cl_r), lambda(P,appl(P,_))). lex('s\'', lit(np(acc,refl,3-_)), lambda(P,appl(P,_))). lex('s\'', lit(cl_r), lambda(P,appl(P,_))). lex('Se', lit(np(acc,refl,_)), lambda(P,appl(P,_))). lex('Se', lit(cl_r), lambda(P,appl(P,_))). lex('S\'', lit(np(acc,refl,3-_)), lambda(P,appl(P,_))). lex('S\'', lit(cl_r), lambda(P,appl(P,_))). % TODO: ne+ cesser/oser/pouvoir is negative by itself (without pas) % ne + savoir + whq % ne + cesser + deinf % ne + oser + inf % ne + pouvoir + inf % ne + deigner + inf % ne + bouger lex('Ne', dr(0,lit(s(Z)),lit(s(Z))), lambda(X,X)). lex(ne, dr(0,lit(s(Z)),lit(s(Z))), lambda(X,X)). lex(ne, dr(0,dl(0,lit(np(A,B,C)),lit(s(Z))),dl(0,lit(np(A,B,C)),lit(s(Z)))), lambda(X,X)). lex(ne, dl(0,dl(0,lit(np(A,B,C)),lit(s(Z))),dl(0,lit(np(A,B,C)),lit(s(Z)))), lambda(X,X)). lex('n\'', dr(0,dl(0,lit(np(A,B,C)),lit(s(Z))),dl(0,lit(np(A,B,C)),lit(s(Z)))), lambda(X,X)). lex('n\'', dr(0,lit(s(Z)),lit(s(Z))), lambda(X,X)). lex('N\'', dr(0,lit(s(Z)),lit(s(Z))), lambda(X,X)). lex(pas, dr(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))), lambda(VP,lambda(NP,lambda(E,drs([],[not(appl(appl(VP,NP),E))]))))). lex(pas, dl(1,lit(s(Z)),lit(s(Z))), lambda(S,lambda(E,drs([],[not(appl(S,E))])))). lex(pas, dr(0,lit(s(Z)),lit(s(Z))), lambda(S,lambda(E,drs([],[not(appl(S,E))])))). lex(pas, dr(0,lit(np(A,B,C)),lit(np(A,B,C))), lambda(NP,lambda(P,drs([],[not(appl(NP,lambda(X,appl(P,X))))])))). lex(jamais, dr(0,s,s), lambda(S, lambda(F, drs([], [not(merge(drs([event(E)],[bool(E,subseteq,F)]),appl(S,E)))])))). lex(jamais, dl(1,s,s), lambda(S, lambda(F, drs([], [not(merge(drs([event(E)],[bool(E,subseteq,F)]),appl(S,E)))])))). %lex(jamais, dr(0,np,np), lambda(NP, lambda(P, appl(NP, lambda(X, merge( lex(où, dr(0,dl(0,n,n),s), lambda(S,lambda(P,lambda(V,merge(merge(drs([event(E)],[appl(appl(lieu,E),V)]),appl(S,E)),appl(P,V)))))). lex(où, dr(0,dl(0,np,np),s), lambda(S,lambda(NP,lambda(P,appl(NP,lambda(X,merge(merge(drs([event(E)],[appl(appl(lieu,E),X)]),appl(S,E)),appl(P,X)))))))). % % Generalized Quantifiers lex(ni, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex('Ni', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex(ni, dr(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,drs([],[not(appl(NP,lambda(X,appl(P,X))))])))). lex('Ni', dr(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(NP,lambda(P,drs([],[not(appl(NP,lambda(X,appl(P,X))))])))). lex(aucun, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex(aucune, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex('Aucun', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex('Aucune', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_no_semantics(Sem). lex('Quelqu\'un', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). lex('quelqu\'un', lit(np(_,_,_)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). % Demonstratives lex(ce, lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex(c, lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('c\'', lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('Ce', lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('-ce', lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('C\'', lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex('C', lit(np(nom,ce,3-s)), lambda(P,merge(drs([variable(X)],[bool(X,=,'?')]),appl(P,X)))). lex(ce, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_this_semantics(Sem). lex(cet, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_this_semantics(Sem). lex(cette, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_this_semantics(Sem). lex('Ce', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_this_semantics(Sem). lex('Cet', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_this_semantics(Sem). lex('Cette', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_this_semantics(Sem). lex(ces, dr(0,lit(np(_,_,3-p)),lit(n)), Sem) :- gq_these_semantics(Sem). lex('Ces', dr(0,lit(np(_,_,3-p)),lit(n)), Sem) :- gq_these_semantics(Sem). % "tel" as singular determiner is treated as a standard indefinite lex(tel, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(telle, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Telle', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Tel', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). % "tel" as plural determiner is treated like "des" and "quelques" lex(tels, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(telles, dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('Tels', dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('Telles', dr(0,lit(np(_,_,_)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). % "tel" as adjective is treat as indicating similarity with a previously referenced entity lex(tel, dr(0,lit(n),lit(n)), lambda(P,lambda(X, merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'?'),bool(X,approx,Y)]))))). lex(tels, dr(0,lit(n),lit(n)), lambda(P,lambda(X, merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'?'),bool(X,approx,Y)]))))). lex(telle, dr(0,lit(n),lit(n)), lambda(P,lambda(X, merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'?'),bool(X,approx,Y)]))))). lex(telles, dr(0,lit(n),lit(n)), lambda(P,lambda(X, merge(appl(P,X),drs([variable(Y)],[bool(Y,=,'?'),bool(X,approx,Y)]))))). % Indefinites % currently, no difference in meaning is made between "des", "certains", "plusieurs" and "quelques" lex('Quelques', dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('Plusieurs', dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('Certains', dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('Des', dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(des, dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(quelques, dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(plusieurs, dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(certains, dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(des, dr(0,lit(np(_,_,3-p)),lit(n)), lambda(P,lambda(Q,merge(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex('D\'', dr(0,lit(np(_,_,3-_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Du', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(des, dr(0,lit(np(_,_,3-p)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(du, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(de, dr(0,lit(np(_,_,3-_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('d\'', dr(0,lit(np(_,_,3-_)),lit(n)), Sem) :- gq_a_semantics(Sem). % "un/une" used as pronoun % presuppose a set Y with at least two elements and select a member of the apropriate gender from it. lex('Un', lit(np(_,_,3-s)), lambda(P1,presup(drs([variable(Y)],[bool(Y,=,?),bool(num(Y),>,1)]),merge(drs([variable(X)],[bool(X,atomic_sub,Y),appl(masculin,X)]),appl(P1,X))))). lex(un, lit(np(_,_,3-s)), lambda(P1,presup(drs([variable(Y)],[bool(Y,=,?),bool(num(Y),>,1)]),merge(drs([variable(X)],[bool(X,atomic_sub,Y),appl(masculin,X)]),appl(P1,X))))). lex('Une', lit(np(_,_,3-s)), lambda(P1,presup(drs([variable(Y)],[bool(Y,=,?),bool(num(Y),>,1)]),merge(drs([variable(X)],[bool(X,atomic_sub,Y),appl(feminin,X)]),appl(P1,X))))). lex(une, lit(np(_,_,3-s)), lambda(P1,presup(drs([variable(Y)],[bool(Y,=,?),bool(num(Y),>,1)]),merge(drs([variable(X)],[bool(X,atomic_sub,Y),appl(feminin,X)]),appl(P1,X))))). % "certains/plusieurs" used as pronoun % note that "certains" is not treated as an anaphor but as an indefinite. % eg. "Certains disent que ..." lex('Certains', lit(np(_,_,3-p)), lambda(Q,merge(drs([variable(X)],[bool(num(X),>,1)]),appl(Q,X)))). lex(certains, lit(np(_,_,3-p)), lambda(Q,merge(drs([variable(X)],[bool(num(X),>,1)]),appl(Q,X)))). lex('Plusieurs', lit(np(_,_,3-p)), lambda(Q,merge(drs([variable(X)],[bool(num(X),>,1)]),appl(Q,X)))). lex(plusieurs, lit(np(_,_,3-p)), lambda(Q,merge(drs([variable(X)],[bool(num(X),>,1)]),appl(Q,X)))). % TODO: add other indefinites (celui, celle, celles, ceux, ce) % de la lex('De', dr(0,lit(np(A,B,C)),lit(np(A,B,C))), lambda(X,X)). lex(de, dr(0,lit(np(A,B,C)),lit(np(A,B,C))), lambda(X,X)). % Definites % = adverbially used determiners "l'été", "le 15 janvier", "le mardi" lex(le, dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex(le, dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('Le', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('Le', dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex(la, dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex(la, dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('La', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('La', dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('l\'', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('l\'', dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('L\'', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('L\'', dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). % "ce matin", etc. % these may be better treated as a anaphoric, though there is not always a clear referent (there is a default to "today"/"the current year", etc.) lex(ce, dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex(ce, dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('Ce', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('Ce', dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, merge(merge(drs([variable(X)],[bool(E,subseteq,X)]),appl(N,X)),appl(S,E)))))). lex('Chaque', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, drs([],[bool(merge(drs([variable(X)],[]),appl(N,X)),->,appl(S,E))]))))). lex(chaque, dr(0,dl(1,lit(s(_)),lit(s(_))),lit(n)), lambda(N, lambda(S, lambda(E, drs([],[bool(merge(drs([variable(X)],[]),appl(N,X)),->,appl(S,E))]))))). % eg. "Le plus courageux" % lex(le, dr(0,lit(np(_,_,3-s)),dl(0,lit(n),lit(n))), Sem) :- CONTINUE lex(le, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('Le', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex(ledit, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('Ledit', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex(les, dr(0,lit(np(_,_,3-p)),lit(n)), Sem) :- gq_les_semantics(Sem). lex('Les', dr(0,lit(np(_,_,3-p)),lit(n)), Sem) :- gq_les_semantics(Sem). lex(la, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('La', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex(la, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex(ladite, dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('Ladite', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('La', dr(0,lit(np(_,_,3-s)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('l\'', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_the_semantics(Sem). lex('L\'', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_the_semantics(Sem). % Existential lex(un, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Un', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(une, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Une', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex(quelque, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('quelqu\'', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Quelque', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). lex('Quelqu\'', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_a_semantics(Sem). % Universal lex(chaque, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex('Chaque', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex(tout, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex('Tout', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex(toute, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex('Toute', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex(tous, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex('Tous', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex(toutes, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). lex('Toutes', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- gq_every_semantics(Sem). % Possessives lex(notre, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, p, s). lex('Notre', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, p, s). lex(mon, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, m). lex('Mon', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, m). lex(ma, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, f). lex('Ma', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, f). lex(mes, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, p). lex('Mes', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, s, p). lex(nos, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, p, p). lex('Nos', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_1p_semantics(Sem, p, p). lex(votre, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, p, s). lex('Votre', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, p, s). lex(vos, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, p, p). lex('Vos', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, p, p). lex(ton, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, m). lex('Ton', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, m). lex(ta, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, f). lex('Ta', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, f). lex(tes, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, p). lex('Tes', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_2p_semantics(Sem, s, p). lex(leur, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, p, s). lex('Leur', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, p, s). lex(leurs, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, p, p). lex('Leurs', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, p, p). lex(son, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, m). lex('Son', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, m). lex(ses, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, p). lex('Ses', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, p). lex(sa, dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, f). lex('Sa', dr(0,lit(np(_,_,_)),lit(n)), Sem) :- possessive_3p_semantics(Sem, s, f). % Prepositions lex('d\'', dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, merge(appl(N2,X),merge(drs([variable(Y)],[appl(appl(de,Y),X)]),appl(N1,Y))))))). lex(du, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, presup(merge(drs([variable(Y)],[]),appl(N1,Y)),merge(appl(N2,X),drs([],[appl(appl(de,Y),X)]))))))). lex(des, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N1,Y)),merge(appl(N2,X),drs([],[appl(appl(de,Y),X)]))))))). lex(au, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, presup(merge(drs([variable(Y)],[]),appl(N1,Y)),merge(appl(N2,X),drs([],[appl(appl(à,Y),X)]))))))). lex(aux, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(N1, lambda(N2, lambda(X, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N1,Y)),merge(appl(N2,X),drs([],[appl(appl(à,Y),X)]))))))). lex('Au', dr(0,dr(0,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(à,Y),E)]))))))). lex('Aux', dr(0,dr(0,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(à,Y),E)]))))))). lex('Du', dr(0,dr(0,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(de,Y),E)]))))))). lex('Des', dr(0,dr(0,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(de,Y),E)]))))))). lex(au, dr(0,dl(1,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(à,Y),E)]))))))). lex(aux, dr(0,dl(1,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(à,Y),E)]))))))). lex(du, dr(0,dl(1,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(de,Y),E)]))))))). lex(des, dr(0,dl(1,s,s),n), lambda(N, lambda(S, lambda(E, presup(merge(drs([variable(Y)],[bool(num(Y),>,1)]),appl(N,Y)),merge(appl(S,E),drs([],[appl(appl(de,Y),E)]))))))). lex(aux, dr(0,pp_a,n), lambda(P,lambda(Q,presup(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). lex(des, dr(0,pp_de,n), lambda(P,lambda(Q,presup(merge(drs([variable(X)],[bool(num(X),>,1)]),appl(P,X)),appl(Q,X))))). % plus_de % NOTE: several different constructions are possible here % "plus de 200" % "(plus de 200) etudiants" % "plus d'etudiants" lex(plus, dr(0,lit(np(_,_,_)),lit(pp(de))), lambda(Q,lambda(P,merge(appl(Q,lambda(Y,drs([variable(X)],[bool(X,=,appl(plus_de,Y))]))),appl(P,X))))). %lex('Plus', dr(0,lit(np(_,_,_)),lit(pp(de))), lambda(Q,lambda(P,merge(appl(Q,lambda(Y,drs([variable(X)],[bool(X,>,Y)]))),appl(P,X))))). % Discourse connectives % conjunctions lex(et, dr(0,dl(0,lit(s(Z)),lit(s(Z))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(narration,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(et, dr(0,dl(0,lit(cs),lit(cs)),lit(cs)), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(narration,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(et, dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). lex(et, dr(0,dl(0,dr(0,lit(n),lit(n)),dr(0,lit(n),lit(n))),dr(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). lex(et, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(Q,lambda(X1,appl(X1,X))),E),merge(drs([event(F)],[]),appl(appl(P,lambda(X1,appl(X1,X))),F)))))))))). lex(et, dr(0,dl(0,dr(0,lit(np(_,_,_)),lit(n)),dr(0,lit(np(_,_,_)),lit(n))),dr(0,lit(np(_,_,_)),lit(n))),lambda(Det1,lambda(Det2,lambda(N,lambda(P,merge(appl(appl(Det1,N),P),appl(appl(Det2,N),P))))))). lex(et, dr(0,dl(0,dl(1,s,s),dl(1,s,s)),dl(1,s,s)), lambda(Adv2,lambda(Adv1,lambda(S,lambda(E,merge(appl(appl(Adv1,S),E),appl(appl(Adv2,S),E))))))). lex(et, dr(0,dl(0,dr(0,s,s),dr(0,s,s)),dr(0,s,s)), lambda(Adv2,lambda(Adv1,lambda(S,lambda(E,merge(appl(appl(Adv1,S),E),appl(appl(Adv2,S),E))))))). lex(et, dr(0,dl(0,dr(0,dl(0,np,s),np),dr(0,dl(0,np,s),np)),dr(0,dl(0,np,s),np)),lambda(P,lambda(Q,lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,merge(appl(appl(appl(Q,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),E),merge(drs([event(F)],[]),appl(appl(appl(P,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),F))))))))))))). lex(et, dr(0,dl(0,dr(0,dl(0,np,s),dia(0,box(0,np))),dr(0,dl(0,np,s),np)),dr(0,dl(0,np,s),dia(0,box(0,np)))),lambda(P,lambda(Q,lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,merge(appl(appl(appl(Q,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),E),merge(drs([event(F)],[]),appl(appl(appl(P,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),F))))))))))))). lex(ou, dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,merge(appl(R,X),drs([],[bool(appl(appl(Q,R),X),\/,appl(appl(P,R),X))]))))))). lex(ou, dr(0,dl(0,dr(0,lit(n),lit(n)),dr(0,lit(n),lit(n))),dr(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,merge(appl(R,X),drs([],[bool(appl(appl(Q,R),X),\/,appl(appl(P,R),X))]))))))). lex(ou, dr(0,dl(0,dl(1,s,s),dl(1,s,s)),dl(1,s,s)), lambda(Adv2,lambda(Adv1,lambda(S,lambda(E,bool(appl(appl(Adv1,S),E),\/,merge(drs([event(F)],[]),appl(appl(Adv2,S),F)))))))). lex(ou, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(NP,lambda(E,appl(NP,lambda(X,bool(appl(appl(Q,lambda(X1,appl(X1,X))),E),\/,merge(drs([event(F)],[]),appl(appl(P,lambda(X1,appl(X1,X))),F)))))))))). lex(ou, dr(0,dl(0,dr(0,dl(0,np,s),np),dr(0,dl(0,np,s),np)),dr(0,dl(0,np,s),np)),lambda(P,lambda(Q,lambda(NPO,lambda(NPS,lambda(E,appl(NPS,lambda(X,appl(NPO,lambda(Y,bool(appl(appl(appl(Q,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),E),\/,merge(drs([event(F)],[]),appl(appl(appl(P,lambda(Y1,appl(Y1,Y))),lambda(X1,appl(X1,X))),F))))))))))))). lex(ou, dr(0,dl(0,lit(pp(_)),lit(pp(_))),lit(pp(_))), lambda(NP1,lambda(NP2,lambda(P,drs([],[bool(appl(NP1,P),\/,appl(NP2,P))]))))). lex(ou, dr(0,dl(0,np,np),n), lambda(N,lambda(NP,lambda(P,drs([], [bool(merge(drs([variable(Y)],[]),appl(N,Y)),\/,appl(NP,P))]))))). lex(ou, dr(0,dl(0,np,np),dl(0,n,n)), lambda(NN,lambda(NP,lambda(P,drs([], [bool(merge(drs([variable(Y)],[]),appl(appl(NN,lambda(_,drs([],[]))),Y)),\/,appl(NP,P))]))))). lex('Mais', dr(0,lit(s(Z)),lit(s(Z))), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(contrast,F),E),bool(F,=,'event?')]),appl(S,E))))). lex(mais, dl(0,lit(s(Z)),dr(0,lit(s(Z)),lit(s(_)))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(contrast,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(mais, dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). lex(mais, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(NP,lambda(E,appl(NP,lambda(X,merge(appl(appl(Q,lambda(X1,appl(X1,X))),E),merge(drs([event(F)],[appl(appl(contrast,F),E)]),appl(appl(P,lambda(X1,appl(X1,X))),F)))))))))). lex(puis, dr(0,dl(0,dl(1,s,s),dl(1,s,s)),dl(1,s,s)), lambda(SMODR,lambda(SMODL,lambda(S,lambda(E,merge(appl(S,E),drs([event(L1),event(L2)],[drs_label(L1,appl(appl(SMODL,lambda(_,drs([],[]))),E)),drs_label(L2,appl(appl(SMODR,lambda(_,drs([],[]))),E)),bool(appl(temps,L1),<,appl(temps,L2))]))))))). lex(puis, dr(0,dl(0,s,s),s), lambda(Q,lambda(P,lambda(F,merge(drs([event(E)],[bool(appl(temps,E),'<',appl(temps,F))]),merge(appl(P,E),appl(Q,F))))))). lex(puis, dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(np(_,_,_)),lit(s(_)))),dl(0,lit(np(_,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(N,lambda(E,merge(merge(drs([event(F)],[bool(appl(temps,E),'<',appl(temps,F))]),appl(appl(Q,N),E)),appl(appl(P,N),F))))))). % P,Q ((e->t)->t)->s->t % N (e->t)->t % E s lex(or, dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,F),E)]),\/,drs([],[appl(appl(continuation,F),E)]))]),appl(S,E))))). lex('Or', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,F),E)]),\/,drs([],[appl(appl(continuation,F),E)]))]),appl(S,E))))). lex('OR', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,F),E)]),\/,drs([],[appl(appl(continuation,F),E)]))]),appl(S,E))))). lex(',', dr(0,dl(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))),dl(0,lit(n),lit(n))), lambda(P,lambda(Q,lambda(R,lambda(X,appl(appl(P,appl(Q,R)),X)))))). % P: e->t % NP: (e->t)->t % VP: ((e->t)->t)->s->t lex(',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),appl(N,X)))))))). lex(',', dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP,lambda(VP,lambda(P,appl(NP,lambda(X,merge(merge(drs([event(F)],[]),appl(appl(VP,lambda(Prp,appl(Prp,X))),F)),appl(P,X)))))))). % tough call, "satellite" np's have different uses. lex(',', dr(0, dl(0, s, s), np), lambda(NP,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(_,drs([],[])))))))). %title_semantics(Title, lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(appl(titre,Title),X)]))))))). %lambda(P,merge(drs([variable(X)],[appl(appl(nommé,Word),X)]),appl(P,X)))). %XYZ % "Topicalized" constructions % "np , s" % "np : s" % "n : s" lex(',', dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(s(_))), lambda(S, lambda(NP, lambda(E, merge(appl(NP,lambda(X,(drs([],[appl(appl(topic,X),E)])))),appl(S,E)))))). lex(':', dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(s(_))), lambda(S, lambda(NP, lambda(E, merge(appl(NP,lambda(X,(drs([],[appl(appl(topic,X),E)])))),appl(S,E)))))). lex(',', dr(0,dl(0,lit(n),lit(s(_))),lit(s(_))), lambda(S, lambda(N, lambda(E, presup(merge(drs([variable(X)],[appl(appl(topic,X),E)]),appl(N,X)),appl(S,E)))))). lex(',', dr(0,dl(0,dl(1,s,s),dl(1,s,s)),dl(1,s,s)), lambda(Adv2,lambda(Adv1,lambda(S,lambda(E,merge(appl(appl(Adv1,S),E),appl(appl(Adv2,S),E))))))). lex(',', dr(0,dl(0,dr(0,s,s),dr(0,s,s)),dr(0,s,s)), lambda(Adv2,lambda(Adv1,lambda(S,lambda(E,merge(appl(appl(Adv1,S),E),appl(appl(Adv2,S),E))))))). lex(':', dr(0,dl(0,lit(n),lit(s(_))),lit(s(_))), lambda(S, lambda(N, lambda(E, presup(merge(drs([variable(X)],[appl(appl(topic,X),E)]),appl(N,X)),appl(S,E)))))). lex(':', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,P),appl(NP1,P)))))). lex(':', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,P),appl(NP1,P)))))). lex(':', dr(0,lit(s(q)),lit(s(main))), lambda(X,X)). lex(':', dr(0,dl(0,lit(n),lit(n)),lit(np(_,_,_))), lambda(NP,lambda(N, lambda(X, merge(appl(NP,lambda(_,drs([],[]))),appl(N,X)))))). % "et" for nouns is sometimes better interpreted as disjunction especially with plural, eg. "enfants et adults", % lex(et, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(P,lambda(Q,lambda(X,drs([],[bool(appl(P,X),\/,appl(Q,X))]))))). lex(et, dr(0,dl(0,lit(n),lit(n)),lit(n)), lambda(P,lambda(Q,lambda(X,merge(appl(P,X),appl(Q,X)))))). % interpret as conjunction lex(et, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP2,lambda(X,appl(P,X))),appl(NP1,lambda(Y,appl(P,Y)))))))). lex(et, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),appl(N,X)))))))). lex(et, dr(0,dl(0,lit(pp(_)),lit(pp(_))),lit(pp(_))), lambda(NP1,lambda(NP2,lambda(P,merge(appl(NP1,P),appl(NP2,P)))))). lex(ni, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP1,lambda(NP2,lambda(P,drs([],[not(appl(NP1,P)),not(appl(NP2,P))]))))). lex(que, dr(0,dl(0,lit(n),lit(n)),lit(s(q))), lambda(SQ,lambda(CN,lambda(Y,merge(appl(CN,Y),drs([event(E),event(Lab)],[appl(appl(contenu,Lab),Y),drs_label(Lab,appl(SQ,E))])))))). lex(que, dr(0,dl(0,lit(n),lit(n)),lit(s(main))), lambda(SQ,lambda(CN,lambda(Y,merge(appl(CN,Y),drs([event(E),event(Lab)],[appl(appl(contenu,Lab),Y),drs_label(Lab,appl(SQ,E))])))))). lex(que, dr(0,lit(s(q)),lit(n)), lambda(P,merge(drs([variable(X)],[]),appl(P,X)))). lex(que, dr(0,lit(s(q)),lit(s(main))), lambda(X,X)). lex('qu\'', dr(0,lit(s(q)),lit(s(main))), lambda(X,X)). % = relativization % VP np -> s % ((e->t)->t) -> s->t % NP % (e->t)->t % P % e->t % lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),drs([],[appl(W,X)]))))))). % wh_rel_semantics(lambda(P,lambda(Q,lambda(X,merge(appl(Q,X),appl(appl(P,lambda(R,appl(R,X))),_)))))). lex(qui, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))), Sem) :- wh_rel_semantics(Sem). lex(qui, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),lit(s(_)))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),merge(drs([event(E)],[]),appl(appl(VP,lambda(P1,appl(P1,X))),E))))))))). lex(que, dr(0,dl(0,lit(n),lit(n)),dr(0,lit(s(_)),dia(0,box(0,lit(np(_,_,_)))))), Sem) :- wh_rel_semantics(Sem). lex(que, dr(0,dl(0,lit(n),lit(n)),dr(0,lit(s(_)),dia(1,box(1,lit(np(_,_,_)))))), Sem) :- wh_rel_semantics(Sem). lex(lequel, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))), Sem) :- wh_rel_semantics(Sem). lex(laquelle, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))), Sem) :- wh_rel_semantics(Sem). lex(lesquels, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))), Sem) :- wh_rel_semantics(Sem). lex(lesquelles, dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))), Sem) :- wh_rel_semantics(Sem). lex(que, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,lit(s(_)),dia(1,box(1,lit(np(_,_,_)))))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),merge(drs([event(E)],[]),appl(appl(VP,lambda(P1,appl(P1,X))),E))))))))). lex('qu\'', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,lit(s(_)),dia(1,box(1,lit(np(_,_,_)))))), lambda(VP,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),merge(drs([event(E)],[]),appl(appl(VP,lambda(P1,appl(P1,X))),E))))))))). lex('qu\'', dr(0,dl(0,lit(n),lit(n)),dr(0,lit(s(_)),dia(0,box(0,lit(np(_,_,_)))))), Sem) :- wh_rel_semantics(Sem). lex('qu\'', dr(0,dl(0,lit(n),lit(n)),dr(0,lit(s(_)),dia(1,box(1,lit(np(_,_,_)))))), Sem) :- wh_rel_semantics(Sem). lex(dont, dr(0,dl(0,n,n),s), lambda(S,lambda(N,lambda(X,merge(appl(N,X),merge(drs([event(E)],[appl(appl(de,X),E)]),appl(S,E))))))). lex(dont, dr(0,dl(0,lit(n),lit(n)),dr(0,lit(s(_)),dia(1,box(1,lit(pp(de)))))), Sem) :- wh_rel_semantics(Sem). lex(dont, dr(0,dr(0,dl(0,lit(n),lit(n)),dl(0,lit(np(_,_,_)),lit(s(_)))),lit(np(_,_,_))), lambda(NP, lambda(VP, lambda(N, lambda(X, merge(drs([event(E)],[]),appl(appl(VP,lambda(P,appl(NP,lambda(Y,merge(drs([],[appl(appl(de,Y),X)]),merge(appl(P,Y),appl(N,X))))))),E))))))). lex(dont, dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),lit(s(_)))),lit(np(_,_,_))), lambda(NP, lambda(VP, lambda(NP2, lambda(P, merge(appl(NP,lambda(Y,appl(NP2,lambda(X,drs([],[appl(appl(de,Y),X)]))))),merge(drs([event(E)],[]),merge(appl(appl(VP,NP),E),appl(P,Y))))))))). lex(quoi, dr(0, dl(0, dr(0, lit(pp(Prp)), lit(np(_,_,_))), dl(0, n, n)), lit(s(_))), lambda(S, lambda(_PP, lambda(N, lambda(X, merge(drs([event(E)],[bool(X,=,'context?')]),merge(appl(S,E),merge(appl(N,X),drs([],[Term]))))))))) :- ( var(Prp) -> /* default to "à" */ Term = appl(appl(à,X),E) ; Term = appl(appl(Prp,X),E) ). lex(quoi, dr(0, dl(0, dr(0, lit(pp(Prp)), lit(np(_,_,_))), lit(s(whq))), dr(0, lit(s(_)), dia(1, box(1, lit(pp(Prp)))))), lambda(VP, lambda(PP, appl(PP,lambda(X,merge(drs([event(E)],[bool(X,=,'context?')]),appl(appl(VP,lambda(P,appl(P,X))),E))))))). lex(où, dr(0, dl(0, dr(0, lit(pp(Prp)), lit(np(_,_,_))), dl(0, lit(n), lit(n))), lit(s(_))), lambda(S, lambda(_PP, lambda(N, lambda(X, merge(drs([event(E)],[]),merge(appl(S,E),merge(appl(N,X),drs([],[Term]))))))))) :- ( var(Prp) -> /* default to "de" */ Term = appl(appl(de,X),E) ; Term = appl(appl(Prp,X),E) ). % "Il y a une alpiniste ..." lex(a, dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), lambda(NP,lambda(_,lambda(_,lambda(E,appl(NP,lambda(X,drs([event(E)],[appl(appl(existe,X),E)])))))))). % "Il y a deux ans" lex(a, dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),dl(1,s,s))),lit(np(_,_,_))), lambda(NP,lambda(_,lambda(_,lambda(S,lambda(E,merge(appl(S,E),appl(NP,lambda(X,drs([],[appl(appl(il_y_a,X),E)])))))))))). lex(a, dr(0,dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),s),lit(np(_,_,_))), lambda(NP,lambda(S,lambda(_,lambda(_,lambda(E,merge(appl(S,E),appl(NP,lambda(X,drs([],[appl(appl(il_y_a,X),E)])))))))))). % = coordination and discourse connectives lex('Si', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex(si, dr(0,dr(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex(si, dr(0,dl(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex('S\'', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex('s\'', dr(0,dr(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex('s\'', dr(0,dl(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). % "tant que" as subordinating connective if analysed as "if...then..." (Lexconn also allows "temploc", which implies a different truth-conditional meaning) lex(tant, dr(0,dr(0,s,s),s_q), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex(tant, dr(0,dl(1,s,s),s_q), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex(car, dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Car', dr(0,dr(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(mais, dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(contrast,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(et, dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(narration,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('(', dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[appl(appl(background,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('(', dr(0,dl(1,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[appl(appl(background,E),F)]),merge(appl(P,E),appl(Q,F))))))). % conditional rather than exclamation lex(pourvu, dr(0,dl(1,s,s),s_q), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). lex('Pourvu', dr(0,dr(0,s,s),s_q), lambda(P, lambda(Q, lambda(_,drs([],[bool(merge(drs([event(E)],[]),appl(P,E)),->,merge(drs([event(F)],[]),appl(Q,F)))]))))). % "comme" antepose is one of "explanation", "explanation*" and "background" lex('Comme', dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(explanation,E),F)]),\/,bool(drs([],[appl(appl('explanation*',E),F)]),\/,drs([],[appl(appl(background,E),F)])))]),merge(appl(P,E),appl(Q,F))))))). lex(comme, dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[bool(drs([],[appl(appl(explanation,E),F)]),\/,bool(drs([],[appl(appl('explanation*',E),F)]),\/,drs([],[appl(appl(background,E),F)])))]),merge(appl(P,E),appl(Q,F))))))). % "comme" postpose is "parallel" lex(comme, dr(0,dl(1,s,s),s), lambda(P,lambda(Q,lambda(F,merge(drs([event(E)],[appl(appl(parellel,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(plus, dr(0,dl(1,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(plus_que,E),F)]),merge(appl(P,E),appl(Q,F))))))). % not sure about the possibility of "explanation*" for sentence-initial "parce que" lex('Parce', dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(explanation,F),E)]),\/,drs([],[appl(appl('explanation*',F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex(parce, dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(explanation,F),E)]),\/,drs([],[appl(appl('explanation*',F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex(parce, dr(0,dl(1,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(explanation,F),E)]),\/,drs([],[appl(appl('explanation*',F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex(parce, dr(0,s,s_q), lambda(Q,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(explanation,F),E)]),appl(Q,E))))). lex(donc, dl(1,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(result,E),F)]),\/,drs([],[appl(appl('result*',E),F)]))]),appl(S,E))))). lex(donc, dr(0,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(result,E),F)]),\/,drs([],[appl(appl('result*',E),F)]))]),appl(S,E))))). lex('Donc', dr(0,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(result,E),F)]),\/,drs([],[appl(appl('result*',E),F)]))]),appl(S,E))))). lex(pourtant, dl(1,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,E),F)]),\/,drs([],[appl(appl(concession,E),F)]))]),appl(S,E))))). lex(pourtant, dr(0,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,E),F)]),\/,drs([],[appl(appl(concession,E),F)]))]),appl(S,E))))). lex('Pourtant', dr(0,lit(s(SS)),lit(s(SS))), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(violation,E),F)]),\/,drs([],[appl(appl(concession,E),F)]))]),appl(S,E))))). lex('Pour', dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(pour, dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(pour, dr(0,dl(1,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('Afin', dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(afin, dr(0,dr(0,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(afin, dr(0,dl(1,lit(s(SS)),lit(s(SS))),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(goal,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(lorsque, dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex(lorsque, dr(0,dl(1,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex('lorsqu\'', dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex('lorsqu\'', dr(0,dl(1,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex('Lorsque', dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex('Lorsqu\'', dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[bool(bool(drs([],[appl(appl(background,E),F)]),\/,drs([],[appl(appl(background,F),E)])),\/,drs([],[appl(appl(explanation,E),F)]))]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex(quand, dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex(quand, dr(0,dl(1,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex('Quand', dr(0,dr(0,s,s),s), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,E),overlaps,appl(temps,F))]))))))). lex(depuis, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),starts,appl(temps,E))]))))))). lex(depuis, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),starts,appl(temps,E))]))))))). lex('Depuis', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),starts,appl(temps,E))]))))))). lex('Depuis', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(appl(temps,F),starts,appl(temps,E))]),appl(S,E))))). lex(ensuite, dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(narration,E),F)]),appl(S,E))))). lex(ensuite, dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(narration,E),F)]),appl(S,E))))). lex('Ensuite', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),appl(appl(narration,E),F)]),appl(S,E))))). lex(après, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),<,appl(temps,E))]))))))). lex(après, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),<,appl(temps,E))]))))))). lex('Après', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),<,appl(temps,E))]))))))). lex('Après', dr(0,dr(0,s,s),np), lambda(NP,lambda(S,lambda(E,merge(appl(NP,lambda(X,drs([],[bool(appl(temps,X),<,appl(temps,E))]))),appl(S,E)))))). lex(après, dr(0,dl(1,s,s),np), lambda(NP,lambda(S,lambda(E,merge(appl(NP,lambda(X,drs([],[bool(appl(temps,X),<,appl(temps,E))]))),appl(S,E)))))). lex(après, dr(0,dr(0,s,s),np), lambda(NP,lambda(S,lambda(E,merge(appl(NP,lambda(X,drs([],[bool(appl(temps,X),<,appl(temps,E))]))),appl(S,E)))))). % = "Selon NP S" is translated as "NP soutient que S" (NP claims that S) lex('Selon', dr(0,dr(0,s,s),np), lambda(NP,lambda(S,lambda(F,appl(NP,lambda(X,drs([event(L)],[appl(appl(appl(soutenir_que,L),X),F),drs_label(L,merge(drs([event(E)],[]),appl(S,E)))]))))))). lex(selon, dr(0,dr(0,s,s),np), lambda(NP,lambda(S,lambda(F,appl(NP,lambda(X,drs([event(L)],[appl(appl(appl(soutenir_que,L),X),F),drs_label(L,merge(drs([event(E)],[]),appl(S,E)))]))))))). lex(selon, dr(0,dl(1,s,s),np), lambda(NP,lambda(S,lambda(F,appl(NP,lambda(X,drs([event(L)],[appl(appl(appl(soutenir_que,L),X),F),drs_label(L,merge(drs([event(E)],[]),appl(S,E)))]))))))). lex('D\'', dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(pp(apres))), lambda(PP,lambda(S,lambda(F,appl(PP,lambda(X,drs([event(L)],[appl(appl(appl(soutenir_que,L),X),F),drs_label(L,merge(drs([event(E)],[]),appl(S,E)))]))))))). lex(pendant, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(drs([event(F)],[bool(bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl('explanation*',F),E)])),\/,drs([],[appl(appl(background,F),E),bool(appl(temps,F),simeq,appl(temps,E))]))]),merge(appl(S2,E),appl(S1,F))))))). lex(pendant, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(drs([event(F)],[bool(bool(drs([],[appl(appl(contrast,E),F)]),\/,drs([],[appl(appl('explanation*',F),E)])),\/,drs([],[appl(appl(background,F),E),bool(appl(temps,F),simeq,appl(temps,E))]))]),merge(appl(S2,E),appl(S1,F))))))). lex('Pendant', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(drs([event(F)],[bool(bool(drs([],[appl(appl(contrast,E),F)]),\/,drs([],[appl(appl('explanation*',F),E)])),\/,drs([],[appl(appl(background,F),E),bool(appl(temps,F),simeq,appl(temps,E))]))]),merge(appl(S2,E),appl(S1,F))))))). %lex(pendant, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),simeq,appl(temps,E))]))))))). %lex(pendant, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),simeq,appl(temps,E))]))))))). %lex('Pendant', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),simeq,appl(temps,E))]))))))). lex(dès, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(dès, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex('Dès', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(aussitôt, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(aussitôt, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex('Aussitôt', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(sitôt, dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(sitôt, dr(0,dl(1,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex('Sitôt', dr(0,dr(0,s,s),s_q), lambda(S1,lambda(S2,lambda(E,merge(merge(drs([event(F)],[]),appl(S1,F)),merge(appl(S2,E),drs([],[bool(appl(temps,F),abuts,appl(temps,E))]))))))). lex(puisque, dr(0,dl(0,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(puisque, dr(0,dl(1,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Puisque', dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('puisqu\'', dr(0,dl(0,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('puisqu\'', dr(0,dl(1,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Puisqu\'', dr(0,dr(0,lit(s(SS)),lit(s(SS))),lit(s(_))), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(explanation,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(bien, dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(bien, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Bien', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(cependant, dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(cependant, dr(0,dl(1,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Cependant', dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Cependant', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E),bool(F,=,'event?')]),appl(S,E))))). lex(cependant, dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(cependant, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Cependant', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(comme, dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(parallel,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(comme, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(parallel,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('Comme', dr(0,dr(0,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(parallel,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('Comme', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(parallel,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('Néanmoins', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E),bool(F,=,'event?')]),appl(S,E))))). lex(néanmoins, dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E),bool(F,=,'event?')]),appl(S,E))))). lex(néanmoins, dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(opposition,F),E),bool(F,=,'event?')]),appl(S,E))))). lex(quoique, dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex(quoique, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Quoique', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Quoique', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E),bool(F,=,'event?')]),appl(S,E))))). lex('quoiqu\'', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('quoiqu\'', dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Quoiqu\'', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('Quoiqu\'', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(concession,F),E),bool(F,=,'event?')]),appl(S,E))))). % "tandis que" indicates either a contrast or background (and temporal overlap) lex(tandis, dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex(tandis, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex('Tandis', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[bool(drs([],[appl(appl(contrast,F),E)]),\/,drs([],[appl(appl(background,F),E)]))]),merge(appl(P,E),appl(Q,F))))))). lex('Bref', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(summary,E),F),bool(F,=,'event?')]),appl(S,E))))). lex('Néanmoins', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(summary,E),F),bool(F,=,'event?')]),appl(S,E))))). lex('néanmoins', dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[appl(appl(summary,E),F),bool(F,=,'event?')]),appl(S,E))))). lex('Autrement', dr(0,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(alternation,E),F)]),\/,bool(drs([],[appl(appl(continuation,E),F)]),\/,drs([],[appl(appl(violation,E),F)])))]),appl(S,E))))). lex(autrement, dr(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(alternation,E),F)]),\/,bool(drs([],[appl(appl(continuation,E),F)]),\/,drs([],[appl(appl(violation,E),F)])))]),appl(S,E))))). lex(autrement, dl(1,s,s), lambda(S,lambda(E,merge(drs([event(F)],[bool(F,=,'event?'),bool(drs([],[appl(appl(alternation,E),F)]),\/,bool(drs([],[appl(appl(continuation,E),F)]),\/,drs([],[appl(appl(violation,E),F)])))]),appl(S,E))))). lex('Sans', dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(appl(Q,E),drs([event(F)],[not(appl(P,F))])))))). lex(sans, dr(0,dr(0,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(appl(Q,E),drs([event(F)],[not(appl(P,F))])))))). lex(sans, dr(0,dl(1,s,s),s_q), lambda(P,lambda(Q,lambda(E,merge(appl(Q,E),drs([event(F)],[not(appl(P,F))])))))). % = interpunction lex('.', dl(0,dr(0,s,s),txt), lambda(SMOD,appl(appl(SMOD,lambda(_,drs([event(E)],[bool(E,=,'event?')]))),E))). lex('.', dl(0,lit(s(_)),lit(txt)), Sem) :- semantics(dot, Sem). lex('?', dl(0,lit(s(_)),lit(txt)), Sem) :- semantics(dot, Sem). lex('...', dl(0,lit(s(_)),lit(txt)), Sem) :- semantics(dot, Sem). lex('.', dl(0,lit(np(_,_,_)),lit(txt)), Sem) :- semantics(dot_np, Sem). lex('.', dl(0,lit(n),lit(txt)), lambda(N,merge(drs([variable(X)],[]),appl(N,X)))). lex(',', dr(0,dl(0,dl(0,lit(np(_,_,_)),lit(s(Tense))),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP,lambda(VP,lambda(P,merge(appl(NP,P),merge(drs([event(E)],Conds),appl(appl(VP,NP),E))))))) :- ( Tense = ppart -> Conds = [appl(background,E)] ; Tense = ppres -> Conds = [appl(continuing,E)] ; Conds = [] ). lex(',', dr(0,dl(0,dl(0,lit(np(nom,_,_)),lit(s(S))),dl(0,lit(np(nom,_,_)),lit(s(S)))),dl(0,lit(np(nom,_,_)),lit(s(_)))),lambda(P,lambda(Q,lambda(N,lambda(E,merge(merge(drs([],[appl(appl(simultanée,F),E)]),appl(appl(P,N),F)),appl(appl(Q,N),E))))))). lex(',', dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(narration,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(';', dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(background,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex(':', dr(0,dl(0,lit(s(S)),lit(s(S))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(explanation,E),F)]),merge(appl(P,E),appl(Q,F))))))). lex('-', dr(0,dl(0,lit(s(_)),lit(s(_))),lit(s(_))), lambda(P,lambda(Q,lambda(F,merge(drs([event(E),event(F)],[appl(appl(background,E),F)]),merge(appl(P,E),appl(Q,F))))))). % appositive relative clauses are treated as presuppositions (this is an oversimplification, unlike presuppositions, they cannot be cancelled though they do project) lex(',', dr(0,dl(0,dl(0,n,n),lit(np(_,_,_))),lit(np(_,_,_))), lambda(NP,lambda(ADJ,lambda(P,appl(NP,lambda(X,presup(appl(appl(ADJ,lambda(_,drs([],[]))),X),appl(P,X)))))))). lex(',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,n,n)), lambda(ADJ,lambda(NP,lambda(P,appl(NP,lambda(X,presup(appl(appl(ADJ,lambda(_,drs([],[]))),X),appl(P,X)))))))). lex('-', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,n,n)), lambda(ADJ,lambda(NP,lambda(P,appl(NP,lambda(X,presup(appl(appl(ADJ,lambda(_,drs([],[]))),X),appl(P,X)))))))). lex('(', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,n,n)), lambda(ADJ,lambda(NP,lambda(P,appl(NP,lambda(X,presup(appl(appl(ADJ,lambda(_,drs([],[]))),X),appl(P,X)))))))). lex(y, dr(0,s,s), lambda(S,lambda(E,merge(drs([variable(X)],[bool(X,=,'lieu?')]),appl(S,E))))). lex(y, dr(0,s,dr(0,s,dia(1,box(1,pp_a)))), lambda(P,lambda(E,merge(drs([],[bool(Y,=,'lieu?')]),appl(appl(P,lambda(R,appl(R,Y))),E))))). lex(y, dr(0,dl(0,lit(np(_,_,_)),lit(s(Z))),dl(0,lit(np(_,_,_)),lit(s(Z)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(X,=,'lieu?'),appl(appl(à,X),E)]),appl(appl(P,Q),E)))))). lex(y, dr(0,dl(0,cl_r,dl(0,lit(np(_,_,_)),lit(s(Z)))),dl(0,cl_r,dl(0,lit(np(_,_,_)),lit(s(Z))))), lambda(P,lambda(Cl,lambda(Q,lambda(E,merge(drs([],[bool(X,=,'lieu?'),appl(appl(à,X),E)]),appl(appl(appl(P,Cl),Q),E))))))). lex(y, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?')]),appl(appl(appl(P,lambda(R,appl(R,Y))),Q),E)))))). lex(y, dr(0,dl(0,cl_r,dl(0,lit(np(_,_,_)),s)),dr(0,dl(0,cl_r,dl(0,lit(np(_,_,_)),s)),dia(1,box(1,pp_a)))), lambda(P,lambda(Cl,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?')]),appl(appl(appl(appl(P,lambda(R,appl(R,Y))),Cl),Q),E))))))). lex(en, dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), lambda(P,lambda(Q,lambda(E,merge(drs([variable(X)],[bool(X,=,'?'),appl(appl(de,X),E)]),appl(appl(P,Q),E)))))). lex(en, dr(0,dl(0,cl_r,dl(0,lit(np(_,_,_)),s)),dl(0,cl_r,dl(0,lit(np(_,_,_)),s))), lambda(P,lambda(Cl,lambda(Q,lambda(E,merge(drs([],[bool(X,=,'?'),appl(appl(de,X),E)]),appl(appl(appl(P,Cl),Q),E))))))). lex(en, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_de)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?')]),appl(appl(appl(P,lambda(R,appl(R,Y))),Q),E)))))). lex(en, dr(0,dl(0,cl_r,dl(0,np,s)),dr(0,dl(0,cl_r,dl(0,np,s)),dia(1,box(1,pp_de)))), lambda(P,lambda(Cl,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?')]),appl(appl(appl(appl(P,lambda(R,appl(R,Y))),Cl),Q),E))))))). lex(me, dr(0,dl(0,lit(np(_,_,_)),lit(s(Sent))),dr(0,dl(0,lit(np(_,_,_)),lit(s(Sent))),dia(1,box(1,lit(np(acc,_,_)))))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(orateur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex('m\'', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(orateur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(te, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(auditeur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex('t\'', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(auditeur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(nous, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,X)))),Q),E)))))). lex('Nous', dr(0,s,dr(0,s,dia(1,box(1,np)))), lambda(VP,lambda(E,appl(appl(VP,lambda(P,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,X)))),E)))). lex(nous, dr(0,s,dr(0,s,dia(1,box(1,np)))), lambda(VP,lambda(E,appl(appl(VP,lambda(P,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(P,X)))),E)))). lex(vous, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(X)],[appl(auditeur,X)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,X)))),Q),E)))))). lex(le, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'masculin?')]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(la, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'féminin?')]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex('l\'', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?')]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(les, dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,np)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?'),bool(num(Y),>,1)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(me, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(orateur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex('m\'', dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(orateur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(te, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(auditeur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex('t\'', dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(Y)],[appl(auditeur,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(nous, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(X),variable(Y)],[appl(orateur,X),bool(num(Y),>,1),bool(X,atomic_sub,Y)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,X)))),Q),E)))))). lex(vous, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([variable(X)],[appl(auditeur,X)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,X)))),Q),E)))))). lex(lui, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'masculin?')]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). lex(leur, dr(0,dl(0,np,s),dr(0,dl(0,np,s),dia(1,box(1,pp_a)))), lambda(P,lambda(Q,lambda(E,merge(drs([],[bool(Y,=,'?'),bool(num(Y),>,1)]),appl(appl(appl(P,lambda(R,merge(drs([],[]),appl(R,Y)))),Q),E)))))). % = autre lex(autre, lit(n), lambda(Y,presup(drs([variable(Z)],[bool(Z,=,'context?')]),drs([],[bool(bool(Y,intersect,Z),=,nil)])))). lex(autres, lit(n), lambda(X,presup(drs([variable(Z)],[bool(Z,=,'context?')]),drs([],[bool(X,empty_intersect,Z)])))). % = âgé de lex(âgés, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(N,X),appl(PP,lambda(Y,drs([],[bool(appl(âge,X),=,Y)])))))))). lex(âgé, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(N,X),appl(PP,lambda(Y,drs([],[bool(appl(âge,X),=,Y)])))))))). lex(âgées, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(N,X),appl(PP,lambda(Y,drs([],[bool(appl(âge,X),=,Y)])))))))). lex(âgée, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(N,X),appl(PP,lambda(Y,drs([],[bool(appl(âge,X),=,Y)])))))))). % = couvert de lex(couvert, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex(couverts, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex(couverte, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex(couvertes, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex('Couvert', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex('Couverts', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex('Couverte', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). lex('Couvertes', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(couvrir,X),Y)]))),appl(N,X)))))). % = accompagné de lex(accompagné, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex(accompagnés, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex(accompagnée, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex(accompagnées, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex('Accompagné', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex('Accompagnés', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex('Accompagnée', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). lex('Accompagnées', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(accompagner,X),Y)]))),appl(N,X)))))). % = suivi de lex(suivi, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex(suivis, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex(suivie, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex(suivies, dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex('Suivi', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex('Suivis', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex('Suivie', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). lex('Suivies', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(suivre,X),Y)]))),appl(N,X)))))). % = lié à lex(lié, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex(liés, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex(liée, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex(liées, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex('Lié', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex('Liés', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex('Liée', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). lex('Liées', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(lié_à,X),Y)]))),appl(N,X)))))). % = associé à lex(associé, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex(associés, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex(associée, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex(associées, dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex('Associé', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex('Associés', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex('Associée', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). lex('Associées', dr(0,dl(0,lit(n),lit(n)),lit(pp(à))), lambda(PP,lambda(N,lambda(X,merge(appl(PP,lambda(Y,drs([],[appl(appl(associé_à,X),Y)]))),appl(N,X)))))). % Z is the set of alternatives to X % Y is a member of these alternatives which is not equal to X % QUESTION: is it useful/necessary to have X as a member of Z as well? (it seems that the currect way, with X not a member of lex(autre, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z),variable(Y)],[bool(Z,=,?),bool(Y,atomic_sub,Z)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Y)])))))). lex(autres, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z),variable(Y)],[bool(Z,=,?),bool(Y,subseteq,Z)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Y)])))))). lex(différent, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z)],[bool(Z,=,?)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Z)])))))). lex(différents, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z)],[bool(Z,=,?)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Z)])))))). lex(différente, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z)],[bool(Z,=,?)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Z)])))))). lex(différentes, dr(0,lit(n),lit(n)), lambda(P,lambda(X,presup(merge(drs([variable(Z)],[bool(Z,=,?)]),appl(P,Z)),merge(appl(P,X),drs([],[bool(X,empty_intersect,Z)])))))). lex(ailleurs, dl(0,lit(n),lit(n)), lambda(P,lambda(X,presup(drs([variable(Z)],[bool(Z,=,?),appl(lieu,Z)]),merge(appl(P,X),drs([],[bool(X,neq,Z)])))))). lex(ailleurs, dl(1,s,s), lambda(S,lambda(E,presup(drs([variable(Z)],[bool(Z,=,?),appl(lieu,Z)]),merge(appl(S,E),drs([variable(X)],[appl(lieu,X),appl(appl(lieu,X),E),bool(X,neq,Z)])))))). % only sentence-initial "ainsi" can be a discourse connective lex('Ainsi', dr(0,s,s), lambda(S,lambda(E,merge(drs([],[bool(F,=,'event?'),appl(appl(result,E),F)]),appl(S,E))))). lex(ainsi, dr(0,s,s), lambda(S,lambda(E,merge(drs([],[bool(F,=,'event?'),appl(appl(result,E),F)]),appl(S,E))))). lex('Alors', dr(0,s,s), lambda(S,lambda(E,merge(drs([],[bool(F,=,'event?'),bool(bool(drs([],[appl(appl(result,E),F)]),\/,drs([],[appl(appl('result*',E),F)])),\/,drs([],[appl(appl(narration,E),F)]))]),appl(S,E))))). lex(alors, dr(0,s,s), lambda(S,lambda(E,merge(drs([],[bool(F,=,'event?'),bool(bool(drs([],[appl(appl(result,E),F)]),\/,drs([],[appl(appl('result*',E),F)])),\/,drs([],[appl(appl(narration,E),F)]))]),appl(S,E))))). lex(quand, dr(0,s_q,s), lambda(S,lambda(E,merge(drs([],[bool(appl(temps,E),=,'context?')]),appl(S,E))))). lex(quand, dr(0,s_whq,s), lambda(S,lambda(E,merge(drs([],[appl('quand?',E)]),appl(S,E))))). lex('Quand', dr(0,s_q,s), lambda(S,lambda(E,merge(drs([],[bool(appl(temps,E),=,'context?')]),appl(S,E))))). lex('Quand', dr(0,s_whq,s), lambda(S,lambda(E,merge(drs([],[appl('quand?',E)]),appl(S,E))))). lex('Combien', dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, merge(drs([],[appl('combien?',E)]),appl(S,E))))). lex(combien, dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, merge(drs([],[appl('combien?',E)]),appl(S,E))))). lex(combien, dr(0,dr(0,s_whq,dr(0,s,dia(1,box(1,np)))),pp_de), lambda(PP,lambda(SNP,lambda(E,appl(PP,lambda(X,merge(drs([],[appl(appl('combien?',X),E)]),appl(appl(SNP,lambda(P,appl(P,X))),E)))))))). lex(combien, dr(0,dr(0,s_whq,dl(0,np,s)),pp_de), lambda(PP,lambda(VP,lambda(E,appl(PP,lambda(X,merge(drs([],[appl(appl('combien?',X),E)]),appl(appl(VP,lambda(P,appl(P,X))),E)))))))). lex('Comment', dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('comment?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). lex('Comment', dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('comment?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex(comment, dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('comment?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). lex(comment, dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('comment?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex('Pourquoi', dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('pourquoi?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). lex('Pourquoi', dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('pourquoi?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex(pourquoi, dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('pourquoi?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). lex(pourquoi, dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('pourquoi?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex('Où', dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('lieu?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex(où, dr(0,lit(s(whq)),dl(0,np,lit(s(inf(_))))), lambda(INF, lambda(E, drs([],[appl('lieu?',E),drs_label(E,merge(drs([event(F),variable(Y)],[appl(generic,Y)]),appl(appl(INF,lambda(P,appl(P,Y))),F)))])))). lex('Où', dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('lieu?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). lex('où', dr(0,lit(s(whq)),lit(s(main))), lambda(S, lambda(E, drs([],[appl('lieu?',E),drs_label(E,merge(drs([event(F)],[]),appl(S,F)))])))). %lex('Que', dr(0,s_whq,dr(0,s,dia(1,box(1,np)))), lambda(P, lambda(E, appl(appl(P,lambda(R,merge(drs([variable(X)],[bool(X,=,'?')]),appl(R,X)))),E)))). lex('Que', dr(0,s_whq,dr(0,s,dia(1,box(1,np)))), lambda(P, lambda(E, merge(drs([variable(X)],[bool(X,=,'?')]),appl(appl(P,lambda(R,appl(R,X))),E))))). % P ((e->t)->t)->s->t % R (e->t) %lambda(NPS,lambda(E,appl(NPS,lambda(X,drs([variable(X)],[appl(sleep,X)]))))) %wh_rel_semantics(lambda(P,lambda(Q,lambda(X,merge(appl(Q,X),merge(drs([event(E)],[]),appl(appl(P,lambda(R,appl(R,X))),E))))))). % ladite ledit lex(été, dr(0,dl(0,np,s_ppart),dl(0,np,s_pass)), lambda(VP,lambda(NP,lambda(E,presup(drs(Es,Cs),appl(appl(VP,NP),E)))))) :- pos_time(ver:pper, [], Es, E-Cs). lex(été, dr(0,dl(0,np,lit(s(_))),dl(0,np,lit(s(ppart)))), Sem) :- auxiliary_verb_etre(ver:pper, [], Sem). lex(à, dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), lambda(P,lambda(S,lambda(E,merge(merge(drs([event(F)],[appl(appl(à,E),F)]),appl(S,E)),appl(appl(P,merge(drs([variable(X)],[]),lambda(Q,appl(Q,X)))),F)))))). lex(',', dl(0,n,n), lambda(X,X)). lex(',', dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(X,X)). lex(',', dl(0,lit(s(S)),lit(s(S))), lambda(X,X)). lex(',', dr(0,lit(s(S)),lit(s(S))), lambda(X,X)). lex((','), dl(0,n,n), lambda(X,X)). lex((','), dl(0,lit(np(_,_,_)),lit(np(_,_,_))), lambda(X,X)). lex((','), dl(0,lit(s(S)),lit(s(S))), lambda(X,X)). lex((','), dr(0,lit(s(S)),lit(s(S))), lambda(X,X)). lex(',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(N,X),appl(P,X)))))))). lex('(', dr(0,dl(0,n,n),lit(np(_,_,_))), lambda(NP, lambda(N, lambda(X, merge(appl(N,X),drs([],[appl(NP,lambda(_,drs([],[])))])))))). lex('(', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), lambda(N,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(N,X),drs([],[appl(P,X)])))))))). lex('(', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(s(_))), lambda(S,lambda(NP,lambda(P,appl(NP,lambda(X,merge(appl(P,X),merge(drs([event(E)],[appl(appl(background,X),E)]),appl(S,E))))))))). lex('(', dr(0,dl(0,n,n),s), lambda(S,lambda(N,lambda(X,merge(appl(N,X),merge(drs([event(E)],[appl(appl(background,X),E)]),appl(S,E))))))). lex('(', dr(0,dl(1,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(background,F),E)]),merge(appl(P,E),appl(Q,F))))))). lex('-', dr(0,dl(1,s,s),s), lambda(P,lambda(Q,lambda(E,merge(drs([event(F)],[appl(appl(background,F),E)]),merge(appl(P,E),appl(Q,F))))))). example_phrase(pos_lemma, "Le ciel couvert de nuages dort.", ['Les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'ciel', nom, 'ciel', lit(n), 'couvert', adj, 'couvrir', dr(0,dl(0,lit(n),lit(n)),lit(pp(de))), 'de', prp, de, dr(0,lit(pp(de)),lit(n)), nuages, nom, nuage, lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, " J\' aurai quitté Paris dans dix minutes.", ['J\'', pro:per, 'je', lit(np(_,_,_)), 'aurai', ver:futu, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'quitte', ver:pper, 'quitter', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), 'Paris', nam, 'Paris', lit(np(_,_,_)), 'dans_dix_minutes', adv, 'dans_dix_minutes', dl(1,lit(s(X)),lit(s(X))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, " J\' avais pris un pomme hier.", ['J\'', pro:per, 'je', lit(np(_,_,_)), 'avais', ver:impf, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'pris', ver:pper, 'pris', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'pomme', nom, 'pomme', n, 'hier', adv, 'hier', dl(1,lit(s(X)),lit(s(X))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, " J\' eut pris un pomme hier.", ['J\'', pro:per, 'je', lit(np(_,_,_)), 'eut', ver:simp, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'pris', ver:pper, 'pris', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'pomme', nom, 'pomme', n, 'hier', adv, 'hier', dl(1,lit(s(X)),lit(s(X))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean vient de nulle part ailleurs.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'vient', ver:pres, 'venir', dr(0,dl(0,lit(np(_,_,_)),s),lit(pp(de))), de, prp, de, dr(0,lit(pp(de)),lit(n)), 'nulle', adj, 'nul', dr(0,lit(n),lit(n)), part, nom, part, lit(n), ailleurs, adj, ailleurs, dl(0,lit(n),lit(n)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean vient de quelque part.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'vient', ver:pres, 'venir', dr(0,dl(0,lit(np(_,_,_)),s),lit(pp(de))), de, prp, de, dr(0,lit(pp(de)),lit(n)), 'quelque', adj, 'quelque', dr(0,lit(n),lit(n)), part, nom, part, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean va nulle part.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'va', ver:pres, 'aller', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'nulle', adj, 'nul', dr(0,lit(np(_,_,_)),lit(n)), part, nom, part, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean va quelque part ailleurs.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'va', ver:pres, 'aller', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'quelque', adj, 'quelque', dr(0,lit(np(_,_,_)),lit(n)), part, nom, part, lit(n), ailleurs, adj, ailleurs, dl(0,lit(n),lit(n)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Comment dort Jean ?", ['Comment', adv, comment, dr(0,lit(s(whq)),lit(s(_))), dort, ver:pres, dormir, dr(0,lit(s(_)),lit(np(_,_,_))), 'Jean', nam, 'Jean', lit(np(_,_,_)), '?', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Aucun étudiant arrêtait de fumer.", ['Aucun', pro:ind, 'aucun', dr(0,lit(np(_,_,_)),lit(n)), 'étudiant', nom, 'étudiant', lit(n), 'arrêtait', ver:pres, 'arrêter', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf(de))))), de, prp, de, dr(0,dl(0,lit(np(_,_,_)),lit(s(inf(de)))),dl(0,lit(np(_,_,_)),lit(s(inf)))), fumer, ver:infi, fumer, dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean persuade personne de fumer.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'persuade', ver:pres, 'persuader', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf(de))))),lit(np(_,_,_))), personne, pro:ind, personne, lit(np(_,_,_)), de, prp, de, dr(0,dl(0,lit(np(_,_,_)),lit(s(inf(de)))),dl(0,lit(np(_,_,_)),lit(s(inf)))), fumer, ver:infi, fumer, dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Il pleut.", ['Il', pro:pre, il, lit(np(_,_,_)), 'pleut', ver:pres, dl(0,lit(np(_,_,_)),lit(s(_))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean parait dormir.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'parait', ver:pres, 'paraître', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf)))), 'dormir', ver:infi, 'dormir', dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean quitte Bordeaux.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'quitte', ver:pres, 'quitter', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'Bordeaux', nam, 'Bordeaux', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean ne quitte pas Bordeaux.", ['Jean', nam, 'Jean', lit(np(_,_,_)), ne, adv, ne, dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'quitte', ver:pres, 'quitter', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), pas, adv, pas, dl(1,s,s), 'Bordeaux', nam, 'Bordeaux', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean semble dormir.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'semble', ver:pres, 'sembler', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf)))), 'dormir', ver:infi, 'dormir', dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean arrive.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'arrive', ver:pres, 'arriver', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean va à Bordeaux.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'va', ver:pres, 'aller', dr(0,dl(0,lit(np(_,_,_)),s),lit(pp(à))), à, prp, à, dr(0,lit(pp(à)),lit(np(_,_,_))), 'Bordeaux', nam, 'Bordeaux', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean arrête de fumer.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'arrête', ver:pres, 'arrêter', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf(de))))), de, prp, de, dr(0,dl(0,lit(np(_,_,_)),lit(s(inf(de)))),dl(0,lit(np(_,_,_)),lit(s(inf)))), fumer, ver:infi, fumer, dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean revient à Bordeaux.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'revient', ver:pres, 'revenir', dr(0,dl(0,lit(np(_,_,_)),s),lit(pp(à))), 'à', prp, 'à', dr(0,lit(pp(à)),lit(np(_,_,_))), 'Bordeaux', nam, 'Bordeaux', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean vient de partir.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'vient', ver:pres, 'venir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf(de))))), de, prp, de, dr(0,dl(0,lit(np(_,_,_)),lit(s(inf(de)))),dl(0,lit(np(_,_,_)),lit(s(inf)))), partir, ver:infi, partir, dl(0,lit(np(_,_,_)),lit(s(inf))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime un douzaine de films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'un', det:art, 'um', dr(0,lit(np(_,_,_)),lit(n)), douzaine, num, douzaine, lit(n), de, prp, de, dr(0,dl(0,lit(n),lit(n)),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime des dizaines de films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'des', prp:det, 'des', dr(0,lit(np(_,_,_)),lit(n)), dizaines, nom, dizaine, lit(n), de, prp, de, dr(0,dl(0,lit(n),lit(n)),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime quatre des films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'quatre', num, 'quatre', lit(np(_,_,_)), des, prp:det, des, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime que Marie.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'que', adv, 'que', dr(0,lit(np(_,_,_)),lit(np(_,_,_))), 'Marie', nam, 'Marie', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). % TODO: fix combination of "que" and "NUM des" example_phrase(pos_lemma, "Jean aime que quatre des films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'que', adv, 'que', dr(0,lit(np(_,_,_)),lit(np(_,_,_))), 'quatre', num, 'quatre', lit(np(_,_,_)), des, prp:det, des, dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le meilleur acteur dort.", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'meilleur', adj, 'meilleur', dr(0,lit(n),lit(n)), 'acteur', nom, 'acteur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Les meilleurs acteur dorment.", ['Les', det:art, 'les', dr(0,lit(np(_,_,_)),lit(n)), 'meilleurs', adj, 'meilleurs', dr(0,lit(n),lit(n)), 'acteurs', nom, 'acteur', lit(n), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le acteur le plus intéressant dort.", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'acteur', nom, 'acteur', lit(n), 'le', det:art, 'le', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'plus', adv, 'plus', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'intéressant', adj, 'intéressant', dl(0,lit(n),lit(n)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un acteur plus intéressant que Jean dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'acteur', nom, 'acteur', lit(n), 'plus', adv, 'plus', dr(0,dr(0,dl(0,lit(n),lit(n)),lit(s(q))),dl(0,lit(n),lit(n))), 'intéressant', adj, 'intéressant', dl(0,lit(n),lit(n)), 'que', kon, 'que', dr(0,lit(s(q)),lit(np(_,_,_))), 'Jean', nam, 'Jean', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Les acteurs les plus intéressants dorment.", ['Les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'acteurs', nom, 'acteur', lit(n), 'les', det:art, 'le', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'plus', adv, 'plus', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'intéressants', adj, 'intéressant', dl(0,lit(n),lit(n)), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Les acteurs les moins intéressants dorment.", ['Les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'acteurs', nom, 'acteur', lit(n), 'les', det:art, 'le', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'moins', adv, 'moins', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'intéressants', adj, 'intéressant', dl(0,lit(n),lit(n)), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Les acteurs les moins intéressants dorment.", ['Les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'acteurs', nom, 'acteur', lit(n), 'les', det:art, 'le', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'moins', adv, 'moins', dr(0,dl(0,lit(n),lit(n)),dl(0,lit(n),lit(n))), 'verts', adj, 'vert', dl(0,lit(n),lit(n)), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un faux fumeur dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'faux', adj, 'faux', dr(0,lit(n),lit(n)), 'fumeur', nom, 'fumeur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un présumé fumeur dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'présumé', adj, 'présumé', dr(0,lit(n),lit(n)), 'fumeur', nom, 'fumeur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un ex-fumeur dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'ex-', adv, 'ex-', dr(0,lit(n),lit(n)), 'fumeur', nom, 'fumeur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un non-fumeur dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'non-', adv, 'non-', dr(0,lit(n),lit(n)), 'fumeur', nom, 'fumeur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Un gros fumeur dort.", ['Un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'gros', adj, 'gros', dr(0,lit(n),lit(n)), 'fumeur', nom, 'fumeur', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "L\'ancien président dort.", ['L\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'ancien', adj, 'ancien', dr(0,lit(n),lit(n)), 'président', nom, 'président', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Les anciennes ministres dorment.", ['Les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'anciennes', adj, 'ancien', dr(0,lit(n),lit(n)), 'ministres', nom, 'ministre', lit(n), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Tous les anciennes ministres dorment.", ['Tous', adv:adv, 'tout', dr(0,lit(np(_,_,_)),lit(np(_,_,_))), 'les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'anciennes', adj, 'ancien', dr(0,lit(n),lit(n)), 'ministres', nom, 'ministre', lit(n), 'dorment', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le futur président dort.", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'futur', adj, 'futurx', dr(0,lit(n),lit(n)), 'président', nom, 'président', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean sait que Marie dort .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'sait', ver:pres, 'savoir', dr(0,dl(0,lit(np(_,_,_)),s),lit(s(q))), 'que', kon, 'que', dr(0,lit(s(q)),s), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime sa fille.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'sa', det:pos, 'son', dr(0,lit(np(_,_,_)),lit(n)), 'fille', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime ma fille.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'ma', det:pos, 'mon', dr(0,lit(np(_,_,_)),lit(n)), 'fille', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime ses filles.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'ses', det:pos, 'son', dr(0,lit(np(_,_,_)),lit(n)), 'filles', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime mes filles.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'mes', det:pos, 'mon', dr(0,lit(np(_,_,_)),lit(n)), 'filles', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime notre fille.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'notre', det:pos, 'notre', dr(0,lit(np(_,_,_)),lit(n)), 'fille', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime votre fille.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'votre', det:pos, 'votre', dr(0,lit(np(_,_,_)),lit(n)), 'fille', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime nos filles.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'nos', det:pos, 'notre', dr(0,lit(np(_,_,_)),lit(n)), 'filles', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime vos filles.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'vos', det:pos, 'votre', dr(0,lit(np(_,_,_)),lit(n)), 'filles', nom, fille, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Pierre aime l'une.", ['Pierre', nam, 'Pierre', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'une', num, un, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime l'autre.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'autre', adj, autre, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime une autre.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'autre', adj, autre, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime les autres.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'autres', adj, autre, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime l'un des films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'un', num, un, lit(n), des, prp:det, des, dr(0,dl(0,lit(n),lit(n)),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime l'un de mes films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'un', num, un, lit(n), de, prp, de, dr(0,dl(0,lit(n),lit(n)),lit(np(_,_,_))), 'mes', det:pos, 'mon', dr(0,lit(np(_,_,_)),lit(n)), films, nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime un autre film.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),lit(n)), 'autre', adj, autre, dr(0,lit(n),lit(n)), 'film', nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime l'autre film.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'autre', adj, autre, dr(0,lit(n),lit(n)), 'film', nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime des autres films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'des', det:art, 'des', dr(0,lit(np(_,_,_)),lit(n)), 'autres', adj, autre, dr(0,lit(n),lit(n)), 'films', nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime les autres films.", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'les', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'autres', adj, autre, dr(0,lit(n),lit(n)), 'films', nom, film, lit(n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean se souvient que Marie dort .", ['Jean', nam, 'Jean', lit(np(_,_,_)), se, pro:per, se, lit(cl_r), 'souvient', ver:pres, 'souvenir', dr(0,dl(0,lit(cl_r),dl(0,lit(np(_,_,_)),s)),lit(s(q))), 'que', kon, 'que', dr(0,lit(s(q)),s), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean croit que Marie dort .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'croit', ver:pres, 'croire', dr(0,dl(0,lit(np(_,_,_)),s),lit(s(q))), 'que', kon, 'que', dr(0,lit(s(q)),s), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le fait que Marie dort surprend Jean.", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), fait, nom, fait, lit(n), 'que', kon, 'que', dr(0,dl(0,lit(n),lit(n)),lit(s(q))), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), surprend, ver:pres, surprendre, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),lit(np(_,_,_))), 'Jean', nam, 'Jean', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le idée que Marie dort semble bizarre.", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),lit(n)), 'idée', nom, 'idée', lit(n), 'que', kon, 'que', dr(0,dl(0,lit(n),lit(n)),lit(s(q))), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), semble, ver:pres, sembler, dr(0,dl(0,lit(np(_,_,_)),lit(s(_))),dl(0,lit(n),lit(n))), bizarre, adj, bizarre, dl(0,lit(n),lit(n)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean regret aimer Marie .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'regrette', ver:pres, 'regretter', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),lit(s(inf)))), 'aimer', ver:infi, 'aimer', dr(0,dl(0,lit(np(_,_,_)),lit(s(inf))),lit(np(_,_,_))), 'Marie', nam, 'Marie', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! nous parvînmes au sommet du Néthou où nous retrouvâmes intacte la petite pyramide que nous y avions construite .", ['nous', pro:per, 'nous', lit(np(_,_,_)), 'parvînmes', ver:simp, 'parvenir', dr(0,dl(0,lit(np(_,_,_)),s),pp_a), 'au', prp:det, 'au', dr(0,pp_a,n), 'sommet', nom, 'sommet', n, 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'Néthou', nam, 'Néthou', n, 'où', pro:rel, 'où', dr(0,dl(0,n,n),s), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'retrouvâmes', ver:simp, 'retrouver', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))),dl(0,n,n)), 'intacte', adj, 'intact', dl(0,n,n), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'petite', adj, 'petit', dr(0,n,n), 'pyramide', nom, 'pyramide', n, 'que', pro:rel, 'que', dr(0,dl(0,n,n),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'avions', ver:impf, 'avoir', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ppart)), 'construite', ver:pper, 'construire', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! nous parvînmes au sommet du Néthou où nous retrouvâmes intacte la petite pyramide que nous y avions construite .", ['nous', pro:per, 'nous', lit(np(_,_,_)), 'parvînmes', ver:simp, 'parvenir', dr(0,dl(0,lit(np(_,_,_)),s),pp_a), 'au', prp:det, 'au', dr(0,pp_a,n), 'sommet', nom, 'sommet', n, 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'Néthou', nam, 'Néthou', n, 'où', pro:rel, 'où', dr(0,dl(0,n,n),s), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'retrouvâmes', ver:simp, 'retrouver', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))),dl(0,n,n)), 'intacte', adj, 'intact', dl(0,n,n), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'petite', adj, 'petit', dr(0,n,n), 'pyramide', nom, 'pyramide', n, 'que', pro:rel, 'que', dr(0,dl(0,n,n),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'avions', ver:impf, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'construite', ver:pper, 'construire', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! C\' est au cours du printemps 1787 , que Ramond vînt aux Pyrénées .", ['C\'', pro:dem, 'ce', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),cs),pp), 'au', prp:det, 'au', dr(0,pp_a,n), 'cours', nom, 'cours', n, 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'printemps', nom, 'printemps', n, '1787', num, '1787', dl(0,n,n), 'que', kon, 'que', dr(0,cs,s), 'Ramond', nam, 'Ramond', lit(np(_,_,_)), 'vînt', ver:simp, 'venir', dr(0,dl(0,lit(np(_,_,_)),s),pp_a), 'aux', prp:det, 'aux', dr(0,pp_a,n), 'Pyrénées', nam:lfp, 'Pyrénées', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Une singulière contingence l\' y amena .", ['Une', det:art, 'une', dr(0,lit(np(_,_,_)),n), 'singulière', adj, 'singulier', dr(0,n,n), 'contingence', nom, 'contingence', n, 'l\'', pro:per, 'le_la', cl_3a, 'y', pro:per, 'y', cl_y, 'amena', ver:simp, 'amener', dl(0,cl_y,dl(0,cl_3a,dl(0,lit(np(_,_,_)),s))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Une singulière contingence l\' y amena .", ['Une', det:art, 'une', dr(0,lit(np(_,_,_)),n), 'singulière', adj, 'singulier', dr(0,n,n), 'contingence', nom, 'contingence', n, 'l\'', pro:per, 'le_la', cl_3a, 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), 'amena', ver:simp, 'amener', dr(0,dl(0,cl_3a,dl(0,lit(np(_,_,_)),s)),pp_a), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! A peine arrivé au Lac d\' Oncet , il est frappé du « grand caractère » qu\' y revêtent les rochers et les » sommets hérissés »", ['arrivé', ver:pper, 'arriver', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_a), 'au', prp:det, 'au', dr(0,pp_a,n), 'Lac', nam, 'Lac', n, 'd\'', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Oncet', nam, 'Oncet', lit(np(_,_,_)), ',', pun, ',', dr(0,dl(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))),lit(np(_,_,_))), 'il', pro:per, 'il', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'frappé', ver:pper, 'frapper', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_de), 'du', prp:det, 'du', dr(0,pp_de,n), 'grand', adj, 'grand', dr(0,n,n), 'caractère', nom, 'caractère', n, 'qu\'', pro:rel, 'que', dr(0,dl(0,n,n),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'y', pro:per, 'y', cl_y, 'revêtent', ver:pres, 'revêtir', dr(0,dr(0,dl(0,cl_y,s),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'rochers', nom, 'rocher', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'sommets', nom, 'sommet', n, 'hérissés', ver:pper, 'hérisser', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! A peine arrivé au Lac d\' Oncet , il est frappé du « grand caractère » qu\' y revêtent les rochers et les » sommets hérissés »", ['arrivé', ver:pper, 'arriver', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_a), 'au', prp:det, 'au', dr(0,pp_a,n), 'Lac', nam, 'Lac', n, 'd\'', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Oncet', nam, 'Oncet', lit(np(_,_,_)), ',', pun, ',', dr(0,dl(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))),lit(np(_,_,_))), 'il', pro:per, 'il', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'frappé', ver:pper, 'frapper', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_de), 'du', prp:det, 'du', dr(0,pp_de,n), 'grand', adj, 'grand', dr(0,n,n), 'caractère', nom, 'caractère', n, 'qu\'', pro:rel, 'que', dr(0,dl(0,n,n),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'y', pro:per, 'y', dr(0,s,s), 'revêtent', ver:pres, 'revêtir', dr(0,dr(0,s,lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'rochers', nom, 'rocher', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'sommets', nom, 'sommet', n, 'hérissés', ver:pper, 'hérisser', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Arrivé à Gavarnie , il lui suffit d\' élever ses regards vers le Marbore , pour y distinguer « des glaces » , qui se dégageaient des neiges dont elles étaient entourées .", ['Arrivé', ver:pper, 'arriver', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_a), 'à', prp, 'à', dr(0,pp_a,lit(np(_,_,_))), 'Gavarnie', nam:lm, 'Gavarnie', lit(np(_,_,_)), ',', pun, ',', dr(0,dl(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))),lit(np(_,_,_))), 'il', pro:per, 'il', lit(np(_,_,_)), 'lui', pro:per, 'lui', cl_3d, 'suffit', ver:pres, 'suffire', dr(0,dl(0,cl_3d,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_deinf)), 'd\'', prp, 'de', dr(0,dl(0,lit(np(_,_,_)),s_deinf),dl(0,lit(np(_,_,_)),s_inf)), 'élever', ver:infi, 'élever', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), 'ses', det:pos, 'ses', dr(0,lit(np(_,_,_)),n), 'regards', nom, 'regard', n, 'vers', prp, 'vers', dr(0,dl(1,s,s),lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'Marbore', nam, 'Marbore', n, 'pour', prp, 'pour', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), 'y', pro:per, 'y', cl_y, 'distinguer', ver:infi, 'distinguer', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s_inf)),lit(np(_,_,_))), 'des', prp:det, 'des', dr(0,lit(np(_,_,_)),n), 'glaces', nom, 'glace', n, 'qui', pro:rel, 'qui', dr(0,dl(0,n,n),dl(0,lit(np(_,_,_)),s)), 'se', pro:per, 'se', cl_12r, 'dégageaient', ver:impf, 'dégager', dr(0,dl(0,cl_12r,dl(0,lit(np(_,_,_)),s)),pp_de), 'des', prp:det, 'des', dr(0,pp_de,n), 'neiges', nom, 'neige', n, 'dont', pro:rel, 'dont', dr(0,dl(0,n,n),dr(0,s,dia(1,box(1,pp_de)))), 'elles', pro:per, 'elles', lit(np(_,_,_)), 'étaient', ver:impf, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'entourées', ver:pper, 'entourer', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_de), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il lui tarde d\' atteindre la vallée d\' Aran , pour comparer les hauteurs qui la couronnent avec celles qu\' il vient d\' observer .", ['Il', pro:per, 'il', lit(np(_,_,_)), 'lui', pro:per, 'lui', cl_3d, 'tarde', ver:pres, 'tarder', dr(0,dl(0,cl_3d,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_deinf)), 'd\'', prp, 'de', dr(0,dl(0,lit(np(_,_,_)),s_deinf),dl(0,lit(np(_,_,_)),s_inf)), 'atteindre', ver:infi, 'atteindre', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'vallée', nom, 'vallée', n, 'd\'', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Aran', nam, 'Aran', lit(np(_,_,_)), 'pour', prp, 'pour', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), 'comparer', ver:infi, 'comparer', dr(0,dr(0,dl(0,lit(np(_,_,_)),s_inf),pp),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'hauteurs', nom, 'hauteur', n, 'qui', pro:rel, 'qui', dr(0,dl(0,n,n),dl(0,lit(np(_,_,_)),s)), 'la', pro:per, 'la', cl_3a, 'couronnent', ver:pres, 'couronner', dl(0,cl_3a,dl(0,lit(np(_,_,_)),s)), 'avec', prp, 'avec', dr(0,pp_avec,lit(np(_,_,_))), 'celles', pro:dem, 'celles', lit(np(_,_,_)), 'qu\'', pro:rel, 'que', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'il', pro:per, 'il', lit(np(_,_,_)), 'vient', ver:pres, 'venir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_deinf)), 'd\'', prp, 'de', dr(0,dl(0,lit(np(_,_,_)),s_deinf),dl(0,lit(np(_,_,_)),s_inf)), 'observer', ver:infi, 'observer', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il y va directement par les cols et les forts .", ['Il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'va', ver:pres, 'aller', dl(0,cl_y,dl(0,lit(np(_,_,_)),s)), 'directement', adv, 'directement', dl(1,s,s), 'par', prp, 'par', dr(0,dl(1,s,s),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'cols', nom, 'col', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'forts', nom, 'fort', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il y va directement par les cols et les forts .", ['Il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), 'va', ver:pres, 'aller', dr(0,dl(0,lit(np(_,_,_)),s),pp_a), 'directement', adv, 'directement', dl(1,s,s), 'par', prp, 'par', dr(0,dl(1,s,s),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'cols', nom, 'col', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'forts', nom, 'fort', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! il se rendait à Barèges , dont les eaux furent toujours « nécessaires à sa santé » et les « âpres montagnes » chères à son coeur .", ['il', pro:per, 'il', lit(np(_,_,_)), 'se', pro:per, 'se', cl_12r, 'rendait', ver:impf, 'rendre', dr(0,dl(0,cl_12r,dl(0,lit(np(_,_,_)),s)),pp_a), 'à', prp, 'à', dr(0,pp_a,lit(np(_,_,_))), 'Barèges', nam, 'Barèges', lit(np(_,_,_)), 'dont', pro:rel, 'dont', dr(0,dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'eaux', nom, 'eau', n, 'furent', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,n,n)), 'nécessaires', adj, 'nécessaire', dr(0,dl(0,n,n),pp_a), 'à', prp, 'à', dr(0,pp_a,lit(np(_,_,_))), 'sa', det:pos, 'sa', dr(0,lit(np(_,_,_)),n), 'santé', nom, 'santé', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'âpres', adj, 'âpre', dr(0,n,n), 'montagnes', nom, 'montagne', n, 'chères', adj, 'cher', dr(0,dl(0,n,n),pp_a), 'à', prp, 'à', dr(0,pp_a,lit(np(_,_,_))), 'son', det:pos, 'son', dr(0,lit(np(_,_,_)),n), 'coeur', nom, 'coeur', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il y passait l\' été et les premiers jours de l\' automne ...", ['Il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'passait', ver:impf, 'passer', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'été', nom, 'été', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'premiers', num, 'premiers', dr(0,n,n), 'jours', nom, 'jours', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'automne', nom, 'automne', n, '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il y passait l\' été et les premiers jours de l\' automne ...", ['Il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'passait', ver:impf, 'passer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'été', nom, 'été', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'premiers', num, 'premiers', dr(0,n,n), 'jours', nom, 'jours', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'automne', nom, 'automne', n, '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "? J\' ai pris le parti de faire venir de Paris ce que j\' y avais laissé ...", ['J\'', pro:per, 'je', lit(np(_,_,_)), 'ai', ver:pres, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'pris', ver:pper, 'pris', dr(0,dr(0,dl(0,lit(np(_,_,_)),s_ppart),dl(0,lit(np(_,_,_)),s_deinf)),lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'parti', nom, 'parti', n, 'de', prp, 'de', dr(0,dl(0,lit(np(_,_,_)),s_deinf),dl(0,lit(np(_,_,_)),s_inf)), 'faire', ver:infi, 'faire', dr(0,dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),s_inf)), 'venir', ver:infi, 'venir', dr(0,dl(0,lit(np(_,_,_)),s_inf),pp_de), 'de', prp, 'de', dr(0,pp_de,lit(np(_,_,_))), 'Paris', nam, 'Paris', lit(np(_,_,_)), 'ce', pro:dem, 'ce', lit(np(_,_,_)), 'que', pro:rel, 'que', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'j\'', pro:per, 'je', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'avais', ver:impf, 'avoir', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ppart)), 'laissé', ver:pper, 'laisser', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! A Maladette j\' y fus trompé un moment par rapport à son revêtement , j\' ai pu corriger mon erreur .", ['A', prp, 'a', dr(0,dr(0,s,s),lit(np(_,_,_))), 'Maladette', nam, 'Maladette', lit(np(_,_,_)), 'j\'', pro:per, 'je', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'fus', ver:simp, 'être', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ppart)), 'trompé', ver:pper, 'tromper', dl(0,lit(np(_,_,_)),s_ppart), 'un', det:art, 'un', dr(0,dl(1,s,s),n), 'moment', nom, 'moment', n, 'par', prp, 'par', dr(0,dl(1,s,s),n), 'rapport', nom, 'rapport', dr(0,n,pp_a), 'à', prp, 'à', dr(0,pp_a,lit(np(_,_,_))), 'son', det:pos, 'son', dr(0,lit(np(_,_,_)),n), 'revêtement', nom, 'revêtement', n, ',', pun, ',', dr(0,dl(0,s,s),s), 'j\'', pro:per, 'je', lit(np(_,_,_)), 'ai', ver:pres, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'pu', ver:pper, 'pu', dr(0,dl(0,lit(np(_,_,_)),s_ppart),dl(0,lit(np(_,_,_)),s_inf)), 'corriger', ver:infi, 'corriger', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), 'mon', det:pos, 'mon', dr(0,lit(np(_,_,_)),n), 'erreur', nom, 'erreur', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Le lac ne m\' a offert ni plantes ni animaux .", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'lac', nom, 'lac', n, 'ne', adv, 'ne', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'm\'', pro:per, 'me', cl_12r, 'a', ver:pres, 'avoir', dr(0,dl(0,cl_12r,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ppart)), 'offert', ver:pper, 'offrir', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), 'ni', kon, 'ni', dr(0,lit(np(_,_,_)),n), 'plantes', nom, 'plante', n, 'ni', kon, 'ni', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'animaux', nom, 'animal', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! En vain le soleil y répand la plus vive lumière ...", ['En', prp, 'en', dr(0,dr(0,s,s),n), 'vain', nom, 'vain', n, 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'soleil', nom, 'soleil', n, 'y', pro:per, 'y', cl_y, 'répand', ver:pres, 'répandre', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'plus', adv, 'plus', dr(0,dr(0,n,n),dr(0,n,n)), 'vive', adj, 'vif', dr(0,n,n), 'lumière', nom, 'lumière', n, '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Il y a un alpiniste en Ramond qui voudra triompher du Mont-Perdu , en raison même de la difficulté du geste .", ['Il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'a', ver:pres, 'avoir', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'alpiniste', nom, 'alpiniste', n, 'en', prp, 'en', dr(0,dl(0,n,n),n), 'Ramond', nam, 'Ramond', n, 'qui', pro:rel, 'qui', dr(0,dl(0,n,n),dl(0,lit(np(_,_,_)),s)), 'voudra', ver:futu, 'vouloir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_inf)), 'triompher', ver:infi, 'triompher', dr(0,dl(0,lit(np(_,_,_)),s_inf),pp_de), 'du', prp:det, 'du', dr(0,pp_de,n), 'Mont-Perdu', nam, 'Mont-Perdu', n, 'en', prp, 'en', dr(0,dl(1,s,s),n), 'raison', nom, 'raison', n, 'même', adj, 'même', dl(0,n,n), 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'difficulté', nom, 'difficulté', n, 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'geste', nom, 'geste', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Et s\' il n\' y est pas conduit par « le zèle de la science » , il sera du moins incité à y revenir par cette curiosité passionnée", ['Et', kon, 'et', dr(0,s,s), 's\'', kon, 'si', dr(0,dr(0,s,s),s), 'il', pro:per, 'il', lit(np(_,_,_)), 'n\'', adv, 'ne', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'y', pro:per, 'y', cl_y, 'est', ver:pres, 'être', dr(0,dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),pp_par),dl(0,lit(np(_,_,_)),s_ppart)), 'pas', adv, 'pas', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'conduit', ver:pper, 'conduire', dl(0,lit(np(_,_,_)),s_ppart), 'par', prp, 'par', dr(0,pp_par,lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'zèle', nom, 'zèle', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'science', nom, 'science', n, 'il', pro:per, 'il', lit(np(_,_,_)), 'sera', ver:futu, 'être', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),pp_par),dl(0,lit(np(_,_,_)),s_ppart)), 'incité', ver:pper, 'inciter', dr(0,dl(0,lit(np(_,_,_)),s_ppart),dl(0,lit(np(_,_,_)),s_ainf)), 'à', prp, 'à', dr(0,dl(0,lit(np(_,_,_)),s_ainf),dl(0,lit(np(_,_,_)),s_inf)), 'y', pro:per, 'y', cl_y, 'revenir', ver:infi, 'revenir', dl(0,cl_y,dl(0,lit(np(_,_,_)),s_inf)), 'par', prp, 'par', dr(0,pp_par,lit(np(_,_,_))), 'cette', pro:dem, 'cette', dr(0,lit(np(_,_,_)),n), 'curiosité', nom, 'curiosité', n, 'passionnée', adj, 'passionner', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Et s\' il n\' y est pas conduit par « le zèle de la science » , il sera du moins incité à y revenir par cette curiosité passionnée", ['Et', kon, 'et', dr(0,s,s), 's\'', kon, 'si', dr(0,dr(0,s,s),s), 'il', pro:per, 'il', lit(np(_,_,_)), 'n\'', adv, 'ne', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), 'est', ver:pres, 'être', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),pp_par),dl(0,lit(np(_,_,_)),s_ppart)), 'pas', adv, 'pas', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'conduit', ver:pper, 'conduire', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp_a), 'par', prp, 'par', dr(0,pp_par,lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'zèle', nom, 'zèle', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'science', nom, 'science', n, 'il', pro:per, 'il', lit(np(_,_,_)), 'sera', ver:futu, 'être', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),pp_par),dl(0,lit(np(_,_,_)),s_ppart)), 'incité', ver:pper, 'inciter', dr(0,dl(0,lit(np(_,_,_)),s_ppart),dl(0,lit(np(_,_,_)),s_ainf)), 'à', prp, 'à', dr(0,dl(0,lit(np(_,_,_)),s_ainf),dl(0,lit(np(_,_,_)),s_inf)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), 'revenir', ver:infi, 'revenir', dr(0,dl(0,lit(np(_,_,_)),s_inf),pp_a), 'par', prp, 'par', dr(0,pp_par,lit(np(_,_,_))), 'cette', pro:dem, 'cette', dr(0,lit(np(_,_,_)),n), 'curiosité', nom, 'curiosité', n, 'passionnée', adj, 'passionner', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! ils sont les premiers en ces lieux et leur exemple y « amènera la foule » .", ['ils', pro:per, 'ils', lit(np(_,_,_)), 'sont', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'premiers', num, 'premiers', n, 'en', prp, 'en', dr(0,dl(0,n,n),lit(np(_,_,_))), 'ces', pro:dem, 'ces', dr(0,lit(np(_,_,_)),n), 'lieux', nom, 'lieux', n, 'et', kon, 'et', dr(0,dl(0,s,s),s), 'leur', det:pos, 'leur', dr(0,lit(np(_,_,_)),n), 'exemple', nom, 'exemple', n, 'y', pro:per, 'y', cl_y, 'amènera', ver:futu, 'amener', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'foule', nom, 'foule', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! ils sont les premiers en ces lieux et leur exemple y « amènera la foule » .", ['ils', pro:per, 'ils', lit(np(_,_,_)), 'sont', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'premiers', num, 'premiers', n, 'en', prp, 'en', dr(0,dl(0,n,n),lit(np(_,_,_))), 'ces', pro:dem, 'ces', dr(0,lit(np(_,_,_)),n), 'lieux', nom, 'lieux', n, 'et', kon, 'et', dr(0,dl(0,s,s),s), 'leur', det:pos, 'leur', dr(0,lit(np(_,_,_)),n), 'exemple', nom, 'exemple', n, 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dr(0,dl(0,lit(np(_,_,_)),s),dia(1,box(1,pp_a)))), 'amènera', ver:futu, 'amener', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),pp_a),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'foule', nom, 'foule', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Dès la rentrée de l\' Ecole centrale de Tarbes , le vingt brumaire , an VII ( 10 novembre 1798 ) ; nous y retrouvons Ramond , au premier plan .", ['Dès', prp, 'dès', dr(0,dr(0,s,s),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'rentrée', nom, 'rentrée', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'Ecole', nam, 'Ecole', n, 'centrale', adj, 'central', dl(0,n,n), 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Tarbes', nam:lm, 'Tarbes', lit(np(_,_,_)), ',', pun, ',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'vingt', num, 'vingt', dr(0,n,n), 'brumaire', nom, 'brumaire', n, ',', pun, ',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),n), 'an', nom, 'an', n, 'VII', num, 'VII', dl(0,n,n), '(', pun, '(', dr(0,dl(0,n,n),lit(np(_,_,_))), '10', num, '10', dr(0,lit(np(_,_,_)),n), 'novembre', nom, 'novembre', n, '1798', num, '1798', dl(0,n,n), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'retrouvons', ver:pres, 'retrouver', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'Ramond', nam, 'Ramond', lit(np(_,_,_)), 'au', prp:det, 'au', dr(0,dl(1,s,s),n), 'premier', num, 'premier', dr(0,n,n), 'plan', nom, 'plan', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Dès la rentrée de l\' Ecole centrale de Tarbes , le vingt brumaire , an VII ( 10 novembre 1798 ) ; nous y retrouvons Ramond , au premier plan .", ['Dès', prp, 'dès', dr(0,dr(0,s,s),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'rentrée', nom, 'rentrée', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'Ecole', nam, 'Ecole', n, 'centrale', adj, 'central', dl(0,n,n), 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Tarbes', nam:lm, 'Tarbes', lit(np(_,_,_)), ',', pun, ',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'vingt', num, 'vingt', dr(0,n,n), 'brumaire', nom, 'brumaire', n, ',', pun, ',', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),n), 'an', nom, 'an', n, 'VII', num, 'VII', dl(0,n,n), '(', pun, '(', dr(0,dl(0,n,n),lit(np(_,_,_))), '10', num, '10', dr(0,lit(np(_,_,_)),n), 'novembre', nom, 'novembre', n, '1798', num, '1798', dl(0,n,n), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s)), 'retrouvons', ver:pres, 'retrouver', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'Ramond', nam, 'Ramond', lit(np(_,_,_)), 'au', prp:det, 'au', dr(0,dl(1,s,s),n), 'premier', num, 'premier', dr(0,n,n), 'plan', nom, 'plan', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "? Ce que nous savons , c\' est que , pendant l\' été de 1799 , Saint-Amans revient aux Pyrénées pour y rejoindre Ramond .", ['Ce', pro:dem, 'ce', lit(np(_,_,_)), 'que', pro:rel, 'que', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dr(0,s,dia(1,box(1,lit(np(_,_,_)))))), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'savons', ver:pres, 'savoir', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), ',', pun, ',', dr(0,dl(0,lit(np(_,_,_)),s),s), 'c\'', pro:dem, 'ce', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),cs), 'que', kon, 'que', dr(0,cs,s), 'pendant', prp, 'pendant', dr(0,dr(0,s,s),lit(np(_,_,_))), 'l\'', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'été', nom, 'été', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), '1799', num, '1799', lit(np(_,_,_)), 'Saint-Amans', nam:lm, 'Saint-Amans', lit(np(_,_,_)), 'revient', ver:pres, 'revenir', dr(0,dl(0,lit(np(_,_,_)),s),pp_a), 'aux', prp:det, 'aux', dr(0,pp_a,n), 'Pyrénées', nam:lfp, 'Pyrénées', n, 'pour', prp, 'pour', dr(0,dl(1,s,s),dl(0,lit(np(_,_,_)),s_inf)), 'y', pro:per, 'y', cl_y, 'rejoindre', ver:infi, 'rejoindre', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s_inf)),lit(np(_,_,_))), 'Ramond', nam, 'Ramond', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "! Ramond est bien sans aucun doute un amant passionné de la montagne : il y vient passer trois mois par an et il vit dans l\' enchantement .", ['Ramond', nam, 'Ramond', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'amant', nom, 'amant', n, 'passionné', ver:pper, 'passionner', dl(0,n,n), 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'montagne', nom, 'montagne', n, ':', pun, ':', dr(0,dl(0,s,s),s), 'il', pro:per, 'il', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'vient', ver:pres, 'venir', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_inf)), 'passer', ver:infi, 'passer', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), 'trois', num, 'trois', dr(0,lit(np(_,_,_)),n), 'mois', nom, 'mois', n, 'par', prp, 'par', dr(0,dl(0,n,n),n), 'an', nom, 'an', n, 'et', kon, 'et', dr(0,dl(0,s,s),s), 'il', pro:per, 'il', lit(np(_,_,_)), 'vit', ver:pres, 'vivre', dr(0,dl(0,lit(np(_,_,_)),s),pp), 'dans', prp, 'dans', dr(0,pp_dans,lit(np(_,_,_))), 'l\'', det:art, 'le_la', dr(0,lit(np(_,_,_)),n), 'enchantement', nom, 'enchantement', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Là se trouve un petit plateau très-herbeux , mais très-incliné .", ['Là', adv, 'là', dr(0,s,s), 'se', pro:per, 'se', cl_12r, 'trouve', ver:pres, 'trouver', dr(0,dl(0,cl_12r,s),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'petit', adj, 'petit', dr(0,n,n), 'plateau', nom, 'plateau', n, 'très-herbeux', adj, 'très-herbeux', dl(0,n,n), 'mais', kon, 'mais', dr(0,dl(0,dl(0,n,n),dl(0,n,n)),dl(0,n,n)), 'très-incliné', ver:pper, 'très-incliné', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Nous y rencontrâmes un troupeau et son berger ...", ['Nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'rencontrâmes', ver:simp, 'rencontrer', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),lit(np(_,_,_))), 'un', det:art, 'un', dr(0,lit(np(_,_,_)),n), 'troupeau', nom, 'troupeau', n, 'et', kon, 'et', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),lit(np(_,_,_))), 'son', det:pos, 'son', dr(0,lit(np(_,_,_)),n), 'berger', nom, 'berger', n, '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "mais il connaissait fort bien le col de Fanlo , qui est désigné ici sous le nom de col de Niscle , et il s\' engagea à nous y conduire le lendemain .", ['mais', kon, 'mais', dr(0,s,s), 'il', pro:per, 'il', lit(np(_,_,_)), 'connaissait', ver:impf, 'connaître', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'col', nom, 'col', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Fanlo', nam, 'Fanlo', lit(np(_,_,_)), 'qui', pro:rel, 'qui', dr(0,dl(0,n,n),dl(0,lit(np(_,_,_)),s)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'désigné', ver:pper, 'désigner', dr(0,dl(0,lit(np(_,_,_)),s_ppart),pp), 'sous', prp, 'sous', dr(0,pp_sous,lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'nom', nom, 'nom', n, 'de', prp, 'de', dr(0,dl(0,n,n),n), 'col', nom, 'col', n, 'de', prp, 'de', dr(0,dl(0,n,n),lit(np(_,_,_))), 'Niscle', nam, 'Niscle', lit(np(_,_,_)), 'et', kon, 'et', dr(0,dl(0,s,s),s), 'il', pro:per, 'il', lit(np(_,_,_)), 's\'', pro:per, 'se', cl_12r, 'engagea', ver:simp, 'engager', dr(0,dl(0,cl_12r,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ainf)), 'à', prp, 'à', dr(0,dl(0,lit(np(_,_,_)),s_ainf),dl(0,lit(np(_,_,_)),s_inf)), 'nous', pro:per, 'nous', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'conduire', ver:infi, 'conduire', dl(0,cl_y,dl(0,lit(np(_,_,_)),s_inf)), 'le', det:art, 'le', dr(0,dl(1,s,s),n), 'lendemain', nom, 'lendemain', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Au reste , ces êtres organiques sont les derniers que j\' aie rencontrés à la cime du Mont-Perdu .", ['Au', prp:det, 'Au', dr(0,dr(0,s,s),n), 'reste', nom, 'reste', n, 'ces', pro:dem, 'ces', dr(0,lit(np(_,_,_)),n), 'êtres', nom, 'être', n, 'organiques', adj, 'organique', dl(0,n,n), 'sont', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'les', det:art, 'les', dr(0,lit(np(_,_,_)),n), 'derniers', adj, 'dernier', n, 'que', pro:rel, 'que', dr(0,dl(0,n,n),dr(0,s,dia(0,box(0,lit(np(_,_,_)))))), 'j\'', pro:per, 'je', lit(np(_,_,_)), 'aie', ver:subp, 'avoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_ppart)), 'rencontrés', ver:pper, 'rencontrer', dr(0,dl(0,lit(np(_,_,_)),s_ppart),lit(np(_,_,_))), 'à', prp, 'à', dr(0,dl(1,s,s),lit(np(_,_,_))), 'la', det:art, 'la', dr(0,lit(np(_,_,_)),n), 'cime', nom, 'cime', n, 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'Mont-Perdu', nam, 'Mont-Perdu', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "J\' y ai séjourné deux heures ...", ['J\'', pro:per, 'je', lit(np(_,_,_)), 'y', pro:per, 'y', cl_y, 'ai', ver:pres, 'avoir', dr(0,dl(0,cl_y,dl(0,lit(np(_,_,_)),s)),dl(0,lit(np(_,_,_)),s_ppart)), 'séjourné', ver:pper, 'séjourner', dl(0,lit(np(_,_,_)),s_ppart), 'deux', num, 'deux', dr(0,dl(1,s,s),n), 'heures', nom, 'heure', n, '...', pun, '...', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Le chien dort .", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'chien', nom, 'chien', lit(n), 'dort', ver:pres, 'dormir', dl(0,lit(np(_,_,_)),s), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Nous aimons Marie .", ['Nous', pro:per, 'nous', lit(np(_,_,_)), 'aimons', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'Marie', nam, 'Marie', lit(np(_,_,_)), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean semble stupide .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'semble', ver:pres, 'sembler', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,n,n)), 'stupide', adj, 'stupide', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean est très stupide .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,n,n)), 'très', adv, 'très', dr(0,dl(0,n,n),dl(0,n,n)), 'stupide', adj, 'stupide', dl(0,n,n), '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Ce qui devrait permettre d' empêcher une augmentation mécanique du chômage .", ['Ce', pro:dem, 'ce', lit(np(_,_,_)), 'qui', pro:rel, 'qui', dr(0,dl(0,lit(np(_,_,_)),lit(np(_,_,_))),dl(0,lit(np(_,_,_)),s)), 'devrait', ver:cond, 'devoir', dr(0,dl(0,lit(np(_,_,_)),s),dl(0,lit(np(_,_,_)),s_inf)), 'permettre', ver:infi, 'permettre', dr(0,dl(0,lit(np(_,_,_)),s_inf),dl(0,lit(np(_,_,_)),s_deinf)), 'd\'', prp, 'de', dr(0,dl(0,lit(np(_,_,_)),s_deinf),dl(0,lit(np(_,_,_)),s_inf)), 'empêcher', ver:infi, 'empêcher', dr(0,dl(0,lit(np(_,_,_)),s_inf),lit(np(_,_,_))), 'une', det:art, 'une', dr(0,lit(np(_,_,_)),n), 'augmentation', nom, 'augmentation', n, 'mécanique', adj, 'mécanique', dl(0,n,n), 'du', prp:det, 'du', dr(0,dl(0,n,n),n), 'chômage', nom, 'chômage', n, '.', pun, '.', dl(0,lit(np(_,_,_)),txt)], lit(txt)). example_phrase(pos_lemma, "Jean aime Marie .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'aime', ver:pres, 'aimer', dr(0,dl(0,lit(np(_,_,_)),s),lit(np(_,_,_))), 'Marie', nam, 'Marie', np, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean est dans le merde .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'est', ver:pres, 'être', dr(0,dl(0,lit(np(_,_,_)),s),pp), 'dans', prp, 'dans', dr(0,pp_dans,lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'merde', nom, 'merde', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "Jean met Marie dans le merde .", ['Jean', nam, 'Jean', lit(np(_,_,_)), 'met', ver:pres, 'mettre', dr(0,dr(0,dl(0,lit(np(_,_,_)),s),pp),lit(np(_,_,_))), 'Marie', nam, 'Marie', lit(np(_,_,_)), 'dans', prp, 'dans', dr(0,pp_dans,lit(np(_,_,_))), 'le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'merde', nom, 'merde', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). example_phrase(pos_lemma, "L'interêt passe de 5,5 à 3,7 milliards .", ['Le', det:art, 'le', dr(0,lit(np(_,_,_)),n), 'interêt', nom, 'interêt', n, 'passse', ver:ppre, 'passer', dr(0,dl(0,lit(np(_,_,_)),s),pp), 'de', prp, 'de', dr(0,pp_de,lit(np(_,_,_))), '5,5', num, '5,5', dr(0,lit(np(_,_,_)),n), 'à', prp, 'à', dr(0,dl(0,dr(0,lit(np(_,_,_)),n),dl(0,dr(0,pp_de,lit(np(_,_,_))),dr(0,pp_a,n))),dr(0,lit(np(_,_,_)),n)), '3,7', num, '3,7', dr(0,lit(np(_,_,_)),n), 'milliards', nom, 'milliard', n, '.', pun, '.', dl(0,s,txt)], lit(txt)). translate_sem(T0,T) :- presupposition_projection(T0, T1), format(user_error, 'HOOK:~n', [T0]), simplify_drss(T1, T). % TODO: complete presupposition_projection(DRS, DRS). %presupposition_projection(DRS0, DRS) :- % select_presupposition(DRS0, DRS1). select_presupposition(presup(X,Y), X, Y). select_presupposition(drs(X,Y0), P, drs(X, Y)) :- select_presupposition_list(Y0, P, Y). simplify_drss(drs(V,C), DRS) :- simplify_drs(C, V, DRS0), !, simplify_drss(DRS0, DRS). simplify_drss(drs(V,C0), drs(V, C)) :- simplify_sub_drss(C0, C), !. simplify_drss(DRS, DRS). simplify_sub_drss([C|Cs], [D|Cs]) :- simplify_condition(C, D), !. simplify_sub_drss([C|Cs], [C|Ds]) :- simplify_sub_drss(Cs, Ds). simplify_condition(not(drs(V,C)), not(DRS)) :- simplify_drs(C, V, DRS). simplify_condition(bool(drs(V,C),Cn,DRSB),bool(DRS,Cn,DRSB)) :- simplify_drs(C, V, DRS). simplify_condition(bool(DRSB,Cn,drs(V,C)),bool(DRSB,Cn,DRS)) :- simplify_drs(C, V, DRS). simplify_condition(presup(drs(V,C),DRSB),presup(DRS,DRSB)) :- simplify_drs(C, V, DRS). simplify_condition(presup(DRSB,drs(V,C)),presup(DRSB,DRS)) :- simplify_drs(C, V, DRS). simplify_condition(drs_label(L,drs(V,C)),drs_label(L,DRS)) :- simplify_drs(C, V, DRS). simplify_drs(C0, V, drs(V,[appl(F,E)|C])) :- select(appl(F0,E0), C0, C), member(appl(event,E0), C), format(user_error, 'EVENT: ~n', [E0]), replace_event_arg(F0, E0, F, E), E0 \== E, !. replace_event_arg(appl(F,sub(E,B)), _, appl(F,B), E) :- !. replace_event_arg(appl(F0,A0), E0, appl(F,A), E) :- replace_event_arg(F0, E0, E1, F), replace_event_arg(A0, E1, E, A).
RichardMoot/GrailLight
big_french_drt.pl
Perl
lgpl-2.1
347,902
#define BOOST_TEST_DYN_LINK #include <boost/test/unit_test.hpp> #include <lamtram/macros.h> #include <lamtram/sentence.h> #include <lamtram/dict-utils.h> #include <dynet/dict.h> #include <sstream> using namespace std; using namespace lamtram; // ****** The tests ******* BOOST_AUTO_TEST_SUITE(vocabulary) BOOST_AUTO_TEST_CASE(TestParseWords) { // Create the words. <s> is 0 and <unk> is 1. DictPtr vocab(CreateNewDict()); string in = " a b c a c <s> b <unk> "; Sentence exp(8), act; exp[0] = 2; exp[1] = 3; exp[2] = 4; exp[3] = 2; exp[4] = 4; exp[5] = 0; exp[6] = 3; exp[7] = 1; act = ParseWords(*vocab, in, false); BOOST_CHECK_EQUAL_COLLECTIONS(exp.begin(), exp.end(), act.begin(), act.end()); } BOOST_AUTO_TEST_CASE(TestPrintWords) { dynet::Dict vocab; string in = " a b c a c <s> b "; string exp = "a b c a c <s> b"; string act = PrintWords(vocab, ParseWords(vocab, in, false)); BOOST_CHECK_EQUAL(exp, act); } BOOST_AUTO_TEST_CASE(TestReadWrite) { DictPtr vocab_exp(CreateNewDict()); string in = " a b c a c <s> b "; ParseWords(*vocab_exp, in, false); stringstream out; WriteDict(*vocab_exp, out); DictPtr vocab_act(ReadDict(out)); BOOST_CHECK_EQUAL_COLLECTIONS( vocab_exp->get_words().begin(), vocab_exp->get_words().end(), vocab_act->get_words().begin(), vocab_act->get_words().end()); } BOOST_AUTO_TEST_SUITE_END()
neubig/lamtram
src/test/test-vocabulary.cc
C++
lgpl-2.1
1,457
<?php //$Id: mod_form.php,v 1.2.2.3 2009/03/19 12:23:11 mudrd8mz Exp $ /* Daf-collage is made up of two Moodle modules which help in the process of German language learning. It facilitates the content organization like vocabulary or the main grammar features and gives the chance to create exercises in order to consolidate knowledge. Copyright (C) 2011 Coordination: Ruth Burbat Source code: Francisco Javier Rodríguez López (seiyadesagitario@gmail.com) Simeón Ruiz Romero (simeonruiz@gmail.com) Serafina Molina Soto(finamolinasoto@gmail.com) Original idea: Ruth Burbat Content design: Ruth Burbat AInmaculada Almahano Güeto Andrea Bies Julia Möller Runge Blanca Rodríguez Gómez Antonio Salmerón Matilla María José Varela Salinas Karin Vilar Sánchez 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. */ require_once($CFG->dirroot . '/course/moodleform_mod.php'); require_once("ejercicios_clases.php"); require_once("ejercicios_clase_general.php"); /* Formulario generico de ejercicos de cualquier tipo de actidad * @author Serafina Molina Soto * Multichoice con sus variantes 1 * Asocicacion simple 2 * Asociacion complejo 3 */ class mod_ejercicios_curso extends moodleform_mod { function mod_ejercicios_curso($id) { // El fichero que procesa el formulario es gestion.php parent::moodleform('ejercicios_buscar.php?id_curso=' . $id); } function definition() { } /** * Function that add a table to the forma to show the main menu * * @author Serafina Molina Soto * @param $id id for the course */ function pintarejercicios($id) { echo 'Modificado por Borja Arroba: codigo obsoleto' . ' Esta funcion pertenece a una clase que solo tiene esta funcion, si aparece este mensaje es que se esta usando en otra parte del programa que no he detectado' . ' paso este metodo al archivo: ejercicios_form_buscar.php metodo: mostrar_ejercicios_alumno($id)'; die(); global $CFG, $COURSE, $USER; $mform = & $this->_form; $mform->addElement('html', '<link rel="stylesheet" type="text/css" href="./estilos2.css">'); $mform->addElement('html', '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>'); $mform->addElement('html', '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>'); $mform->addElement('html', '<script type="text/javascript" src="./funciones.js"></script>'); //titulo $titulo = '<h2>' . get_string('EjerciciosCurso', 'ejercicios') . '</h2>'; $mform->addElement('html', $titulo); $ejercicios_curso = new Ejercicios_general(); $camposBusqueda=array(); $camposBusqueda["id_curso"]=$id; $todos_ejer_curso = $ejercicios_curso->buscar_ejercicios($camposBusqueda); $numeroencontrados = sizeof($todos_ejer_curso); for ($i = 0; $i < $numeroencontrados; $i++) { $carpeta.='<ul id="classul">'; $nombre_ejercicio = $todos_ejer_curso[$i]->get('name'); //Añado un enlace por cada ejercicio dentro de la carpeta $id_ejercicio = $todos_ejer_curso[$i]->get('id'); //Propuesta de codigo por Angel Biedma $tipo_creacion = $todos_ejer_curso[$i]->get('tipoactividad'); switch ($tipo_creacion) { case 0: //Multiple Choice case 4: //Identificar elementos $carpeta.='<li style="width:750px;"><a id="classa" href="./view.php?opcion=8&id=' . $id . '&id_ejercicio=' . $id_ejercicio . '&buscar=1&tipocreacion=' . $tipo_creacion . '">' . $nombre_ejercicio . '</a></li>'; break; case 1: // Asociacion simple case 2: // Asociacion multiple case 3: // Texto Hueco case 7: // Ordenar Elementos case 8: // IE mas RC $carpeta.='<li style="width:750px;"><a id="classa" href="./view.php?opcion=8&id=' . $id . '&id_ejercicio=' . $id_ejercicio . '&buscar=1&tipo_origen=' . $todos_ejer_curso[$i]->get('tipoarchivopregunta') . '&tr=' . $todos_ejer_curso[$i]->get('tipoarchivorespuesta') . '&tipocreacion=' . $todos_ejer_curso[$i]->get('tipoactividad') . '">' . $nombre_ejercicio . '</a></li>'; break; } } $carpeta.='</ul>'; $carpeta.='</li>'; $carpeta.='</ul>'; $mform->addElement('html', $carpeta); //boton para irme al menú principal //Pinto los botones $buttonarray = array(); $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('Reset', 'ejercicios')); $mform->addGroup($buttonarray, 'botones', '', array(' '), false); } }
seiya64/dafcollage
ejercicios/ejercicios_form_curso.php
PHP
lgpl-2.1
5,402
/**************************************************************************** ** libebml : parse EBML files, see http://embl.sourceforge.net/ ** ** <file/class description> ** ** Copyright (C) 2014 Moritz Bunkus. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** ** See http://www.matroska.org/license/lgpl/ for LGPL licensing information. ** ** Contact license@matroska.org if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ /*! \file \author Moritz Bunkus <moritz@bunkus.org> */ #ifndef LIBEBML_MEMREADIOCALLBACK_H #define LIBEBML_MEMREADIOCALLBACK_H #include "EbmlBinary.h" #include "IOCallback.h" START_LIBEBML_NAMESPACE class EBML_DLL_API MemReadIOCallback : public IOCallback { protected: uint8 const *mStart, *mEnd, *mPtr; public: MemReadIOCallback(void const *Ptr, size_t Size); MemReadIOCallback(EbmlBinary const &Binary); MemReadIOCallback(MemReadIOCallback const &Mem); virtual ~MemReadIOCallback() = default; uint32 read(void *Buffer, size_t Size); void setFilePointer(int64 Offset, seek_mode Mode = seek_beginning); size_t write(void const *, size_t) { return 0; } virtual uint64 getFilePointer() { return mPtr - mStart; } void close() {} binary const *GetDataBuffer() const { return mPtr; } uint64 GetDataBufferSize() const { return mEnd - mStart; } protected: void Init(void const *Ptr, size_t Size); }; END_LIBEBML_NAMESPACE #endif // LIBEBML_MEMREADIOCALLBACK_H
Matroska-Org/libebml
ebml/MemReadIOCallback.h
C
lgpl-2.1
2,222
/* * 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.envers.test.entities.customtype; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import java.util.Properties; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.type.StringType; import org.hibernate.usertype.ParameterizedType; import org.hibernate.usertype.UserType; /** * @author Adam Warski (adam at warski dot org) */ public class ParametrizedTestUserType implements UserType, ParameterizedType { private static final int[] TYPES = new int[] {Types.VARCHAR}; private String param1; private String param2; public void setParameterValues(Properties parameters) { param1 = parameters.getProperty( "param1" ); param2 = parameters.getProperty( "param2" ); } public Class returnedClass() { return String.class; } public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { return StringType.INSTANCE.nullSafeGet( rs, names[0], session ); } public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { if ( value != null ) { String v = (String) value; if ( !v.startsWith( param1 ) ) { v = param1 + v; } if ( !v.endsWith( param2 ) ) { v = v + param2; } StringType.INSTANCE.nullSafeSet( st, v, index, session ); } else { StringType.INSTANCE.nullSafeSet( st, null, index, session ); } } public int[] sqlTypes() { return TYPES; } public Object assemble(Serializable cached, Object owner) throws HibernateException { return cached; } public Object deepCopy(Object value) throws HibernateException { return value; } public Serializable disassemble(Object value) throws HibernateException { return (Serializable) value; } public boolean equals(Object x, Object y) throws HibernateException { //noinspection ObjectEquality if ( x == y ) { return true; } if ( x == null || y == null ) { return false; } return x.equals( y ); } public int hashCode(Object x) throws HibernateException { return x.hashCode(); } public boolean isMutable() { return false; } public Object replace(Object original, Object target, Object owner) throws HibernateException { return original; } }
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/customtype/ParametrizedTestUserType.java
Java
lgpl-2.1
2,665
<?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: flipable.qmlproject Example File (declarative/ui-components/flipable/flipable.qmlproject)</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">flipable.qmlproject Example File</h1> <span class="small-subtitle">declarative/ui-components/flipable/flipable.qmlproject</span> <!-- $$$declarative/ui-components/flipable/flipable.qmlproject-description --> <div class="descr"> <a name="details"></a> <pre class="cpp"> import QmlProject 1.0 Project { /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { directory: &quot;qml/flipable&quot; } JavaScriptFiles { directory: &quot;qml/flipable&quot; } ImageFiles { directory: &quot;qml/flipable&quot; } /* List of plugin directories passed to QML runtime */ // importPaths: [ &quot; ../exampleplugin &quot; ] }</pre> </div> <!-- @@@declarative/ui-components/flipable/flipable.qmlproject --> </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/declarative-ui-components-flipable-flipable-qmlproject.html
HTML
lgpl-2.1
9,826
package io.github.richardyin.empirecraft; import io.github.richardyin.empirecraft.common.CommonProxy; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import org.apache.logging.log4j.Logger; @Mod(modid = EmpireCraft.MODID, name = EmpireCraft.MODNAME, version=EmpireCraft.VERSION) public class EmpireCraft { public static final String MODID = "EmpireCraft"; public static final String MODNAME = "EmpireCraft"; public static final String VERSION = "0.0.1"; @Mod.Instance public static EmpireCraft instance; @SidedProxy(modId=MODID, clientSide="io.github.richardyin.empirecraft.client.ClientProxy", serverSide="io.github.richardyin.empirecraft.common.CommonProxy") public static CommonProxy proxy; public static Logger logger; @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { logger.info("Starting EmpireCraft"); proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } }
richard-yin/EmpireCraft
src/main/java/io/github/richardyin/empirecraft/EmpireCraft.java
Java
lgpl-2.1
1,461
/* Test of <sys/file.h> substitute. Copyright (C) 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Eric Blake <ebb9@byu.net>, 2009. */ #include <config.h> #include <sys/file.h> int main (void) { switch (0) { case LOCK_SH: case LOCK_EX: case LOCK_NB: case LOCK_UN: ; } return 0; }
novel/fbsd-libvirt
.gnulib/tests/test-sys_file.c
C
lgpl-2.1
975
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtSCriptTools module 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 qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSCRIPTDEBUGGERCODEVIEWINTERFACE_P_P_H #define QSCRIPTDEBUGGERCODEVIEWINTERFACE_P_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <private/qwidget_p.h> QT_BEGIN_NAMESPACE class QScriptDebuggerCodeViewInterface; class QScriptDebuggerCodeViewInterfacePrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QScriptDebuggerCodeViewInterface) public: QScriptDebuggerCodeViewInterfacePrivate(); ~QScriptDebuggerCodeViewInterfacePrivate(); }; QT_END_NAMESPACE #endif
radekp/qt
src/scripttools/debugging/qscriptdebuggercodeviewinterface_p_p.h
C
lgpl-2.1
2,197
#!/usr/bin/perl -w # settings.pl: generate settings.c from settings.dat # Copyright (c) 2002-2005 Philip Kendall # $Id: settings.pl 4156 2010-09-09 13:01:38Z fredm $ # 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. # Author contact information: # E-mail: philip-fuse@shadowmagic.org.uk use strict; use Fuse; sub hashline ($) { '#line ', $_[0] + 1, '"', __FILE__, "\"\n" } my %options; while(<>) { next if /^\s*$/; next if /^\s*#/; chomp; my( $name, $type, $default, $short, $commandline, $configfile ) = split /\s*,\s*/; if( not defined $commandline ) { $commandline = $name; $commandline =~ s/_/-/g; } if( not defined $configfile ) { $configfile = $commandline; $configfile =~ s/-//g; } $options{$name} = { type => $type, default => $default, short => $short, commandline => $commandline, configfile => $configfile }; } print Fuse::GPL( 'settings.c: Handling configuration settings', '2002 Philip Kendall' ); print hashline( __LINE__ ), << 'CODE'; /* This file is autogenerated from settings.dat by settings.pl. Do not edit unless you know what will happen! */ #include <config.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #ifdef HAVE_GETOPT_LONG /* Did our libc include getopt_long? */ #include <getopt.h> #elif defined AMIGA || defined __MORPHOS__ /* #ifdef HAVE_GETOPT_LONG */ /* The platform uses GNU getopt, but not getopt_long, so we get symbol clashes on this platform. Just use getopt */ #else /* #ifdef HAVE_GETOPT_LONG */ #include "compat.h" /* If not, use ours */ #endif /* #ifdef HAVE_GETOPT_LONG */ #ifdef HAVE_LIB_XML2 #include <libxml/xmlmemory.h> #include <libxml/parser.h> #endif /* #ifdef HAVE_LIB_XML2 */ #include "fuse.h" #include "machine.h" #include "settings.h" #include "spectrum.h" #include "ui/ui.h" #include "utils.h" /* The name of our configuration file */ #ifdef WIN32 #define CONFIG_FILE_NAME "fuse.cfg" #else /* #ifdef WIN32 */ #define CONFIG_FILE_NAME ".fuserc" #endif /* #ifdef WIN32 */ /* The current settings of options, etc */ settings_info settings_current; /* The default settings of options, etc */ settings_info settings_default = { CODE foreach my $name ( sort keys %options ) { next if $options{$name}->{type} eq 'null'; print " /* $name */ $options{$name}->{default},\n"; } print hashline( __LINE__ ), << 'CODE'; /* show_help */ 0, /* show_version */ 0, }; static int read_config_file( settings_info *settings ); #ifdef HAVE_LIB_XML2 static int parse_xml( xmlDocPtr doc, settings_info *settings ); #else /* #ifdef HAVE_LIB_XML2 */ static int parse_ini( utils_file *file, settings_info *settings ); #endif /* #ifdef HAVE_LIB_XML2 */ static int settings_command_line( settings_info *settings, int *first_arg, int argc, char **argv ); static int settings_copy_internal( settings_info *dest, settings_info *src ); /* Called on emulator startup */ int settings_init( int *first_arg, int argc, char **argv ) { int error; error = settings_defaults( &settings_current ); if( error ) { ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ ); return error; } error = read_config_file( &settings_current ); if( error ) return error; error = settings_command_line( &settings_current, first_arg, argc, argv ); if( error ) return error; return 0; } /* Fill the settings structure with sensible defaults */ int settings_defaults( settings_info *settings ) { return settings_copy_internal( settings, &settings_default ); } #ifdef HAVE_LIB_XML2 /* Read options from the config file (if libxml2 is available) */ static int read_config_file( settings_info *settings ) { const char *home; char path[ PATH_MAX ]; struct stat stat_info; xmlDocPtr doc; home = compat_get_home_path(); if( !home ) return 1; snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* See if the file exists; if doesn't, it's not a problem */ if( stat( path, &stat_info ) ) { if( errno == ENOENT ) { return 0; } else { ui_error( UI_ERROR_ERROR, "couldn't stat '%s': %s", path, strerror( errno ) ); return 1; } } doc = xmlParseFile( path ); if( !doc ) { ui_error( UI_ERROR_ERROR, "error reading config file" ); return 1; } if( parse_xml( doc, settings ) ) { xmlFreeDoc( doc ); return 1; } xmlFreeDoc( doc ); return 0; } static int parse_xml( xmlDocPtr doc, settings_info *settings ) { xmlNodePtr node; xmlChar *xmlstring; node = xmlDocGetRootElement( doc ); if( xmlStrcmp( node->name, (const xmlChar*)"settings" ) ) { ui_error( UI_ERROR_ERROR, "config file's root node is not 'settings'" ); return 1; } node = node->xmlChildrenNode; while( node ) { CODE foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; if( $type eq 'boolean' or $type eq 'numeric' ) { print << "CODE"; if( !strcmp( (const char*)node->name, "$options{$name}->{configfile}" ) ) { xmlstring = xmlNodeListGetString( doc, node->xmlChildrenNode, 1 ); if( xmlstring ) { settings->$name = atoi( (char*)xmlstring ); xmlFree( xmlstring ); } } else CODE } elsif( $type eq 'string' ) { print << "CODE"; if( !strcmp( (const char*)node->name, "$options{$name}->{configfile}" ) ) { xmlstring = xmlNodeListGetString( doc, node->xmlChildrenNode, 1 ); if( xmlstring ) { free( settings->$name ); settings->$name = strdup( (char*)xmlstring ); xmlFree( xmlstring ); } } else CODE } elsif( $type eq 'null' ) { print << "CODE"; if( !strcmp( (const char*)node->name, "$options{$name}->{configfile}" ) ) { /* Do nothing */ } else CODE } else { die "Unknown setting type `$type'"; } } print hashline( __LINE__ ), << 'CODE'; if( !strcmp( (const char*)node->name, "text" ) ) { /* Do nothing */ } else { ui_error( UI_ERROR_WARNING, "Unknown setting '%s' in config file", node->name ); } node = node->next; } return 0; } int settings_write_config( settings_info *settings ) { const char *home; char path[ PATH_MAX ], buffer[80]; xmlDocPtr doc; xmlNodePtr root; home = compat_get_home_path(); if( !home ) return 1; snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* Create the XML document */ doc = xmlNewDoc( (const xmlChar*)"1.0" ); root = xmlNewNode( NULL, (const xmlChar*)"settings" ); xmlDocSetRootElement( doc, root ); CODE foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; if( $type eq 'boolean' ) { print " xmlNewTextChild( root, NULL, (const xmlChar*)\"$options{$name}->{configfile}\", (const xmlChar*)(settings->$name ? \"1\" : \"0\") );\n"; } elsif( $type eq 'string' ) { print << "CODE"; if( settings->$name ) xmlNewTextChild( root, NULL, (const xmlChar*)"$options{$name}->{configfile}", (const xmlChar*)settings->$name ); CODE } elsif( $type eq 'numeric' ) { print << "CODE"; snprintf( buffer, 80, "%d", settings->$name ); xmlNewTextChild( root, NULL, (const xmlChar*)"$options{$name}->{configfile}", (const xmlChar*)buffer ); CODE } elsif( $type eq 'null' ) { # Do nothing } else { die "Unknown setting type `$type'"; } } print hashline( __LINE__ ), << 'CODE'; xmlSaveFormatFile( path, doc, 1 ); return 0; } #else /* #ifdef HAVE_LIB_XML2 */ /* Read options from the config file as ini file (if libxml2 is not available) */ static int read_config_file( settings_info *settings ) { const char *home; char path[ PATH_MAX ]; struct stat stat_info; int error; utils_file file; home = compat_get_home_path(); if( !home ) return 1; snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* See if the file exists; if doesn't, it's not a problem */ if( stat( path, &stat_info ) ) { if( errno == ENOENT ) { return 0; } else { ui_error( UI_ERROR_ERROR, "couldn't stat '%s': %s", path, strerror( errno ) ); return 1; } } error = utils_read_file( path, &file ); if( error ) { ui_error( UI_ERROR_ERROR, "error reading config file" ); return 1; } if( parse_ini( &file, settings ) ) { utils_close_file( &file ); return 1; } utils_close_file( &file ); return 0; } static int settings_var( settings_info *settings, unsigned char *name, unsigned char *last, int **val_int, char ***val_char, unsigned char **next ) { unsigned char* cpos; size_t n; *val_int = NULL; *val_char = NULL; *next = name; while( name < last && ( *name == ' ' || *name == '\t' || *name == '\r' || *name == '\n' ) ) { *next = ++name; /* seek to first char */ } cpos = name; while( cpos < last && ( *cpos != '=' && *cpos != ' ' && *cpos != '\t' && *cpos != '\r' && *cpos != '\n' ) ) cpos++; *next = cpos; n = cpos - name; /* length of name */ while( *next < last && **next != '=' ) { /* search for '=' */ if( **next != ' ' && **next != '\t' && **next != '\r' && **next != '\n' ) return 1; /* error in value */ (*next)++; } if( *next < last) (*next)++; /* set after '=' */ /* ui_error( UI_ERROR_WARNING, "Config: (%5s): ", name ); */ CODE my %type = ('null' => 0, 'boolean' => 1, 'numeric' => 1, 'string' => 2 ); foreach my $name ( sort keys %options ) { my $len = length $options{$name}->{configfile}; print << "CODE"; if( n == $len && !strncmp( (const char *)name, "$options{$name}->{configfile}", n ) ) { CODE print " *val_int = \&settings->$name;\n" if( $options{$name}->{type} eq 'boolean' or $options{$name}->{type} eq 'numeric' ); print " *val_char = \&settings->$name;\n" if( $options{$name}->{type} eq 'string' ); print "/* *val_null = \&settings->$name; */\n" if( $options{$name}->{type} eq 'null' ); print << "CODE"; return 0; } CODE } print << "CODE"; return 1; } static int parse_ini( utils_file *file, settings_info *settings ) { unsigned char *cpos, *cpos_new; int *val_int; char **val_char; cpos = file->buffer; /* Read until the end of file */ while( cpos < file->buffer + file->length ) { if( settings_var( settings, cpos, file->buffer + file->length, &val_int, &val_char, &cpos_new ) ) { /* error in name or something else ... */ cpos = cpos_new + 1; ui_error( UI_ERROR_WARNING, "Unknown and/or invalid setting '%s' in config file", cpos ); continue; } cpos = cpos_new; if( val_int ) { *val_int = atoi( (char *)cpos ); while( cpos < file->buffer + file->length && ( *cpos != '\\0' && *cpos != '\\r' && *cpos != '\\n' ) ) cpos++; } else if( val_char ) { char *value = (char *)cpos; size_t n = 0; while( cpos < file->buffer + file->length && ( *cpos != '\\0' && *cpos != '\\r' && *cpos != '\\n' ) ) cpos++; n = (char *)cpos - value; if( n > 0 ) { if( *val_char != NULL ) { free( *val_char ); *val_char = NULL; } *val_char = malloc( n + 1 ); if( ! *val_char ) { ui_error( UI_ERROR_WARNING, "Out of memory!" ); return 1; } (*val_char)[n] = '\\0'; memcpy( *val_char, value, n ); } } /* skip 'new line' like chars */ while( ( cpos < ( file->buffer + file->length ) ) && ( *cpos == '\\r' || *cpos == '\\n' ) ) cpos++; CODE print hashline( __LINE__ ), << 'CODE'; } return 0; } static int settings_file_write( compat_fd fd, const char *buffer, size_t length ) { return compat_file_write( fd, (const unsigned char *)buffer, length ); } static int settings_string_write( compat_fd doc, const char* name, const char* config ) { if( config != NULL && ( settings_file_write( doc, name, strlen( name ) ) || settings_file_write( doc, "=", 1 ) || settings_file_write( doc, config, strlen( config ) ) || settings_file_write( doc, "\n", 1 ) ) ) return 1; return 0; } static int settings_boolean_write( compat_fd doc, const char* name, int config ) { return settings_string_write( doc, name, config ? "1" : "0" ); } static int settings_numeric_write( compat_fd doc, const char* name, int config ) { char buffer[80]; snprintf( buffer, sizeof( buffer ), "%d", config ); return settings_string_write( doc, name, buffer ); } int settings_write_config( settings_info *settings ) { const char *home; char path[ PATH_MAX ]; compat_fd doc; home = compat_get_home_path(); if( !home ) return 1; snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); doc = compat_file_open( path, 1 ); if( doc == COMPAT_FILE_OPEN_FAILED ) { ui_error( UI_ERROR_ERROR, "couldn't open `%s' for writing: %s\n", path, strerror( errno ) ); return 1; } CODE foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; my $len = length "$options{$name}->{configfile}"; if( $type eq 'boolean' ) { print << "CODE"; if( settings_boolean_write( doc, "$options{$name}->{configfile}", settings->$name ) ) goto error; CODE } elsif( $type eq 'string' ) { print << "CODE"; if( settings_string_write( doc, "$options{$name}->{configfile}", settings->$name ) ) goto error; CODE } elsif( $type eq 'numeric' ) { print << "CODE"; if( settings_numeric_write( doc, "$options{$name}->{configfile}", settings->$name ) ) goto error; CODE } elsif( $type eq 'null' ) { # Do nothing } else { die "Unknown setting type `$type'"; } } print hashline( __LINE__ ), << 'CODE'; compat_file_close( doc ); return 0; error: compat_file_close( doc ); return 1; } #endif /* #ifdef HAVE_LIB_XML2 */ /* Read options from the command line */ static int settings_command_line( settings_info *settings, int *first_arg, int argc, char **argv ) { #ifdef GEKKO /* No argv on the Wii. Just return */ return 0; #endif #if !defined AMIGA && !defined __MORPHOS__ struct option long_options[] = { CODE my $fake_short_option = 256; foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; my $commandline = $options{$name}->{commandline}; my $short = $options{$name}->{short}; unless( $type eq 'boolean' or $short ) { $short = $fake_short_option++ } if( $type eq 'boolean' ) { print << "CODE"; { "$commandline", 0, &(settings->$name), 1 }, { "no-$commandline", 0, &(settings->$name), 0 }, CODE } elsif( $type eq 'string' or $type eq 'numeric' ) { print " { \"$commandline\", 1, NULL, $short },\n"; } elsif( $type eq 'null' ) { # Do nothing } else { die "Unknown setting type `$type'"; } } print hashline( __LINE__ ), << 'CODE'; { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { 0, 0, 0, 0 } /* End marker: DO NOT REMOVE */ }; #endif /* #ifndef AMIGA */ while( 1 ) { int c; #if defined AMIGA || defined __MORPHOS__ c = getopt( argc, argv, "d:hm:o:p:f:r:s:t:v:g:j:V" ); #else /* #ifdef AMIGA */ c = getopt_long( argc, argv, "d:hm:o:p:f:r:s:t:v:g:j:V", long_options, NULL ); #endif /* #ifdef AMIGA */ if( c == -1 ) break; /* End of option list */ switch( c ) { case 0: break; /* Used for long option returns */ CODE $fake_short_option = 256; foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; my $short = $options{$name}->{short}; unless( $type eq 'boolean' or $short ) { $short = $fake_short_option++ } if( $type eq 'boolean' ) { # Do nothing } elsif( $type eq 'string' ) { print " case $short: settings_set_string( &settings->$name, optarg ); break;\n"; } elsif( $type eq 'numeric' ) { print " case $short: settings->$name = atoi( optarg ); break;\n"; } elsif( $type eq 'null' ) { # Do nothing } else { die "Unknown setting type `$type'"; } } print hashline( __LINE__ ), << 'CODE'; case 'h': settings->show_help = 1; break; case 'V': settings->show_version = 1; break; case ':': case '?': break; default: fprintf( stderr, "%s: getopt_long returned `%c'\n", fuse_progname, (char)c ); break; } } /* Store the location of the first non-option argument */ *first_arg = optind; return 0; } /* Copy one settings object to another */ static int settings_copy_internal( settings_info *dest, settings_info *src ) { if( dest->start_machine ) { free( dest->start_machine ); dest->start_machine = NULL; } if( dest->start_scaler_mode ) { free( dest->start_scaler_mode ); dest->start_scaler_mode = NULL; } CODE foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; if( $type eq 'boolean' or $type eq 'numeric' ) { print " dest->$name = src->$name;\n"; } elsif( $type eq 'string' ) { print << "CODE"; dest->$name = NULL; if( src->$name ) { dest->$name = strdup( src->$name ); if( !dest->$name ) { settings_free( dest ); return 1; } } CODE } } print hashline( __LINE__ ), << 'CODE'; return 0; } /* Copy one settings object to another */ int settings_copy( settings_info *dest, settings_info *src ) { if( settings_defaults( dest ) ) return 1; return settings_copy_internal( dest, src ); } char ** settings_get_rom_setting( settings_info *settings, size_t which ) { switch( which ) { case 0: return &( settings->rom_16 ); case 1: return &( settings->rom_48 ); case 2: return &( settings->rom_128_0 ); case 3: return &( settings->rom_128_1 ); case 4: return &( settings->rom_plus2_0 ); case 5: return &( settings->rom_plus2_1 ); case 6: return &( settings->rom_plus2a_0 ); case 7: return &( settings->rom_plus2a_1 ); case 8: return &( settings->rom_plus2a_2 ); case 9: return &( settings->rom_plus2a_3 ); case 10: return &( settings->rom_plus3_0 ); case 11: return &( settings->rom_plus3_1 ); case 12: return &( settings->rom_plus3_2 ); case 13: return &( settings->rom_plus3_3 ); case 14: return &( settings->rom_plus3e_0 ); case 15: return &( settings->rom_plus3e_1 ); case 16: return &( settings->rom_plus3e_2 ); case 17: return &( settings->rom_plus3e_3 ); case 18: return &( settings->rom_tc2048 ); case 19: return &( settings->rom_tc2068_0 ); case 20: return &( settings->rom_tc2068_1 ); case 21: return &( settings->rom_ts2068_0 ); case 22: return &( settings->rom_ts2068_1 ); case 23: return &( settings->rom_pentagon_0 ); case 24: return &( settings->rom_pentagon_1 ); case 25: return &( settings->rom_pentagon_2 ); case 26: return &( settings->rom_pentagon512_0 ); case 27: return &( settings->rom_pentagon512_1 ); case 28: return &( settings->rom_pentagon512_2 ); case 29: return &( settings->rom_pentagon512_3 ); case 30: return &( settings->rom_pentagon1024_0 ); case 31: return &( settings->rom_pentagon1024_1 ); case 32: return &( settings->rom_pentagon1024_2 ); case 33: return &( settings->rom_pentagon1024_3 ); case 34: return &( settings->rom_scorpion_0 ); case 35: return &( settings->rom_scorpion_1 ); case 36: return &( settings->rom_scorpion_2 ); case 37: return &( settings->rom_scorpion_3 ); case 38: return &( settings->rom_spec_se_0 ); case 39: return &( settings->rom_spec_se_1 ); case 40: return &( settings->rom_interface_i ); case 41: return &( settings->rom_beta128 ); case 42: return &( settings->rom_plusd ); default: return NULL; } } int settings_set_string( char **string_setting, const char *value ) { /* No need to do anything if the two strings are in fact the same pointer */ if( *string_setting == value ) return 0; if( *string_setting) free( *string_setting ); *string_setting = strdup( value ); if( !( *string_setting ) ) { ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ ); return 1; } return 0; } int settings_free( settings_info *settings ) { CODE foreach my $name ( sort keys %options ) { if( $options{$name}->{type} eq 'string' ) { print " if( settings->$name ) free( settings->$name );\n"; } } print hashline( __LINE__ ), << 'CODE'; return 0; } int settings_end( void ) { if( settings_current.autosave_settings ) settings_write_config( &settings_current ); settings_free( &settings_current ); return 0; } CODE
twinaphex/sdcell
appport/fuse/settings.pl
Perl
lgpl-2.1
21,249
require 'socket' require 'thread' require './lib/client/looper' require './lib/client/bot' require './lib/maze/map' class MudReader < Looper def initialize(socket, bot) super("Reader") @socket = socket @bot = bot end def do_action string = @socket.recv(4*1024) #puts "Reader> read #{string}" stop if string.nil? || string.empty? print(string) if !string.nil? && !string.empty? @bot.parse_lore(string) end end class UserInput < Looper def initialize(bot) super("UserInput") @bot = bot end def do_action line = gets #puts "UserInput>read #{line}" @bot.issue_command(line.chomp) end end def exception(e,name) puts "EXCEPTION:#{name} #{e.inspect}" puts "MESSAGE:#{name} #{e.message}" puts e.backtrace.join("\n\t").sub("\n\t", ": #{e}#{e.class ? " (#{e.class})" : ''}\n\t") end socket = TCPSocket.new("falloutmud.org", 2222) bot = Bot.new(socket, position(6, 2)) bot_thread = Thread.new do begin bot.loop rescue Exception => e exception(e,"Bot") end end reader_thread = Thread.new(socket, bot) do |s, b| begin MudReader.new(s, b).loop rescue Exception => e exception(e,"Reader") end end input_thread = Thread.new(bot) do |b| begin UserInput.new(b).loop rescue Exception => e exception(e, "UserInput") end end bot_thread.join reader_thread.join input_thread.join
kirhgoff/munchkin-ruby
lib/client/mud_client.rb
Ruby
lgpl-2.1
1,387
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import sys from spack import * class Vtk(CMakePackage): """The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, image processing and visualization. """ homepage = "http://www.vtk.org" url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz" list_url = "http://www.vtk.org/download/" maintainers = ['chuckatkins', 'danlipsa'] version('9.0.0', sha256='15def4e6f84d72f82386617fe595ec124dda3cbd13ea19a0dcd91583197d8715') version('8.2.0', sha256='34c3dc775261be5e45a8049155f7228b6bd668106c72a3c435d95730d17d57bb') version('8.1.2', sha256='0995fb36857dd76ccfb8bb07350c214d9f9099e80b1e66b4a8909311f24ff0db') version('8.1.1', sha256='71a09b4340f0a9c58559fe946dc745ab68a866cf20636a41d97b6046cb736324') version('8.1.0', sha256='6e269f07b64fb13774f5925161fb4e1f379f4e6a0131c8408c555f6b58ef3cb7') version('8.0.1', sha256='49107352923dea6de05a7b4c3906aaf98ef39c91ad81c383136e768dcf304069') version('7.1.0', sha256='5f3ea001204d4f714be972a810a62c0f2277fbb9d8d2f8df39562988ca37497a') version('7.0.0', sha256='78a990a15ead79cdc752e86b83cfab7dbf5b7ef51ba409db02570dbdd9ec32c3') version('6.3.0', sha256='92a493354c5fa66bea73b5fc014154af5d9f3f6cee8d20a826f4cd5d4b0e8a5e') version('6.1.0', sha256='bd7df10a479606d529a8b71f466c44a2bdd11fd534c62ce0aa44fad91883fa34') # VTK7 defaults to OpenGL2 rendering backend variant('opengl2', default=True, description='Enable OpenGL2 backend') variant('osmesa', default=False, description='Enable OSMesa support') variant('python', default=False, description='Enable Python support') variant('qt', default=False, description='Build with support for Qt') variant('xdmf', default=False, description='Build XDMF file support') variant('ffmpeg', default=False, description='Build with FFMPEG support') variant('mpi', default=True, description='Enable MPI support') patch('gcc.patch', when='@6.1.0') # At the moment, we cannot build with both osmesa and qt, but as of # VTK 8.1, that should change conflicts('+osmesa', when='+qt') extends('python', when='+python') # Acceptable python versions depend on vtk version # We need vtk at least 8.0.1 for python@3, # and at least 9.0 for python@3.8 depends_on('python@2.7:2.9', when='@:8.0 +python', type=('build', 'run')) depends_on('python@2.7:3.7.9', when='@8.0.1:8.9 +python', type=('build', 'run')) depends_on('python@2.7:', when='@9.0: +python', type=('build', 'run')) # We need mpi4py if buidling python wrappers and using MPI depends_on('py-mpi4py', when='+python+mpi', type='run') # python3.7 compatibility patch backported from upstream # https://gitlab.kitware.com/vtk/vtk/commit/706f1b397df09a27ab8981ab9464547028d0c322 patch('python3.7-const-char.patch', when='@7.0.0:8.1.1 ^python@3.7:') # The use of the OpenGL2 backend requires at least OpenGL Core Profile # version 3.2 or higher. depends_on('gl@3.2:', when='+opengl2') depends_on('gl@1.2:', when='~opengl2') if sys.platform != 'darwin': depends_on('glx', when='~osmesa') depends_on('libxt', when='~osmesa') # Note: it is recommended to use mesa+llvm, if possible. # mesa default is software rendering, llvm makes it faster depends_on('mesa+osmesa', when='+osmesa') # VTK will need Qt5OpenGL, and qt needs '-opengl' for that depends_on('qt+opengl', when='+qt') depends_on('boost', when='+xdmf') depends_on('boost+mpi', when='+xdmf +mpi') depends_on('ffmpeg', when='+ffmpeg') depends_on('mpi', when='+mpi') depends_on('expat') depends_on('freetype') depends_on('glew') # set hl variant explicitly, similar to issue #7145 depends_on('hdf5+hl') depends_on('jpeg') depends_on('jsoncpp') depends_on('libxml2') depends_on('lz4') depends_on('netcdf-c~mpi', when='~mpi') depends_on('netcdf-c+mpi', when='+mpi') depends_on('netcdf-cxx') depends_on('libpng') depends_on('libtiff') depends_on('zlib') depends_on('eigen', when='@8.2.0:') depends_on('double-conversion', when='@8.2.0:') depends_on('sqlite', when='@8.2.0:') # For finding Fujitsu-MPI wrapper commands patch('find_fujitsu_mpi.patch', when='@:8.2.0%fj') def url_for_version(self, version): url = "http://www.vtk.org/files/release/{0}/VTK-{1}.tar.gz" return url.format(version.up_to(2), version) def setup_build_environment(self, env): # VTK has some trouble finding freetype unless it is set in # the environment env.set('FREETYPE_DIR', self.spec['freetype'].prefix) def cmake_args(self): spec = self.spec opengl_ver = 'OpenGL{0}'.format('2' if '+opengl2' in spec else '') cmake_args = [ '-DBUILD_SHARED_LIBS=ON', '-DVTK_RENDERING_BACKEND:STRING={0}'.format(opengl_ver), # In general, we disable use of VTK "ThirdParty" libs, preferring # spack-built versions whenever possible '-DVTK_USE_SYSTEM_LIBRARIES:BOOL=ON', # However, in a few cases we can't do without them yet '-DVTK_USE_SYSTEM_GL2PS:BOOL=OFF', '-DVTK_USE_SYSTEM_LIBHARU=OFF', '-DNETCDF_DIR={0}'.format(spec['netcdf-c'].prefix), '-DNETCDF_C_ROOT={0}'.format(spec['netcdf-c'].prefix), '-DNETCDF_CXX_ROOT={0}'.format(spec['netcdf-cxx'].prefix), # Allow downstream codes (e.g. VisIt) to override VTK's classes '-DVTK_ALL_NEW_OBJECT_FACTORY:BOOL=ON', # Disable wrappers for other languages. '-DVTK_WRAP_JAVA=OFF', '-DVTK_WRAP_TCL=OFF', ] # Some variable names have changed if spec.satisfies('@8.2.0:'): cmake_args.extend([ '-DVTK_USE_SYSTEM_OGG:BOOL=OFF', '-DVTK_USE_SYSTEM_THEORA:BOOL=OFF', '-DVTK_USE_SYSTEM_LIBPROJ:BOOL=OFF', '-DVTK_USE_SYSTEM_PUGIXML:BOOL=OFF', ]) else: cmake_args.extend([ '-DVTK_USE_SYSTEM_OGGTHEORA:BOOL=OFF', '-DVTK_USE_SYSTEM_LIBPROJ4:BOOL=OFF', ]) if '+mpi' in spec: if spec.satisfies('@:8.2.0'): cmake_args.extend([ '-DVTK_Group_MPI:BOOL=ON', '-DVTK_USE_SYSTEM_DIY2:BOOL=OFF' ]) else: cmake_args.extend([ '-DVTK_USE_MPI=ON' ]) if '+ffmpeg' in spec: cmake_args.extend(['-DModule_vtkIOFFMPEG:BOOL=ON']) # Enable/Disable wrappers for Python. if '+python' in spec: cmake_args.extend([ '-DVTK_WRAP_PYTHON=ON', '-DPYTHON_EXECUTABLE={0}'.format(spec['python'].command.path), ]) if '+mpi' in spec: cmake_args.append('-DVTK_USE_SYSTEM_MPI4PY:BOOL=ON') if spec.satisfies('@9.0.0: ^python@3:'): cmake_args.append('-DVTK_PYTHON_VERSION=3') else: cmake_args.append('-DVTK_WRAP_PYTHON=OFF') if 'darwin' in spec.architecture: cmake_args.extend([ '-DCMAKE_MACOSX_RPATH=ON' ]) if '+qt' in spec: qt_ver = spec['qt'].version.up_to(1) qt_bin = spec['qt'].prefix.bin qmake_exe = os.path.join(qt_bin, 'qmake') cmake_args.extend([ # Enable Qt support here. '-DVTK_QT_VERSION:STRING={0}'.format(qt_ver), '-DQT_QMAKE_EXECUTABLE:PATH={0}'.format(qmake_exe), '-DVTK_Group_Qt:BOOL=ON', ]) # NOTE: The following definitions are required in order to allow # VTK to build with qt~webkit versions (see the documentation for # more info: http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup). if '~webkit' in spec['qt']: cmake_args.extend([ '-DVTK_Group_Qt:BOOL=OFF', '-DModule_vtkGUISupportQt:BOOL=ON', '-DModule_vtkGUISupportQtOpenGL:BOOL=ON', ]) if '+xdmf' in spec: if spec.satisfies('^cmake@3.12:'): # This policy exists only for CMake >= 3.12 cmake_args.extend(["-DCMAKE_POLICY_DEFAULT_CMP0074=NEW"]) cmake_args.extend([ # Enable XDMF Support here "-DModule_vtkIOXdmf2:BOOL=ON", "-DModule_vtkIOXdmf3:BOOL=ON", "-DBOOST_ROOT={0}".format(spec['boost'].prefix), "-DBOOST_LIBRARY_DIR={0}".format(spec['boost'].prefix.lib), "-DBOOST_INCLUDE_DIR={0}".format(spec['boost'].prefix.include), "-DBOOST_NO_SYSTEM_PATHS:BOOL=ON", # This is needed because VTK has multiple FindBoost # and they stick to system boost if there's a system boost # installed with CMake "-DBoost_NO_BOOST_CMAKE:BOOL=ON", "-DHDF5_ROOT={0}".format(spec['hdf5'].prefix), # The xdmf project does not export any CMake file... "-DVTK_USE_SYSTEM_XDMF3:BOOL=OFF", "-DVTK_USE_SYSTEM_XDMF2:BOOL=OFF" ]) if '+mpi' in spec: cmake_args.extend(["-DModule_vtkIOParallelXdmf3:BOOL=ON"]) cmake_args.append('-DVTK_RENDERING_BACKEND:STRING=' + opengl_ver) if spec.satisfies('@:8.1.0'): cmake_args.append('-DVTK_USE_SYSTEM_GLEW:BOOL=ON') if '+osmesa' in spec: cmake_args.extend([ '-DVTK_USE_X:BOOL=OFF', '-DVTK_USE_COCOA:BOOL=OFF', '-DVTK_OPENGL_HAS_OSMESA:BOOL=ON']) else: cmake_args.append('-DVTK_OPENGL_HAS_OSMESA:BOOL=OFF') if spec.satisfies('@:7.9.9'): # This option is gone in VTK 8.1.2 cmake_args.append('-DOpenGL_GL_PREFERENCE:STRING=LEGACY') if 'darwin' in spec.architecture: cmake_args.extend([ '-DVTK_USE_X:BOOL=OFF', '-DVTK_USE_COCOA:BOOL=ON']) elif 'linux' in spec.architecture: cmake_args.extend([ '-DVTK_USE_X:BOOL=ON', '-DVTK_USE_COCOA:BOOL=OFF']) if spec.satisfies('@:6.1.0'): cmake_args.extend([ '-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY', '-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY' ]) # VTK 6.1.0 (and possibly earlier) does not use # NETCDF_CXX_ROOT to detect NetCDF C++ bindings, so # NETCDF_CXX_INCLUDE_DIR and NETCDF_CXX_LIBRARY must be # used instead to detect these bindings netcdf_cxx_lib = spec['netcdf-cxx'].libs.joined() cmake_args.extend([ '-DNETCDF_CXX_INCLUDE_DIR={0}'.format( spec['netcdf-cxx'].prefix.include), '-DNETCDF_CXX_LIBRARY={0}'.format(netcdf_cxx_lib), ]) # Garbage collection is unsupported in Xcode starting with # version 5.1; if the Apple clang version of the compiler # is 5.1.0 or later, unset the required Objective-C flags # to remove the garbage collection flags. Versions of VTK # after 6.1.0 set VTK_REQUIRED_OBJCXX_FLAGS to the empty # string. This fix was recommended on the VTK mailing list # in March 2014 (see # https://public.kitware.com/pipermail/vtkusers/2014-March/083368.html) if self.spec.satisfies('%apple-clang@5.1.0:'): cmake_args.extend(['-DVTK_REQUIRED_OBJCXX_FLAGS=']) # A bug in tao pegtl causes build failures with intel compilers if '%intel' in spec and spec.version >= Version('8.2'): cmake_args.append( '-DVTK_MODULE_ENABLE_VTK_IOMotionFX:BOOL=OFF') return cmake_args
rspavel/spack
var/spack/repos/builtin/packages/vtk/package.py
Python
lgpl-2.1
12,385
/* Copyright (C) 2008 Egon Willighagen <egonw@users.sf.net> * * Contact: cdk-devel@slists.sourceforge.net * * 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. * All we ask is that proper credit is given for our work, which includes * - but is not limited to - adding the above copyright notice to the beginning * of your source code files, and to any copyright notice that you may distribute * with programs based on this work. * * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NCDK.IO.Formats { // @cdk.module test-ioformats [TestClass()] public class Chem3DCartesian2FormatTest : ChemFormatTest { public Chem3DCartesian2FormatTest() { base.SetChemFormat((IChemFormat)Chem3DCartesian2Format.Instance); } } }
kazuyaujihara/NCDK
NCDKTests/IO/Formats/Chem3DCartesian2FormatTest.cs
C#
lgpl-2.1
1,476
# python # This file is generated by a program (mib2py). import HOST_RESOURCES_MIB OIDMAP = { '1.3.6.1.2.1.25': HOST_RESOURCES_MIB.host, '1.3.6.1.2.1.25.1': HOST_RESOURCES_MIB.hrSystem, '1.3.6.1.2.1.25.2': HOST_RESOURCES_MIB.hrStorage, '1.3.6.1.2.1.25.2.1': HOST_RESOURCES_MIB.hrStorageTypes, '1.3.6.1.2.1.25.3': HOST_RESOURCES_MIB.hrDevice, '1.3.6.1.2.1.25.3.1': HOST_RESOURCES_MIB.hrDeviceTypes, '1.3.6.1.2.1.25.3.9': HOST_RESOURCES_MIB.hrFSTypes, '1.3.6.1.2.1.25.4': HOST_RESOURCES_MIB.hrSWRun, '1.3.6.1.2.1.25.5': HOST_RESOURCES_MIB.hrSWRunPerf, '1.3.6.1.2.1.25.6': HOST_RESOURCES_MIB.hrSWInstalled, '1.3.6.1.2.1.25.7': HOST_RESOURCES_MIB.hrMIBAdminInfo, '1.3.6.1.2.1.25.7.1': HOST_RESOURCES_MIB.hostResourcesMibModule, '1.3.6.1.2.1.25.7.2': HOST_RESOURCES_MIB.hrMIBCompliances, '1.3.6.1.2.1.25.7.3': HOST_RESOURCES_MIB.hrMIBGroups, '1.3.6.1.2.1.25.1.1': HOST_RESOURCES_MIB.hrSystemUptime, '1.3.6.1.2.1.25.1.2': HOST_RESOURCES_MIB.hrSystemDate, '1.3.6.1.2.1.25.1.3': HOST_RESOURCES_MIB.hrSystemInitialLoadDevice, '1.3.6.1.2.1.25.1.4': HOST_RESOURCES_MIB.hrSystemInitialLoadParameters, '1.3.6.1.2.1.25.1.5': HOST_RESOURCES_MIB.hrSystemNumUsers, '1.3.6.1.2.1.25.1.6': HOST_RESOURCES_MIB.hrSystemProcesses, '1.3.6.1.2.1.25.1.7': HOST_RESOURCES_MIB.hrSystemMaxProcesses, '1.3.6.1.2.1.25.2.2': HOST_RESOURCES_MIB.hrMemorySize, '1.3.6.1.2.1.25.4.1': HOST_RESOURCES_MIB.hrSWOSIndex, '1.3.6.1.2.1.25.6.1': HOST_RESOURCES_MIB.hrSWInstalledLastChange, '1.3.6.1.2.1.25.6.2': HOST_RESOURCES_MIB.hrSWInstalledLastUpdateTime, '1.3.6.1.2.1.25.2.3.1.1': HOST_RESOURCES_MIB.hrStorageIndex, '1.3.6.1.2.1.25.2.3.1.2': HOST_RESOURCES_MIB.hrStorageType, '1.3.6.1.2.1.25.2.3.1.3': HOST_RESOURCES_MIB.hrStorageDescr, '1.3.6.1.2.1.25.2.3.1.4': HOST_RESOURCES_MIB.hrStorageAllocationUnits, '1.3.6.1.2.1.25.2.3.1.5': HOST_RESOURCES_MIB.hrStorageSize, '1.3.6.1.2.1.25.2.3.1.6': HOST_RESOURCES_MIB.hrStorageUsed, '1.3.6.1.2.1.25.2.3.1.7': HOST_RESOURCES_MIB.hrStorageAllocationFailures, '1.3.6.1.2.1.25.3.2.1.1': HOST_RESOURCES_MIB.hrDeviceIndex, '1.3.6.1.2.1.25.3.2.1.2': HOST_RESOURCES_MIB.hrDeviceType, '1.3.6.1.2.1.25.3.2.1.3': HOST_RESOURCES_MIB.hrDeviceDescr, '1.3.6.1.2.1.25.3.2.1.4': HOST_RESOURCES_MIB.hrDeviceID, '1.3.6.1.2.1.25.3.2.1.5': HOST_RESOURCES_MIB.hrDeviceStatus, '1.3.6.1.2.1.25.3.2.1.6': HOST_RESOURCES_MIB.hrDeviceErrors, '1.3.6.1.2.1.25.3.3.1.1': HOST_RESOURCES_MIB.hrProcessorFrwID, '1.3.6.1.2.1.25.3.3.1.2': HOST_RESOURCES_MIB.hrProcessorLoad, '1.3.6.1.2.1.25.3.4.1.1': HOST_RESOURCES_MIB.hrNetworkIfIndex, '1.3.6.1.2.1.25.3.5.1.1': HOST_RESOURCES_MIB.hrPrinterStatus, '1.3.6.1.2.1.25.3.5.1.2': HOST_RESOURCES_MIB.hrPrinterDetectedErrorState, '1.3.6.1.2.1.25.3.6.1.1': HOST_RESOURCES_MIB.hrDiskStorageAccess, '1.3.6.1.2.1.25.3.6.1.2': HOST_RESOURCES_MIB.hrDiskStorageMedia, '1.3.6.1.2.1.25.3.6.1.3': HOST_RESOURCES_MIB.hrDiskStorageRemoveble, '1.3.6.1.2.1.25.3.6.1.4': HOST_RESOURCES_MIB.hrDiskStorageCapacity, '1.3.6.1.2.1.25.3.7.1.1': HOST_RESOURCES_MIB.hrPartitionIndex, '1.3.6.1.2.1.25.3.7.1.2': HOST_RESOURCES_MIB.hrPartitionLabel, '1.3.6.1.2.1.25.3.7.1.3': HOST_RESOURCES_MIB.hrPartitionID, '1.3.6.1.2.1.25.3.7.1.4': HOST_RESOURCES_MIB.hrPartitionSize, '1.3.6.1.2.1.25.3.7.1.5': HOST_RESOURCES_MIB.hrPartitionFSIndex, '1.3.6.1.2.1.25.3.8.1.1': HOST_RESOURCES_MIB.hrFSIndex, '1.3.6.1.2.1.25.3.8.1.2': HOST_RESOURCES_MIB.hrFSMountPoint, '1.3.6.1.2.1.25.3.8.1.3': HOST_RESOURCES_MIB.hrFSRemoteMountPoint, '1.3.6.1.2.1.25.3.8.1.4': HOST_RESOURCES_MIB.hrFSType, '1.3.6.1.2.1.25.3.8.1.5': HOST_RESOURCES_MIB.hrFSAccess, '1.3.6.1.2.1.25.3.8.1.6': HOST_RESOURCES_MIB.hrFSBootable, '1.3.6.1.2.1.25.3.8.1.7': HOST_RESOURCES_MIB.hrFSStorageIndex, '1.3.6.1.2.1.25.3.8.1.8': HOST_RESOURCES_MIB.hrFSLastFullBackupDate, '1.3.6.1.2.1.25.3.8.1.9': HOST_RESOURCES_MIB.hrFSLastPartialBackupDate, '1.3.6.1.2.1.25.4.2.1.1': HOST_RESOURCES_MIB.hrSWRunIndex, '1.3.6.1.2.1.25.4.2.1.2': HOST_RESOURCES_MIB.hrSWRunName, '1.3.6.1.2.1.25.4.2.1.3': HOST_RESOURCES_MIB.hrSWRunID, '1.3.6.1.2.1.25.4.2.1.4': HOST_RESOURCES_MIB.hrSWRunPath, '1.3.6.1.2.1.25.4.2.1.5': HOST_RESOURCES_MIB.hrSWRunParameters, '1.3.6.1.2.1.25.4.2.1.6': HOST_RESOURCES_MIB.hrSWRunType, '1.3.6.1.2.1.25.4.2.1.7': HOST_RESOURCES_MIB.hrSWRunStatus, '1.3.6.1.2.1.25.5.1.1.1': HOST_RESOURCES_MIB.hrSWRunPerfCPU, '1.3.6.1.2.1.25.5.1.1.2': HOST_RESOURCES_MIB.hrSWRunPerfMem, '1.3.6.1.2.1.25.6.3.1.1': HOST_RESOURCES_MIB.hrSWInstalledIndex, '1.3.6.1.2.1.25.6.3.1.2': HOST_RESOURCES_MIB.hrSWInstalledName, '1.3.6.1.2.1.25.6.3.1.3': HOST_RESOURCES_MIB.hrSWInstalledID, '1.3.6.1.2.1.25.6.3.1.4': HOST_RESOURCES_MIB.hrSWInstalledType, '1.3.6.1.2.1.25.6.3.1.5': HOST_RESOURCES_MIB.hrSWInstalledDate, '1.3.6.1.2.1.25.7.3.1': HOST_RESOURCES_MIB.hrSystemGroup, '1.3.6.1.2.1.25.7.3.2': HOST_RESOURCES_MIB.hrStorageGroup, '1.3.6.1.2.1.25.7.3.3': HOST_RESOURCES_MIB.hrDeviceGroup, '1.3.6.1.2.1.25.7.3.4': HOST_RESOURCES_MIB.hrSWRunGroup, '1.3.6.1.2.1.25.7.3.5': HOST_RESOURCES_MIB.hrSWRunPerfGroup, '1.3.6.1.2.1.25.7.3.6': HOST_RESOURCES_MIB.hrSWInstalledGroup, }
xiangke/pycopia
mibs/pycopia/mibs/HOST_RESOURCES_MIB_OID.py
Python
lgpl-2.1
5,000
// The libMesh Finite Element Library. // Copyright (C) 2002-2020 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 #include "libmesh/libmesh_common.h" #include "libmesh/parallel.h" // C++ Includes #include <cstdio> // for std::sprintf #include <set> #include <numeric> // for std::partial_sum // Local Include #include "libmesh/libmesh_version.h" #include "libmesh/system.h" #include "libmesh/mesh_base.h" #include "libmesh/elem.h" #include "libmesh/xdr_cxx.h" #include "libmesh/numeric_vector.h" #include "libmesh/dof_map.h" #include "libmesh/auto_ptr.h" // libmesh_make_unique // Anonymous namespace for implementation details. namespace { using libMesh::DofObject; using libMesh::Number; using libMesh::cast_int; // Comments: // --------- // - The max_io_blksize governs how many nodes or elements will be // treated as a single block when performing parallel IO on large // systems. // - This parameter only loosely affects the size of the actual IO // buffer as this depends on the number of components a given // variable has for the nodes/elements in the block. // - When reading/writing each processor uses an ID map which is // 3*io_blksize*sizeof(dof_id_type) bytes long, so with unsigned int // and // io_blksize=256000 we would expect that buffer alone to be // ~3Mb. // - In general, an increase in max_io_blksize should increase the // efficiency of large parallel read/writes by reducing the number // of MPI messages at the expense of memory. // - If the library exhausts memory during IO you might reduce this // parameter. const std::size_t max_io_blksize = 256000; /** * Comparison object to use with DofObject pointers. This sorts by id(), * so when we iterate over a set of DofObjects we visit the objects in * order of increasing ID. */ struct CompareDofObjectsByID { bool operator()(const DofObject * a, const DofObject * b) const { libmesh_assert (a); libmesh_assert (b); return a->id() < b->id(); } }; /** * */ template <typename InValType> class ThreadedIO { private: libMesh::Xdr & _io; std::vector<InValType> & _data; public: ThreadedIO (libMesh::Xdr & io, std::vector<InValType> & data) : _io(io), _data(data) {} void operator()() { if (_data.empty()) return; _io.data_stream (_data.data(), cast_int<unsigned int>(_data.size())); } }; } namespace libMesh { // ------------------------------------------------------------ // System class implementation void System::read_header (Xdr & io, const std::string & version, const bool read_header_in, const bool read_additional_data, const bool read_legacy_format) { // This method implements the input of a // System object, embedded in the output of // an EquationSystems<T_sys>. This warrants some // documentation. The output file essentially // consists of 5 sections: // // for this system // // 5.) The number of variables in the system (unsigned int) // // for each variable in the system // // 6.) The name of the variable (string) // // 6.1.) Variable subdomains // // 7.) Combined in an FEType: // - The approximation order(s) of the variable // (Order Enum, cast to int/s) // - The finite element family/ies of the variable // (FEFamily Enum, cast to int/s) // // end variable loop // // 8.) The number of additional vectors (unsigned int), // // for each additional vector in the system object // // 9.) the name of the additional vector (string) // // end system libmesh_assert (io.reading()); // Possibly clear data structures and start from scratch. if (read_header_in) this->clear (); // Figure out if we need to read infinite element information. // This will be true if the version string contains " with infinite elements" const bool read_ifem_info = (version.rfind(" with infinite elements") < version.size()) || libMesh::on_command_line ("--read-ifem-systems"); { // 5.) // Read the number of variables in the system unsigned int nv=0; if (this->processor_id() == 0) io.data (nv); this->comm().broadcast(nv); _written_var_indices.clear(); _written_var_indices.resize(nv, 0); for (unsigned int var=0; var<nv; var++) { // 6.) // Read the name of the var-th variable std::string var_name; if (this->processor_id() == 0) io.data (var_name); this->comm().broadcast(var_name); // 6.1.) std::set<subdomain_id_type> domains; if (io.version() >= LIBMESH_VERSION_ID(0,7,2)) { std::vector<subdomain_id_type> domain_array; if (this->processor_id() == 0) io.data (domain_array); for (const auto & id : domain_array) domains.insert(id); } this->comm().broadcast(domains); // 7.) // Read the approximation order(s) of the var-th variable int order=0; if (this->processor_id() == 0) io.data (order); this->comm().broadcast(order); // do the same for infinite element radial_order int rad_order=0; if (read_ifem_info) { if (this->processor_id() == 0) io.data(rad_order); this->comm().broadcast(rad_order); } // Read the finite element type of the var-th variable int fam=0; if (this->processor_id() == 0) io.data (fam); this->comm().broadcast(fam); FEType type; type.order = static_cast<Order>(order); type.family = static_cast<FEFamily>(fam); // Check for incompatibilities. The shape function indexing was // changed for the monomial and xyz finite element families to // simplify extension to arbitrary p. The consequence is that // old restart files will not be read correctly. This is expected // to be an unlikely occurence, but catch it anyway. if (read_legacy_format) if ((type.family == MONOMIAL || type.family == XYZ) && ((type.order.get_order() > 2 && this->get_mesh().mesh_dimension() == 2) || (type.order.get_order() > 1 && this->get_mesh().mesh_dimension() == 3))) { libmesh_here(); libMesh::out << "*****************************************************************\n" << "* WARNING: reading a potentially incompatible restart file!!! *\n" << "* contact libmesh-users@lists.sourceforge.net for more details *\n" << "*****************************************************************" << std::endl; } // Read additional information for infinite elements int radial_fam=0; int i_map=0; if (read_ifem_info) { if (this->processor_id() == 0) io.data (radial_fam); this->comm().broadcast(radial_fam); if (this->processor_id() == 0) io.data (i_map); this->comm().broadcast(i_map); } #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS type.radial_order = static_cast<Order>(rad_order); type.radial_family = static_cast<FEFamily>(radial_fam); type.inf_map = static_cast<InfMapType>(i_map); #endif if (read_header_in) { if (domains.empty()) _written_var_indices[var] = this->add_variable (var_name, type); else _written_var_indices[var] = this->add_variable (var_name, type, &domains); } else _written_var_indices[var] = this->variable_number(var_name); } } // 8.) // Read the number of additional vectors. unsigned int nvecs=0; if (this->processor_id() == 0) io.data (nvecs); this->comm().broadcast(nvecs); // If nvecs > 0, this means that write_additional_data // was true when this file was written. We will need to // make use of this fact later. this->_additional_data_written = nvecs; for (unsigned int vec=0; vec<nvecs; vec++) { // 9.) // Read the name of the vec-th additional vector std::string vec_name; if (this->processor_id() == 0) io.data (vec_name); this->comm().broadcast(vec_name); if (read_additional_data) { // Systems now can handle adding post-initialization vectors // libmesh_assert(this->_can_add_vectors); // Some systems may have added their own vectors already // libmesh_assert_equal_to (this->_vectors.count(vec_name), 0); this->add_vector(vec_name); } } } #ifdef LIBMESH_ENABLE_DEPRECATED void System::read_legacy_data (Xdr & io, const bool read_additional_data) { libmesh_deprecated(); // This method implements the output of the vectors // contained in this System object, embedded in the // output of an EquationSystems<T_sys>. // // 10.) The global solution vector, re-ordered to be node-major // (More on this later.) // // for each additional vector in the object // // 11.) The global additional vector, re-ordered to be // node-major (More on this later.) libmesh_assert (io.reading()); // read and reordering buffers std::vector<Number> global_vector; std::vector<Number> reordered_vector; // 10.) // Read and set the solution vector { if (this->processor_id() == 0) io.data (global_vector); this->comm().broadcast(global_vector); // Remember that the stored vector is node-major. // We need to put it into whatever application-specific // ordering we may have using the dof_map. reordered_vector.resize(global_vector.size()); //libMesh::out << "global_vector.size()=" << global_vector.size() << std::endl; //libMesh::out << "this->n_dofs()=" << this->n_dofs() << std::endl; libmesh_assert_equal_to (global_vector.size(), this->n_dofs()); dof_id_type cnt=0; const unsigned int sys = this->number(); const unsigned int nv = cast_int<unsigned int> (this->_written_var_indices.size()); libmesh_assert_less_equal (nv, this->n_vars()); for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; // First reorder the nodal DOF values for (auto & node : this->get_mesh().node_ptr_range()) for (auto index : IntRange<unsigned int>(0, node->n_comp(sys,var))) { libmesh_assert_not_equal_to (node->dof_number(sys, var, index), DofObject::invalid_id); libmesh_assert_less (cnt, global_vector.size()); reordered_vector[node->dof_number(sys, var, index)] = global_vector[cnt++]; } // Then reorder the element DOF values for (auto & elem : this->get_mesh().active_element_ptr_range()) for (auto index : IntRange<unsigned int>(0, elem->n_comp(sys,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys, var, index), DofObject::invalid_id); libmesh_assert_less (cnt, global_vector.size()); reordered_vector[elem->dof_number(sys, var, index)] = global_vector[cnt++]; } } *(this->solution) = reordered_vector; } // For each additional vector, simply go through the list. // ONLY attempt to do this IF additional data was actually // written to the file for this system (controlled by the // _additional_data_written flag). if (this->_additional_data_written) { const std::size_t nvecs = this->_vectors.size(); // If the number of additional vectors written is non-zero, and // the number of additional vectors we have is non-zero, and // they don't match, then something is wrong and we can't be // sure we're reading data into the correct places. if (read_additional_data && nvecs && nvecs != this->_additional_data_written) libmesh_error_msg ("Additional vectors in file do not match system"); std::map<std::string, NumericVector<Number> *>::iterator pos = this->_vectors.begin(); for (std::size_t i = 0; i != this->_additional_data_written; ++i) { // 11.) // Read the values of the vec-th additional vector. // Prior do _not_ clear, but fill with zero, since the // additional vectors _have_ to have the same size // as the solution vector std::fill (global_vector.begin(), global_vector.end(), libMesh::zero); if (this->processor_id() == 0) io.data (global_vector); // If read_additional_data==true and we have additional vectors, // then we will keep this vector data; otherwise we are going to // throw it away. if (read_additional_data && nvecs) { this->comm().broadcast(global_vector); // Remember that the stored vector is node-major. // We need to put it into whatever application-specific // ordering we may have using the dof_map. std::fill (reordered_vector.begin(), reordered_vector.end(), libMesh::zero); reordered_vector.resize(global_vector.size()); libmesh_assert_equal_to (global_vector.size(), this->n_dofs()); dof_id_type cnt=0; const unsigned int sys = this->number(); const unsigned int nv = cast_int<unsigned int> (this->_written_var_indices.size()); libmesh_assert_less_equal (nv, this->n_vars()); for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; // First reorder the nodal DOF values for (auto & node : this->get_mesh().node_ptr_range()) for (auto index : IntRange<unsigned int>(0, node->n_comp(sys,var))) { libmesh_assert_not_equal_to (node->dof_number(sys, var, index), DofObject::invalid_id); libmesh_assert_less (cnt, global_vector.size()); reordered_vector[node->dof_number(sys, var, index)] = global_vector[cnt++]; } // Then reorder the element DOF values for (auto & elem : this->get_mesh().active_element_ptr_range()) for (auto index : IntRange<unsigned int>(0, elem->n_comp(sys,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys, var, index), DofObject::invalid_id); libmesh_assert_less (cnt, global_vector.size()); reordered_vector[elem->dof_number(sys, var, index)] = global_vector[cnt++]; } } // use the overloaded operator=(std::vector) to assign the values *(pos->second) = reordered_vector; } // If we've got vectors then we need to be iterating through // those too if (pos != this->_vectors.end()) ++pos; } } // end if (_additional_data_written) } #endif template <typename InValType> void System::read_parallel_data (Xdr & io, const bool read_additional_data) { /** * This method implements the output of the vectors * contained in this System object, embedded in the * output of an EquationSystems<T_sys>. * * 9.) The global solution vector, re-ordered to be node-major * (More on this later.) * * for each additional vector in the object * * 10.) The global additional vector, re-ordered to be * node-major (More on this later.) * * Note that the actual IO is handled through the Xdr class * (to be renamed later?) which provides a uniform interface to * both the XDR (eXternal Data Representation) interface and standard * ASCII output. Thus this one section of code will read XDR or ASCII * files with no changes. */ // PerfLog pl("IO Performance",false); // pl.push("read_parallel_data"); dof_id_type total_read_size = 0; libmesh_assert (io.reading()); libmesh_assert (io.is_open()); // build the ordered nodes and element maps. // when writing/reading parallel files we need to iterate // over our nodes/elements in order of increasing global id(). // however, this is not guaranteed to be ordering we obtain // by using the node_iterators/element_iterators directly. // so build a set, sorted by id(), that provides the ordering. // further, for memory economy build the set but then transfer // its contents to vectors, which will be sorted. std::vector<const DofObject *> ordered_nodes, ordered_elements; { std::set<const DofObject *, CompareDofObjectsByID> ordered_nodes_set (this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end()); ordered_nodes.insert(ordered_nodes.end(), ordered_nodes_set.begin(), ordered_nodes_set.end()); } { std::set<const DofObject *, CompareDofObjectsByID> ordered_elements_set (this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end()); ordered_elements.insert(ordered_elements.end(), ordered_elements_set.begin(), ordered_elements_set.end()); } // std::vector<Number> io_buffer; std::vector<InValType> io_buffer; // 9.) // // Actually read the solution components // for the ith system to disk io.data(io_buffer); total_read_size += cast_int<dof_id_type>(io_buffer.size()); const unsigned int sys_num = this->number(); const unsigned int nv = cast_int<unsigned int> (this->_written_var_indices.size()); libmesh_assert_less_equal (nv, this->n_vars()); dof_id_type cnt=0; // Loop over each non-SCALAR variable and each node, and read out the value. for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family != SCALAR) { // First read the node DOF values for (const auto & node : ordered_nodes) for (auto comp : IntRange<unsigned int>(0, node->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (node->dof_number(sys_num, var, comp), DofObject::invalid_id); libmesh_assert_less (cnt, io_buffer.size()); this->solution->set(node->dof_number(sys_num, var, comp), io_buffer[cnt++]); } // Then read the element DOF values for (const auto & elem : ordered_elements) for (auto comp : IntRange<unsigned int>(0, elem->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys_num, var, comp), DofObject::invalid_id); libmesh_assert_less (cnt, io_buffer.size()); this->solution->set(elem->dof_number(sys_num, var, comp), io_buffer[cnt++]); } } } // Finally, read the SCALAR variables on the last processor for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family == SCALAR) { if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); for (auto dof : SCALAR_dofs) this->solution->set(dof, io_buffer[cnt++]); } } } // And we're done setting solution entries this->solution->close(); // For each additional vector, simply go through the list. // ONLY attempt to do this IF additional data was actually // written to the file for this system (controlled by the // _additional_data_written flag). if (this->_additional_data_written) { const std::size_t nvecs = this->_vectors.size(); // If the number of additional vectors written is non-zero, and // the number of additional vectors we have is non-zero, and // they don't match, then something is wrong and we can't be // sure we're reading data into the correct places. if (read_additional_data && nvecs && nvecs != this->_additional_data_written) libmesh_error_msg ("Additional vectors in file do not match system"); std::map<std::string, NumericVector<Number> *>::const_iterator pos = _vectors.begin(); for (std::size_t i = 0; i != this->_additional_data_written; ++i) { cnt=0; io_buffer.clear(); // 10.) // // Actually read the additional vector components // for the ith system from disk io.data(io_buffer); total_read_size += cast_int<dof_id_type>(io_buffer.size()); // If read_additional_data==true and we have additional vectors, // then we will keep this vector data; otherwise we are going to // throw it away. if (read_additional_data && nvecs) { // Loop over each non-SCALAR variable and each node, and read out the value. for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family != SCALAR) { // First read the node DOF values for (const auto & node : ordered_nodes) for (auto comp : IntRange<unsigned int>(0, node->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (node->dof_number(sys_num, var, comp), DofObject::invalid_id); libmesh_assert_less (cnt, io_buffer.size()); pos->second->set(node->dof_number(sys_num, var, comp), io_buffer[cnt++]); } // Then read the element DOF values for (const auto & elem : ordered_elements) for (auto comp : IntRange<unsigned int>(0, elem->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys_num, var, comp), DofObject::invalid_id); libmesh_assert_less (cnt, io_buffer.size()); pos->second->set(elem->dof_number(sys_num, var, comp), io_buffer[cnt++]); } } } // Finally, read the SCALAR variables on the last processor for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family == SCALAR) { if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); for (auto dof : SCALAR_dofs) pos->second->set(dof, io_buffer[cnt++]); } } } // And we're done setting entries for this variable pos->second->close(); } // If we've got vectors then we need to be iterating through // those too if (pos != this->_vectors.end()) ++pos; } } // const Real // dt = pl.get_elapsed_time(), // rate = total_read_size*sizeof(Number)/dt; // libMesh::err << "Read " << total_read_size << " \"Number\" values\n" // << " Elapsed time = " << dt << '\n' // << " Rate = " << rate/1.e6 << "(MB/sec)\n\n"; // pl.pop("read_parallel_data"); } template <typename InValType> void System::read_serialized_data (Xdr & io, const bool read_additional_data) { // This method implements the input of the vectors // contained in this System object, embedded in the // output of an EquationSystems<T_sys>. // // 10.) The global solution vector, re-ordered to be node-major // (More on this later.) // // for each additional vector in the object // // 11.) The global additional vector, re-ordered to be // node-major (More on this later.) parallel_object_only(); std::string comment; // PerfLog pl("IO Performance",false); // pl.push("read_serialized_data"); // std::size_t total_read_size = 0; // 10.) // Read the global solution vector { // total_read_size += this->read_serialized_vector<InValType>(io, this->solution.get()); // get the comment if (this->processor_id() == 0) io.comment (comment); } // 11.) // Only read additional vectors if data is available, and only use // that data to fill our vectors if the user requested it. if (this->_additional_data_written) { const std::size_t nvecs = this->_vectors.size(); // If the number of additional vectors written is non-zero, and // the number of additional vectors we have is non-zero, and // they don't match, then we can't read additional vectors // and be sure we're reading data into the correct places. if (read_additional_data && nvecs && nvecs != this->_additional_data_written) libmesh_error_msg ("Additional vectors in file do not match system"); std::map<std::string, NumericVector<Number> *>::const_iterator pos = _vectors.begin(); for (std::size_t i = 0; i != this->_additional_data_written; ++i) { // Read data, but only put it into a vector if we've been // asked to and if we have a corresponding vector to read. // total_read_size += this->read_serialized_vector<InValType> (io, (read_additional_data && nvecs) ? pos->second : nullptr); // get the comment if (this->processor_id() == 0) io.comment (comment); // If we've got vectors then we need to be iterating through // those too if (pos != this->_vectors.end()) ++pos; } } // const Real // dt = pl.get_elapsed_time(), // rate = total_read_size*sizeof(Number)/dt; // libMesh::out << "Read " << total_read_size << " \"Number\" values\n" // << " Elapsed time = " << dt << '\n' // << " Rate = " << rate/1.e6 << "(MB/sec)\n\n"; // pl.pop("read_serialized_data"); } template <typename iterator_type, typename InValType> std::size_t System::read_serialized_blocked_dof_objects (const dof_id_type n_objs, const iterator_type begin, const iterator_type end, const InValType , Xdr & io, const std::vector<NumericVector<Number> *> & vecs, const unsigned int var_to_read) const { //------------------------------------------------------- // General order: (IO format 0.7.4 & greater) // // for (objects ...) // for (vecs ....) // for (vars ....) // for (comps ...) // // where objects are nodes or elements, sorted to be // partition independent, // vecs are one or more *identically distributed* solution // coefficient vectors, vars are one or more variables // to write, and comps are all the components for said // vars on the object. // variables to read. Unless specified otherwise, defaults to _written_var_indices. std::vector<unsigned int> vars_to_read (_written_var_indices); if (var_to_read != libMesh::invalid_uint) { vars_to_read.clear(); vars_to_read.push_back(var_to_read); } const unsigned int sys_num = this->number(), num_vecs = cast_int<unsigned int>(vecs.size()); const dof_id_type io_blksize = cast_int<dof_id_type>(std::min(max_io_blksize, static_cast<std::size_t>(n_objs))), num_blks = cast_int<unsigned int>(std::ceil(static_cast<double>(n_objs)/ static_cast<double>(io_blksize))); libmesh_assert_less_equal (_written_var_indices.size(), this->n_vars()); std::size_t n_read_values=0; std::vector<std::vector<dof_id_type>> xfer_ids(num_blks); // The global IDs and # of components for the local objects in all blocks std::vector<std::vector<Number>> recv_vals(num_blks); // The raw values for the local objects in all blocks std::vector<Parallel::Request> id_requests(num_blks), val_requests(num_blks); std::vector<Parallel::MessageTag> id_tags(num_blks), val_tags(num_blks); // ------------------------------------------------------ // First pass - count the number of objects in each block // traverse all the objects and figure out which block they // will ultimately live in. std::vector<std::size_t> xfer_ids_size (num_blks,0), recv_vals_size (num_blks,0); for (iterator_type it=begin; it!=end; ++it) { const dof_id_type id = (*it)->id(), block = id/io_blksize; libmesh_assert_less (block, num_blks); xfer_ids_size[block] += 2; // for each object, we send its id, as well as the total number of components for all variables dof_id_type n_comp_tot=0; for (const auto & var : vars_to_read) n_comp_tot += (*it)->n_comp(sys_num, var); // for each variable, we will receive the nonzero components recv_vals_size[block] += n_comp_tot*num_vecs; } // knowing the recv_vals_size[block] for each processor allows // us to sum them and find the global size for each block. std::vector<std::size_t> tot_vals_size(recv_vals_size); this->comm().sum (tot_vals_size); //------------------------------------------ // Collect the ids & number of values needed // for all local objects, binning them into // 'blocks' that will be sent to processor 0 for (dof_id_type blk=0; blk<num_blks; blk++) { // Each processor should build up its transfer buffers for its // local objects in [first_object,last_object). const dof_id_type first_object = blk*io_blksize, last_object = std::min(cast_int<dof_id_type>((blk+1)*io_blksize), n_objs); // convenience std::vector<dof_id_type> & ids (xfer_ids[blk]); std::vector<Number> & vals (recv_vals[blk]); // we now know the number of values we will store for each block, // so we can do efficient preallocation ids.clear(); /**/ ids.reserve (xfer_ids_size[blk]); vals.resize(recv_vals_size[blk]); if (recv_vals_size[blk] != 0) // only if there are nonzero values to receive for (iterator_type it=begin; it!=end; ++it) if (((*it)->id() >= first_object) && // object in [first_object,last_object) ((*it)->id() < last_object)) { ids.push_back((*it)->id()); unsigned int n_comp_tot=0; for (const auto & var : vars_to_read) n_comp_tot += (*it)->n_comp(sys_num, var); ids.push_back (n_comp_tot*num_vecs); } #ifdef LIBMESH_HAVE_MPI id_tags[blk] = this->comm().get_unique_tag(100*num_blks + blk); val_tags[blk] = this->comm().get_unique_tag(200*num_blks + blk); // nonblocking send the data for this block this->comm().send (0, ids, id_requests[blk], id_tags[blk]); // Go ahead and post the receive too this->comm().receive (0, vals, val_requests[blk], val_tags[blk]); #endif } //--------------------------------------------------- // Here processor 0 will read and distribute the data. // We have to do this block-wise to ensure that we // do not exhaust memory on processor 0. // give these variables scope outside the block to avoid reallocation std::vector<std::vector<dof_id_type>> recv_ids (this->n_processors()); std::vector<std::vector<Number>> send_vals (this->n_processors()); std::vector<Parallel::Request> reply_requests (this->n_processors()); std::vector<unsigned int> obj_val_offsets; // map to traverse entry-wise rather than processor-wise std::vector<Number> input_vals; // The input buffer for the current block std::vector<InValType> input_vals_tmp; // The input buffer for the current block for (dof_id_type blk=0; blk<num_blks; blk++) { // Each processor should build up its transfer buffers for its // local objects in [first_object,last_object). const dof_id_type first_object = blk*io_blksize, last_object = std::min(cast_int<dof_id_type>((blk+1)*io_blksize), n_objs), n_objects_blk = last_object - first_object; // Processor 0 has a special job. It needs to gather the requested indices // in [first_object,last_object) from all processors, read the data from // disk, and reply if (this->processor_id() == 0) { // we know the input buffer size for this block and can begin reading it now input_vals.resize(tot_vals_size[blk]); input_vals_tmp.resize(tot_vals_size[blk]); // a ThreadedIO object to perform asynchronous file IO ThreadedIO<InValType> threaded_io(io, input_vals_tmp); Threads::Thread async_io(threaded_io); // offset array. this will define where each object's values // map into the actual input_vals buffer. this must get // 0-initialized because 0-component objects are not actually sent obj_val_offsets.resize (n_objects_blk); /**/ std::fill (obj_val_offsets.begin(), obj_val_offsets.end(), 0); recv_vals_size.resize(this->n_processors()); // reuse this to count how many values are going to each processor #ifndef NDEBUG std::size_t n_vals_blk = 0; #endif // loop over all processors and process their index request for (processor_id_type comm_step=0, tnp=this->n_processors(); comm_step != tnp; ++comm_step) { #ifdef LIBMESH_HAVE_MPI // blocking receive indices for this block, imposing no particular order on processor Parallel::Status id_status (this->comm().probe (Parallel::any_source, id_tags[blk])); std::vector<dof_id_type> & ids (recv_ids[id_status.source()]); std::size_t & n_vals_proc (recv_vals_size[id_status.source()]); this->comm().receive (id_status.source(), ids, id_tags[blk]); #else // straight copy without MPI std::vector<dof_id_type> & ids (recv_ids[0]); std::size_t & n_vals_proc (recv_vals_size[0]); ids = xfer_ids[blk]; #endif n_vals_proc = 0; // note its possible we didn't receive values for objects in // this block if they have no components allocated. for (std::size_t idx=0, sz=ids.size(); idx<sz; idx+=2) { const dof_id_type local_idx = ids[idx+0]-first_object, n_vals_tot_allvecs = ids[idx+1]; libmesh_assert_less (local_idx, n_objects_blk); obj_val_offsets[local_idx] = n_vals_tot_allvecs; n_vals_proc += n_vals_tot_allvecs; } #ifndef NDEBUG n_vals_blk += n_vals_proc; #endif } // We need the offsets into the input_vals vector for each object. // fortunately, this is simply the partial sum of the total number // of components for each object std::partial_sum(obj_val_offsets.begin(), obj_val_offsets.end(), obj_val_offsets.begin()); libmesh_assert_equal_to (n_vals_blk, obj_val_offsets.back()); libmesh_assert_equal_to (n_vals_blk, tot_vals_size[blk]); // Wait for read completion async_io.join(); // now copy the values back to the main vector for transfer for (auto i_val : index_range(input_vals)) input_vals[i_val] = input_vals_tmp[i_val]; n_read_values += input_vals.size(); // pack data replies for each processor for (auto proc : IntRange<processor_id_type>(0, this->n_processors())) { const std::vector<dof_id_type> & ids (recv_ids[proc]); std::vector<Number> & vals (send_vals[proc]); const std::size_t & n_vals_proc (recv_vals_size[proc]); vals.clear(); /**/ vals.reserve(n_vals_proc); for (std::size_t idx=0, sz=ids.size(); idx<sz; idx+=2) { const dof_id_type local_idx = ids[idx+0]-first_object, n_vals_tot_allvecs = ids[idx+1]; std::vector<Number>::const_iterator in_vals(input_vals.begin()); if (local_idx != 0) std::advance (in_vals, obj_val_offsets[local_idx-1]); for (unsigned int val=0; val<n_vals_tot_allvecs; val++, ++in_vals) { libmesh_assert (in_vals != input_vals.end()); //libMesh::out << "*in_vals=" << *in_vals << '\n'; vals.push_back(*in_vals); } } #ifdef LIBMESH_HAVE_MPI // send the relevant values to this processor this->comm().send (proc, vals, reply_requests[proc], val_tags[blk]); #else recv_vals[blk] = vals; #endif } } // end processor 0 read/reply // all processors complete the (already posted) read for this block { Parallel::wait (val_requests[blk]); const std::vector<Number> & vals (recv_vals[blk]); std::vector<Number>::const_iterator val_it(vals.begin()); if (!recv_vals[blk].empty()) // nonzero values to receive for (iterator_type it=begin; it!=end; ++it) if (((*it)->id() >= first_object) && // object in [first_object,last_object) ((*it)->id() < last_object)) // unpack & set the values for (auto & vec : vecs) for (const auto & var : vars_to_read) { const unsigned int n_comp = (*it)->n_comp(sys_num, var); for (unsigned int comp=0; comp<n_comp; comp++, ++val_it) { const dof_id_type dof_index = (*it)->dof_number (sys_num, var, comp); libmesh_assert (val_it != vals.end()); if (vec) { libmesh_assert_greater_equal (dof_index, vec->first_local_index()); libmesh_assert_less (dof_index, vec->last_local_index()); //libMesh::out << "dof_index, *val_it = \t" << dof_index << ", " << *val_it << '\n'; vec->set (dof_index, *val_it); } } } } // processor 0 needs to make sure all replies have been handed off if (this->processor_id () == 0) Parallel::wait(reply_requests); } Parallel::wait(id_requests); return n_read_values; } unsigned int System::read_SCALAR_dofs (const unsigned int var, Xdr & io, NumericVector<Number> * vec) const { unsigned int n_assigned_vals = 0; // the number of values assigned, this will be returned. // Processor 0 will read the block from the buffer stream and send it to the last processor const unsigned int n_SCALAR_dofs = this->variable(var).type().order.get_order(); std::vector<Number> input_buffer(n_SCALAR_dofs); if (this->processor_id() == 0) io.data_stream(input_buffer.data(), n_SCALAR_dofs); #ifdef LIBMESH_HAVE_MPI if (this->n_processors() > 1) { const Parallel::MessageTag val_tag = this->comm().get_unique_tag(); // Post the receive on the last processor if (this->processor_id() == (this->n_processors()-1)) this->comm().receive(0, input_buffer, val_tag); // Send the data to processor 0 if (this->processor_id() == 0) this->comm().send(this->n_processors()-1, input_buffer, val_tag); } #endif // Finally, set the SCALAR values if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); for (auto i : index_range(SCALAR_dofs)) { if (vec) vec->set (SCALAR_dofs[i], input_buffer[i]); ++n_assigned_vals; } } return n_assigned_vals; } template <typename InValType> numeric_index_type System::read_serialized_vector (Xdr & io, NumericVector<Number> * vec) { parallel_object_only(); #ifndef NDEBUG // In parallel we better be reading a parallel vector -- if not // we will not set all of its components below!! if (this->n_processors() > 1 && vec) { libmesh_assert (vec->type() == PARALLEL || vec->type() == GHOSTED); } #endif libmesh_assert (io.reading()); // vector length unsigned int vector_length=0; // FIXME? size_t would break binary compatibility... #ifndef NDEBUG std::size_t n_assigned_vals=0; #endif // Get the buffer size if (this->processor_id() == 0) io.data(vector_length, "# vector length"); this->comm().broadcast(vector_length); const unsigned int nv = cast_int<unsigned int> (this->_written_var_indices.size()); const dof_id_type n_nodes = this->get_mesh().n_nodes(), n_elem = this->get_mesh().n_elem(); libmesh_assert_less_equal (nv, this->n_vars()); // for newer versions, read variables node/elem major if (io.version() >= LIBMESH_VERSION_ID(0,7,4)) { //--------------------------------- // Collect the values for all nodes #ifndef NDEBUG n_assigned_vals += #endif this->read_serialized_blocked_dof_objects (n_nodes, this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end(), InValType(), io, std::vector<NumericVector<Number> *> (1,vec)); //------------------------------------ // Collect the values for all elements #ifndef NDEBUG n_assigned_vals += #endif this->read_serialized_blocked_dof_objects (n_elem, this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end(), InValType(), io, std::vector<NumericVector<Number> *> (1,vec)); } // for older versions, read variables var-major else { // Loop over each variable in the system, and then each node/element in the mesh. for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family != SCALAR) { //--------------------------------- // Collect the values for all nodes #ifndef NDEBUG n_assigned_vals += #endif this->read_serialized_blocked_dof_objects (n_nodes, this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end(), InValType(), io, std::vector<NumericVector<Number> *> (1,vec), var); //------------------------------------ // Collect the values for all elements #ifndef NDEBUG n_assigned_vals += #endif this->read_serialized_blocked_dof_objects (n_elem, this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end(), InValType(), io, std::vector<NumericVector<Number> *> (1,vec), var); } // end variable loop } } //------------------------------------------- // Finally loop over all the SCALAR variables for (unsigned int data_var=0; data_var<nv; data_var++) { const unsigned int var = _written_var_indices[data_var]; if (this->variable(var).type().family == SCALAR) { #ifndef NDEBUG n_assigned_vals += #endif this->read_SCALAR_dofs (var, io, vec); } } if (vec) vec->close(); #ifndef NDEBUG this->comm().sum (n_assigned_vals); libmesh_assert_equal_to (n_assigned_vals, vector_length); #endif return vector_length; } void System::write_header (Xdr & io, const std::string & /* version is currently unused */, const bool write_additional_data) const { /** * This method implements the output of a * System object, embedded in the output of * an EquationSystems<T_sys>. This warrants some * documentation. The output of this part * consists of 5 sections: * * for this system * * 5.) The number of variables in the system (unsigned int) * * for each variable in the system * * 6.) The name of the variable (string) * * 6.1.) subdomain where the variable lives * * 7.) Combined in an FEType: * - The approximation order(s) of the variable * (Order Enum, cast to int/s) * - The finite element family/ies of the variable * (FEFamily Enum, cast to int/s) * * end variable loop * * 8.) The number of additional vectors (unsigned int), * * for each additional vector in the system object * * 9.) the name of the additional vector (string) * * end system */ libmesh_assert (io.writing()); // Only write the header information // if we are processor 0. if (this->get_mesh().processor_id() != 0) return; std::string comment; char buf[80]; // 5.) // Write the number of variables in the system { // set up the comment comment = "# No. of Variables in System \""; comment += this->name(); comment += "\""; unsigned int nv = this->n_vars(); io.data (nv, comment.c_str()); } for (auto var : IntRange<unsigned int>(0, this->n_vars())) { // 6.) // Write the name of the var-th variable { // set up the comment comment = "# Name, Variable No. "; std::sprintf(buf, "%u", var); comment += buf; comment += ", System \""; comment += this->name(); comment += "\""; std::string var_name = this->variable_name(var); io.data (var_name, comment.c_str()); } // 6.1.) Variable subdomains { // set up the comment comment = "# Subdomains, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; const std::set<subdomain_id_type> & domains = this->variable(var).active_subdomains(); std::vector<subdomain_id_type> domain_array; domain_array.assign(domains.begin(), domains.end()); io.data (domain_array, comment.c_str()); } // 7.) // Write the approximation order of the var-th variable // in this system { // set up the comment comment = "# Approximation Order, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; int order = static_cast<int>(this->variable_type(var).order); io.data (order, comment.c_str()); } #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS // do the same for radial_order { comment = "# Radial Approximation Order, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; int rad_order = static_cast<int>(this->variable_type(var).radial_order); io.data (rad_order, comment.c_str()); } #endif // Write the Finite Element type of the var-th variable // in this System { // set up the comment comment = "# FE Family, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; const FEType & type = this->variable_type(var); int fam = static_cast<int>(type.family); io.data (fam, comment.c_str()); #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS comment = "# Radial FE Family, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; int radial_fam = static_cast<int>(type.radial_family); io.data (radial_fam, comment.c_str()); comment = "# Infinite Mapping Type, Variable \""; std::sprintf(buf, "%s", this->variable_name(var).c_str()); comment += buf; comment += "\", System \""; comment += this->name(); comment += "\""; int i_map = static_cast<int>(type.inf_map); io.data (i_map, comment.c_str()); #endif } } // end of the variable loop // 8.) // Write the number of additional vectors in the System. // If write_additional_data==false, then write zero for // the number of additional vectors. { { // set up the comment comment = "# No. of Additional Vectors, System \""; comment += this->name(); comment += "\""; unsigned int nvecs = write_additional_data ? this->n_vectors () : 0; io.data (nvecs, comment.c_str()); } if (write_additional_data) { unsigned int cnt=0; for (const auto & pr : _vectors) { // 9.) // write the name of the cnt-th additional vector comment = "# Name of "; std::sprintf(buf, "%d", cnt++); comment += buf; comment += "th vector"; std::string vec_name = pr.first; io.data (vec_name, comment.c_str()); } } } } void System::write_parallel_data (Xdr & io, const bool write_additional_data) const { /** * This method implements the output of the vectors * contained in this System object, embedded in the * output of an EquationSystems<T_sys>. * * 9.) The global solution vector, re-ordered to be node-major * (More on this later.) * * for each additional vector in the object * * 10.) The global additional vector, re-ordered to be * node-major (More on this later.) * * Note that the actual IO is handled through the Xdr class * (to be renamed later?) which provides a uniform interface to * both the XDR (eXternal Data Representation) interface and standard * ASCII output. Thus this one section of code will read XDR or ASCII * files with no changes. */ // PerfLog pl("IO Performance",false); // pl.push("write_parallel_data"); // std::size_t total_written_size = 0; std::string comment; libmesh_assert (io.writing()); std::vector<Number> io_buffer; io_buffer.reserve(this->solution->local_size()); // build the ordered nodes and element maps. // when writing/reading parallel files we need to iterate // over our nodes/elements in order of increasing global id(). // however, this is not guaranteed to be ordering we obtain // by using the node_iterators/element_iterators directly. // so build a set, sorted by id(), that provides the ordering. // further, for memory economy build the set but then transfer // its contents to vectors, which will be sorted. std::vector<const DofObject *> ordered_nodes, ordered_elements; { std::set<const DofObject *, CompareDofObjectsByID> ordered_nodes_set (this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end()); ordered_nodes.insert(ordered_nodes.end(), ordered_nodes_set.begin(), ordered_nodes_set.end()); } { std::set<const DofObject *, CompareDofObjectsByID> ordered_elements_set (this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end()); ordered_elements.insert(ordered_elements.end(), ordered_elements_set.begin(), ordered_elements_set.end()); } const unsigned int sys_num = this->number(); const unsigned int nv = this->n_vars(); // Loop over each non-SCALAR variable and each node, and write out the value. for (unsigned int var=0; var<nv; var++) if (this->variable(var).type().family != SCALAR) { // First write the node DOF values for (const auto & node : ordered_nodes) for (auto comp : IntRange<unsigned int>(0, node->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (node->dof_number(sys_num, var, comp), DofObject::invalid_id); io_buffer.push_back((*this->solution)(node->dof_number(sys_num, var, comp))); } // Then write the element DOF values for (const auto & elem : ordered_elements) for (auto comp : IntRange<unsigned int>(0, elem->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys_num, var, comp), DofObject::invalid_id); io_buffer.push_back((*this->solution)(elem->dof_number(sys_num, var, comp))); } } // Finally, write the SCALAR data on the last processor for (auto var : IntRange<unsigned int>(0, this->n_vars())) if (this->variable(var).type().family == SCALAR) { if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); for (auto dof : SCALAR_dofs) io_buffer.push_back((*this->solution)(dof)); } } // 9.) // // Actually write the reordered solution vector // for the ith system to disk // set up the comment { comment = "# System \""; comment += this->name(); comment += "\" Solution Vector"; } io.data (io_buffer, comment.c_str()); // total_written_size += io_buffer.size(); // Only write additional vectors if wanted if (write_additional_data) { for (auto & pr : _vectors) { io_buffer.clear(); io_buffer.reserve(pr.second->local_size()); // Loop over each non-SCALAR variable and each node, and write out the value. for (unsigned int var=0; var<nv; var++) if (this->variable(var).type().family != SCALAR) { // First write the node DOF values for (const auto & node : ordered_nodes) for (auto comp : IntRange<unsigned int>(0, node->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (node->dof_number(sys_num, var, comp), DofObject::invalid_id); io_buffer.push_back((*pr.second)(node->dof_number(sys_num, var, comp))); } // Then write the element DOF values for (const auto & elem : ordered_elements) for (auto comp : IntRange<unsigned int>(0, elem->n_comp(sys_num,var))) { libmesh_assert_not_equal_to (elem->dof_number(sys_num, var, comp), DofObject::invalid_id); io_buffer.push_back((*pr.second)(elem->dof_number(sys_num, var, comp))); } } // Finally, write the SCALAR data on the last processor for (auto var : IntRange<unsigned int>(0, this->n_vars())) if (this->variable(var).type().family == SCALAR) { if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); for (auto dof : SCALAR_dofs) io_buffer.push_back((*pr.second)(dof)); } } // 10.) // // Actually write the reordered additional vector // for this system to disk // set up the comment { comment = "# System \""; comment += this->name(); comment += "\" Additional Vector \""; comment += pr.first; comment += "\""; } io.data (io_buffer, comment.c_str()); // total_written_size += io_buffer.size(); } } // const Real // dt = pl.get_elapsed_time(), // rate = total_written_size*sizeof(Number)/dt; // libMesh::err << "Write " << total_written_size << " \"Number\" values\n" // << " Elapsed time = " << dt << '\n' // << " Rate = " << rate/1.e6 << "(MB/sec)\n\n"; // pl.pop("write_parallel_data"); } void System::write_serialized_data (Xdr & io, const bool write_additional_data) const { /** * This method implements the output of the vectors * contained in this System object, embedded in the * output of an EquationSystems<T_sys>. * * 9.) The global solution vector, re-ordered to be node-major * (More on this later.) * * for each additional vector in the object * * 10.) The global additional vector, re-ordered to be * node-major (More on this later.) */ parallel_object_only(); std::string comment; // PerfLog pl("IO Performance",false); // pl.push("write_serialized_data"); // std::size_t total_written_size = 0; // total_written_size += this->write_serialized_vector(io, *this->solution); // set up the comment if (this->processor_id() == 0) { comment = "# System \""; comment += this->name(); comment += "\" Solution Vector"; io.comment (comment); } // Only write additional vectors if wanted if (write_additional_data) { for (auto & pair : this->_vectors) { // total_written_size += this->write_serialized_vector(io, *pair.second); // set up the comment if (this->processor_id() == 0) { comment = "# System \""; comment += this->name(); comment += "\" Additional Vector \""; comment += pair.first; comment += "\""; io.comment (comment); } } } // const Real // dt = pl.get_elapsed_time(), // rate = total_written_size*sizeof(Number)/dt; // libMesh::out << "Write " << total_written_size << " \"Number\" values\n" // << " Elapsed time = " << dt << '\n' // << " Rate = " << rate/1.e6 << "(MB/sec)\n\n"; // pl.pop("write_serialized_data"); // // test the new method // { // std::vector<std::string> names; // std::vector<NumericVector<Number> *> vectors_to_write; // names.push_back("Solution Vector"); // vectors_to_write.push_back(this->solution.get()); // // Only write additional vectors if wanted // if (write_additional_data) // { // std::map<std::string, NumericVector<Number> *>::const_iterator // pos = _vectors.begin(); // for (; pos != this->_vectors.end(); ++pos) // { // names.push_back("Additional Vector " + pos->first); // vectors_to_write.push_back(pos->second); // } // } // total_written_size = // this->write_serialized_vectors (io, names, vectors_to_write); // const Real // dt2 = pl.get_elapsed_time(), // rate2 = total_written_size*sizeof(Number)/(dt2-dt); // libMesh::out << "Write (new) " << total_written_size << " \"Number\" values\n" // << " Elapsed time = " << (dt2-dt) << '\n' // << " Rate = " << rate2/1.e6 << "(MB/sec)\n\n"; // } } template <typename iterator_type> std::size_t System::write_serialized_blocked_dof_objects (const std::vector<const NumericVector<Number> *> & vecs, const dof_id_type n_objs, const iterator_type begin, const iterator_type end, Xdr & io, const unsigned int var_to_write) const { parallel_object_only(); //------------------------------------------------------- // General order: (IO format 0.7.4 & greater) // // for (objects ...) // for (vecs ....) // for (vars ....) // for (comps ...) // // where objects are nodes or elements, sorted to be // partition independent, // vecs are one or more *identically distributed* solution // coefficient vectors, vars are one or more variables // to write, and comps are all the components for said // vars on the object. // We will write all variables unless requested otherwise. std::vector<unsigned int> vars_to_write(1, var_to_write); if (var_to_write == libMesh::invalid_uint) { vars_to_write.clear(); /**/ vars_to_write.reserve(this->n_vars()); for (auto var : IntRange<unsigned int>(0, this->n_vars())) vars_to_write.push_back(var); } const dof_id_type io_blksize = cast_int<dof_id_type> (std::min(max_io_blksize, static_cast<std::size_t>(n_objs))); const unsigned int sys_num = this->number(), num_vecs = cast_int<unsigned int>(vecs.size()), num_blks = cast_int<unsigned int>(std::ceil(static_cast<double>(n_objs)/ static_cast<double>(io_blksize))); // libMesh::out << "io_blksize = " << io_blksize // << ", num_objects = " << n_objs // << ", num_blks = " << num_blks // << std::endl; std::size_t written_length=0; // The numer of values written. This will be returned std::vector<std::vector<dof_id_type>> xfer_ids(num_blks); // The global IDs and # of components for the local objects in all blocks std::vector<std::vector<Number>> send_vals(num_blks); // The raw values for the local objects in all blocks std::vector<Parallel::Request> id_requests(num_blks), val_requests(num_blks); // send request handle for each block std::vector<Parallel::MessageTag> id_tags(num_blks), val_tags(num_blks); // tag number for each block // ------------------------------------------------------ // First pass - count the number of objects in each block // traverse all the objects and figure out which block they // will ultimately live in. std::vector<unsigned int> xfer_ids_size (num_blks,0), send_vals_size (num_blks,0); for (iterator_type it=begin; it!=end; ++it) { const dof_id_type id = (*it)->id(), block = id/io_blksize; libmesh_assert_less (block, num_blks); xfer_ids_size[block] += 2; // for each object, we store its id, as well as the total number of components for all variables unsigned int n_comp_tot=0; for (const auto & var : vars_to_write) n_comp_tot += (*it)->n_comp(sys_num, var); // for each variable, we will store the nonzero components send_vals_size[block] += n_comp_tot*num_vecs; } //----------------------------------------- // Collect the values for all local objects, // binning them into 'blocks' that will be // sent to processor 0 for (unsigned int blk=0; blk<num_blks; blk++) { // libMesh::out << "Writing object block " << blk << std::endl; // Each processor should build up its transfer buffers for its // local objects in [first_object,last_object). const dof_id_type first_object = blk*io_blksize, last_object = std::min(cast_int<dof_id_type>((blk+1)*io_blksize), n_objs); // convenience std::vector<dof_id_type> & ids (xfer_ids[blk]); std::vector<Number> & vals (send_vals[blk]); // we now know the number of values we will store for each block, // so we can do efficient preallocation ids.clear(); /**/ ids.reserve (xfer_ids_size[blk]); vals.clear(); /**/ vals.reserve (send_vals_size[blk]); if (send_vals_size[blk] != 0) // only send if we have nonzero components to write for (iterator_type it=begin; it!=end; ++it) if (((*it)->id() >= first_object) && // object in [first_object,last_object) ((*it)->id() < last_object)) { ids.push_back((*it)->id()); // count the total number of nonzeros transferred for this object { unsigned int n_comp_tot=0; for (const auto & var : vars_to_write) n_comp_tot += (*it)->n_comp(sys_num, var); ids.push_back (n_comp_tot*num_vecs); // even if 0 - processor 0 has no way of knowing otherwise... } // pack the values to send for (const auto & vec : vecs) for (const auto & var : vars_to_write) { const unsigned int n_comp = (*it)->n_comp(sys_num, var); for (unsigned int comp=0; comp<n_comp; comp++) { libmesh_assert_greater_equal ((*it)->dof_number(sys_num, var, comp), vec->first_local_index()); libmesh_assert_less ((*it)->dof_number(sys_num, var, comp), vec->last_local_index()); vals.push_back((*vec)((*it)->dof_number(sys_num, var, comp))); } } } #ifdef LIBMESH_HAVE_MPI id_tags[blk] = this->comm().get_unique_tag(100*num_blks + blk); val_tags[blk] = this->comm().get_unique_tag(200*num_blks + blk); // nonblocking send the data for this block this->comm().send (0, ids, id_requests[blk], id_tags[blk]); this->comm().send (0, vals, val_requests[blk], val_tags[blk]); #endif } if (this->processor_id() == 0) { std::vector<std::vector<dof_id_type>> recv_ids (this->n_processors()); std::vector<std::vector<Number>> recv_vals (this->n_processors()); std::vector<unsigned int> obj_val_offsets; // map to traverse entry-wise rather than processor-wise std::vector<Number> output_vals; // The output buffer for the current block // a ThreadedIO object to perform asynchronous file IO ThreadedIO<Number> threaded_io(io, output_vals); std::unique_ptr<Threads::Thread> async_io; for (unsigned int blk=0; blk<num_blks; blk++) { // Each processor should build up its transfer buffers for its // local objects in [first_object,last_object). const dof_id_type first_object = cast_int<dof_id_type>(blk*io_blksize), last_object = std::min(cast_int<dof_id_type>((blk+1)*io_blksize), n_objs), n_objects_blk = last_object - first_object; // offset array. this will define where each object's values // map into the actual output_vals buffer. this must get // 0-initialized because 0-component objects are not actually sent obj_val_offsets.resize (n_objects_blk); /**/ std::fill (obj_val_offsets.begin(), obj_val_offsets.end(), 0); std::size_t n_val_recvd_blk=0; // receive this block of data from all processors. for (processor_id_type comm_step=0, tnp=this->n_processors(); comm_step != tnp; ++comm_step) { #ifdef LIBMESH_HAVE_MPI // blocking receive indices for this block, imposing no particular order on processor Parallel::Status id_status (this->comm().probe (Parallel::any_source, id_tags[blk])); std::vector<dof_id_type> & ids (recv_ids[id_status.source()]); this->comm().receive (id_status.source(), ids, id_tags[blk]); #else std::vector<dof_id_type> & ids (recv_ids[0]); ids = xfer_ids[blk]; #endif // note its possible we didn't receive values for objects in // this block if they have no components allocated. for (std::size_t idx=0, sz=ids.size(); idx<sz; idx+=2) { const dof_id_type local_idx = ids[idx+0]-first_object, n_vals_tot_allvecs = ids[idx+1]; libmesh_assert_less (local_idx, n_objects_blk); libmesh_assert_less (local_idx, obj_val_offsets.size()); obj_val_offsets[local_idx] = n_vals_tot_allvecs; } #ifdef LIBMESH_HAVE_MPI // blocking receive values for this block, imposing no particular order on processor Parallel::Status val_status (this->comm().probe (Parallel::any_source, val_tags[blk])); std::vector<Number> & vals (recv_vals[val_status.source()]); this->comm().receive (val_status.source(), vals, val_tags[blk]); #else // straight copy without MPI std::vector<Number> & vals (recv_vals[0]); vals = send_vals[blk]; #endif n_val_recvd_blk += vals.size(); } // We need the offsets into the output_vals vector for each object. // fortunately, this is simply the partial sum of the total number // of components for each object std::partial_sum(obj_val_offsets.begin(), obj_val_offsets.end(), obj_val_offsets.begin()); // wait on any previous asynchronous IO - this *must* complete before // we start messing with the output_vals buffer! if (async_io.get()) async_io->join(); // this is the actual output buffer that will be written to disk. // at ths point we finally know wha size it will be. output_vals.resize(n_val_recvd_blk); // pack data from all processors into output values for (auto proc : IntRange<unsigned int>(0, this->n_processors())) { const std::vector<dof_id_type> & ids (recv_ids [proc]); const std::vector<Number> & vals(recv_vals[proc]); std::vector<Number>::const_iterator proc_vals(vals.begin()); for (std::size_t idx=0, sz=ids.size(); idx<sz; idx+=2) { const dof_id_type local_idx = ids[idx+0]-first_object, n_vals_tot_allvecs = ids[idx+1]; // put this object's data into the proper location // in the output buffer std::vector<Number>::iterator out_vals(output_vals.begin()); if (local_idx != 0) std::advance (out_vals, obj_val_offsets[local_idx-1]); for (unsigned int val=0; val<n_vals_tot_allvecs; val++, ++out_vals, ++proc_vals) { libmesh_assert (out_vals != output_vals.end()); libmesh_assert (proc_vals != vals.end()); *out_vals = *proc_vals; } } } // output_vals buffer is now filled for this block. // write it to disk async_io = libmesh_make_unique<Threads::Thread>(threaded_io); written_length += output_vals.size(); } // wait on any previous asynchronous IO - this *must* complete before // our stuff goes out of scope async_io->join(); } Parallel::wait(id_requests); Parallel::wait(val_requests); // we need some synchronization here. Because this method // can be called for a range of nodes, then a range of elements, // we need some mechanism to prevent processors from racing past // to the next range and overtaking ongoing communication. one // approach would be to figure out unique tags for each range, // but for now we just impose a barrier here. And might as // well have it do some useful work. this->comm().broadcast(written_length); return written_length; } unsigned int System::write_SCALAR_dofs (const NumericVector<Number> & vec, const unsigned int var, Xdr & io) const { unsigned int written_length=0; std::vector<Number> vals; // The raw values for the local objects in the current block // Collect the SCALARs for the current variable if (this->processor_id() == (this->n_processors()-1)) { const DofMap & dof_map = this->get_dof_map(); std::vector<dof_id_type> SCALAR_dofs; dof_map.SCALAR_dof_indices(SCALAR_dofs, var); const unsigned int n_scalar_dofs = cast_int<unsigned int> (SCALAR_dofs.size()); for (unsigned int i=0; i<n_scalar_dofs; i++) { vals.push_back( vec(SCALAR_dofs[i]) ); } } #ifdef LIBMESH_HAVE_MPI if (this->n_processors() > 1) { const Parallel::MessageTag val_tag(1); // Post the receive on processor 0 if (this->processor_id() == 0) { this->comm().receive(this->n_processors()-1, vals, val_tag); } // Send the data to processor 0 if (this->processor_id() == (this->n_processors()-1)) { this->comm().send(0, vals, val_tag); } } #endif // ------------------------------------------------------- // Write the output on processor 0. if (this->processor_id() == 0) { const unsigned int vals_size = cast_int<unsigned int>(vals.size()); io.data_stream (vals.data(), vals_size); written_length += vals_size; } return written_length; } dof_id_type System::write_serialized_vector (Xdr & io, const NumericVector<Number> & vec) const { parallel_object_only(); libmesh_assert (io.writing()); dof_id_type vec_length = vec.size(); if (this->processor_id() == 0) io.data (vec_length, "# vector length"); dof_id_type written_length = 0; //--------------------------------- // Collect the values for all nodes written_length += cast_int<dof_id_type> (this->write_serialized_blocked_dof_objects (std::vector<const NumericVector<Number> *>(1,&vec), this->get_mesh().n_nodes(), this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end(), io)); //------------------------------------ // Collect the values for all elements written_length += cast_int<dof_id_type> (this->write_serialized_blocked_dof_objects (std::vector<const NumericVector<Number> *>(1,&vec), this->get_mesh().n_elem(), this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end(), io)); //------------------------------------------- // Finally loop over all the SCALAR variables for (auto var : IntRange<unsigned int>(0, this->n_vars())) if (this->variable(var).type().family == SCALAR) { written_length += this->write_SCALAR_dofs (vec, var, io); } if (this->processor_id() == 0) libmesh_assert_equal_to (written_length, vec_length); return written_length; } template <typename InValType> std::size_t System::read_serialized_vectors (Xdr & io, const std::vector<NumericVector<Number> *> & vectors) const { parallel_object_only(); // Error checking // #ifndef NDEBUG // // In parallel we better be reading a parallel vector -- if not // // we will not set all of its components below!! // if (this->n_processors() > 1) // { // libmesh_assert (vec.type() == PARALLEL || // vec.type() == GHOSTED); // } // #endif libmesh_assert (io.reading()); if (this->processor_id() == 0) { // sizes unsigned int num_vecs=0; dof_id_type vector_length=0; // Get the number of vectors io.data(num_vecs); // Get the buffer size io.data(vector_length); libmesh_assert_equal_to (num_vecs, vectors.size()); if (num_vecs != 0) { libmesh_assert_not_equal_to (vectors[0], 0); libmesh_assert_equal_to (vectors[0]->size(), vector_length); } } // no need to actually communicate these. // this->comm().broadcast(num_vecs); // this->comm().broadcast(vector_length); // Cache these - they are not free! const dof_id_type n_nodes = this->get_mesh().n_nodes(), n_elem = this->get_mesh().n_elem(); std::size_t read_length = 0; //--------------------------------- // Collect the values for all nodes read_length += this->read_serialized_blocked_dof_objects (n_nodes, this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end(), InValType(), io, vectors); //------------------------------------ // Collect the values for all elements read_length += this->read_serialized_blocked_dof_objects (n_elem, this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end(), InValType(), io, vectors); //------------------------------------------- // Finally loop over all the SCALAR variables for (NumericVector<Number> * vec : vectors) for (auto var : IntRange<unsigned int>(0, this->n_vars())) if (this->variable(var).type().family == SCALAR) { libmesh_assert_not_equal_to (vec, 0); read_length += this->read_SCALAR_dofs (var, io, vec); } //--------------------------------------- // last step - must close all the vectors for (NumericVector<Number> * vec : vectors) { libmesh_assert_not_equal_to (vec, 0); vec->close(); } return read_length; } std::size_t System::write_serialized_vectors (Xdr & io, const std::vector<const NumericVector<Number> *> & vectors) const { parallel_object_only(); libmesh_assert (io.writing()); // Cache these - they are not free! const dof_id_type n_nodes = this->get_mesh().n_nodes(), n_elem = this->get_mesh().n_elem(); std::size_t written_length = 0; if (this->processor_id() == 0) { unsigned int n_vec = cast_int<unsigned int>(vectors.size()); dof_id_type vec_size = vectors.empty() ? 0 : vectors[0]->size(); // Set the number of vectors io.data(n_vec, "# number of vectors"); // Set the buffer size io.data(vec_size, "# vector length"); } //--------------------------------- // Collect the values for all nodes written_length += this->write_serialized_blocked_dof_objects (vectors, n_nodes, this->get_mesh().local_nodes_begin(), this->get_mesh().local_nodes_end(), io); //------------------------------------ // Collect the values for all elements written_length += this->write_serialized_blocked_dof_objects (vectors, n_elem, this->get_mesh().local_elements_begin(), this->get_mesh().local_elements_end(), io); //------------------------------------------- // Finally loop over all the SCALAR variables for (const NumericVector<Number> * vec : vectors) for (auto var : IntRange<unsigned int>(0, this->n_vars())) if (this->variable(var).type().family == SCALAR) { libmesh_assert_not_equal_to (vec, 0); written_length += this->write_SCALAR_dofs (*vec, var, io); } return written_length; } template void System::read_parallel_data<Number> (Xdr & io, const bool read_additional_data); template void System::read_serialized_data<Number> (Xdr & io, const bool read_additional_data); template numeric_index_type System::read_serialized_vector<Number> (Xdr & io, NumericVector<Number> * vec); template std::size_t System::read_serialized_vectors<Number> (Xdr & io, const std::vector<NumericVector<Number> *> & vectors) const; #ifdef LIBMESH_USE_COMPLEX_NUMBERS template void System::read_parallel_data<Real> (Xdr & io, const bool read_additional_data); template void System::read_serialized_data<Real> (Xdr & io, const bool read_additional_data); template numeric_index_type System::read_serialized_vector<Real> (Xdr & io, NumericVector<Number> * vec); template std::size_t System::read_serialized_vectors<Real> (Xdr & io, const std::vector<NumericVector<Number> *> & vectors) const; #endif } // namespace libMesh
capitalaslash/libmesh
src/systems/system_io.C
C++
lgpl-2.1
86,179
/* Emacs style mode select -*- C++ -*- *----------------------------------------------------------------------------- * * * PrBoom: a Doom port merged with LxDoom and LSDLDoom * based on BOOM, a modified and improved DOOM engine * Copyright (C) 1999 by * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman * Copyright (C) 1999-2000 by * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze * Copyright 2005, 2006 by * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko * * 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., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * DESCRIPTION: * Status bar code. * Does the face/direction indicator animatin. * Does palette indicators as well (red pain/berserk, bright pickup) * *-----------------------------------------------------------------------------*/ #ifndef __STSTUFF_H__ #define __STSTUFF_H__ #include "doomtype.h" #include "d_event.h" #include "r_defs.h" // Size of statusbar. // Now sensitive for scaling. // proff 08/18/98: Changed for high-res #define ST_HEIGHT 32 #define ST_WIDTH 320 #define ST_Y (200 - ST_HEIGHT) // e6y: wide-res extern int ST_SCALED_HEIGHT; extern int ST_SCALED_WIDTH; extern int ST_SCALED_Y; // // STATUS BAR // // Called by main loop. dboolean ST_Responder(event_t* ev); // Called by main loop. void ST_Ticker(void); // Called by main loop. void ST_Drawer(dboolean st_statusbaron, dboolean refresh); // Called when the console player is spawned on each level. void ST_Start(void); // Called by startup code. void ST_Init(void); // States for status bar code. typedef enum { AutomapState, FirstPersonState } st_stateenum_t; // States for the chat code. typedef enum { StartChatState, WaitDestState, GetChatState } st_chatstateenum_t; // killough 5/2/98: moved from m_misc.c: extern int health_red; // health amount less than which status is red extern int health_yellow; // health amount less than which status is yellow extern int health_green; // health amount above is blue, below is green extern int armor_red; // armor amount less than which status is red extern int armor_yellow; // armor amount less than which status is yellow extern int armor_green; // armor amount above is blue, below is green extern int ammo_red; // ammo percent less than which status is red extern int ammo_yellow; // ammo percent less is yellow more green extern int sts_always_red;// status numbers do not change colors extern int sts_pct_always_gray;// status percents do not change colors extern int sts_traditional_keys; // display keys the traditional way extern int st_palette; // cph 2006/04/06 - make palette visible // e6y: makes sense for wide resolutions extern patchnum_t grnrock; extern patchnum_t brdr_t, brdr_b, brdr_l, brdr_r; extern patchnum_t brdr_tl, brdr_tr, brdr_bl, brdr_br; #endif
twinaphex/sdcell
appport/prboom/src/st_stuff.h
C
lgpl-2.1
3,533
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module 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 qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #ifndef QGRAPHICSBSPTREEINDEX_H #define QGRAPHICSBSPTREEINDEX_H #include <QtCore/qglobal.h> #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW #include "qgraphicssceneindex_p.h" #include "qgraphicsitem_p.h" #include "qgraphicsscene_bsp_p.h" #include <QtCore/qrect.h> #include <QtCore/qlist.h> QT_BEGIN_NAMESPACE static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT = 2000; class QGraphicsScene; class QGraphicsSceneBspTreeIndexPrivate; class Q_AUTOTEST_EXPORT QGraphicsSceneBspTreeIndex : public QGraphicsSceneIndex { Q_OBJECT Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth) public: QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0); ~QGraphicsSceneBspTreeIndex(); QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const; QList<QGraphicsItem *> estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const; QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const; int bspTreeDepth(); void setBspTreeDepth(int depth); protected Q_SLOTS: void updateSceneRect(const QRectF &rect); protected: bool event(QEvent *event); void clear(); void addItem(QGraphicsItem *item); void removeItem(QGraphicsItem *item); void prepareBoundingRectChange(const QGraphicsItem *item); void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value); private : Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex) Q_DISABLE_COPY(QGraphicsSceneBspTreeIndex) Q_PRIVATE_SLOT(d_func(), void _q_updateSortCache()) Q_PRIVATE_SLOT(d_func(), void _q_updateIndex()) friend class QGraphicsScene; friend class QGraphicsScenePrivate; }; class QGraphicsSceneBspTreeIndexPrivate : public QGraphicsSceneIndexPrivate { Q_DECLARE_PUBLIC(QGraphicsSceneBspTreeIndex) public: QGraphicsSceneBspTreeIndexPrivate(QGraphicsScene *scene); QGraphicsSceneBspTree bsp; QRectF sceneRect; int bspTreeDepth; int indexTimerId; bool restartIndexTimer; bool regenerateIndex; int lastItemCount; QList<QGraphicsItem *> indexedItems; QList<QGraphicsItem *> unindexedItems; QList<QGraphicsItem *> untransformableItems; QList<int> freeItemIndexes; bool purgePending; QSet<QGraphicsItem *> removedItems; void purgeRemovedItems(); void _q_updateIndex(); void startIndexTimer(int interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT); void resetIndex(); void _q_updateSortCache(); bool sortCacheEnabled; bool updatingSortCache; void invalidateSortCache(); void addItem(QGraphicsItem *item, bool recursive = false); void removeItem(QGraphicsItem *item, bool recursive = false, bool moveToUnindexedItems = false); QList<QGraphicsItem *> estimateItems(const QRectF &, Qt::SortOrder, bool b = false); static void climbTree(QGraphicsItem *item, int *stackingOrder); static inline bool closestItemFirst_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2) { return item1->d_ptr->globalStackingOrder < item2->d_ptr->globalStackingOrder; } static inline bool closestItemLast_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2) { return item1->d_ptr->globalStackingOrder >= item2->d_ptr->globalStackingOrder; } static void sortItems(QList<QGraphicsItem *> *itemList, Qt::SortOrder order, bool cached, bool onlyTopLevelItems = false); }; static inline bool QRectF_intersects(const QRectF &s, const QRectF &r) { qreal xp = s.left(); qreal yp = s.top(); qreal w = s.width(); qreal h = s.height(); qreal l1 = xp; qreal r1 = xp; if (w < 0) l1 += w; else r1 += w; qreal l2 = r.left(); qreal r2 = r.left(); if (w < 0) l2 += r.width(); else r2 += r.width(); if (l1 >= r2 || l2 >= r1) return false; qreal t1 = yp; qreal b1 = yp; if (h < 0) t1 += h; else b1 += h; qreal t2 = r.top(); qreal b2 = r.top(); if (r.height() < 0) t2 += r.height(); else b2 += r.height(); return !(t1 >= b2 || t2 >= b1); } QT_END_NAMESPACE #endif // QT_NO_GRAPHICSVIEW #endif // QGRAPHICSBSPTREEINDEX_H
radekp/qt
src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
C
lgpl-2.1
6,085
# frozen_string_literal: true require "test_helper" describe "The pretty-printed GLib module" do let(:printer) { GirFFI::PrettyPrinter.new } it "looks as expected" do expected = File.read(File.join(File.dirname(__FILE__), "expected_glib.rb")) result = printer.pretty_print "GLib" File.open(File.join(File.dirname(__FILE__), "actual_glib.rb"), "w") do |resultfile| resultfile.puts result end _(result).must_equal expected end end
mvz/gir_ffi-pretty_printer
test/integration/glib_test.rb
Ruby
lgpl-2.1
465
/****************************************************************************** * This file is part of the Gluon Development Platform * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl> * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk> * * 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 */ #ifndef GLUON_ENGINE_GAME_H #define GLUON_ENGINE_GAME_H #include "gameproject.h" #include "gluon_engine_export.h" #include <core/singleton.h> #include <QtCore/QObject> #include <QtCore/QSharedData> #include <QtCore/QThread> namespace GluonEngine { class GameObject; class Scene; class GamePrivate; class GLUON_ENGINE_EXPORT Game : public GluonCore::Singleton<Game> { Q_OBJECT /** * The Scene which is currently being handled by the game loop */ Q_PROPERTY( Scene* currentScene READ currentScene WRITE setCurrentScene ) /** * The GameProject containing the game which is currently being played */ Q_PROPERTY( GluonEngine::GameProject* gameProject READ gameProject WRITE setGameProject ) public: int getCurrentTick(); Scene* currentScene() const; GluonEngine::GameProject* gameProject() const; Q_INVOKABLE bool isRunning() const; Q_INVOKABLE bool isPaused() const; /** * Retrieve an object from the current scene. * * @param name The name of the object */ Q_INVOKABLE GluonEngine::GameObject* getFromScene( const QString& name ); Q_INVOKABLE GluonEngine::GameObject* clone( GluonEngine::GameObject* obj ); //TODO Implement //Q_INVOKABLE GameObject *spawn(const QString& prefabName); /** * Generate a random number between 0 and 1. * * Implemented here as a workaround for a Qt bug. * * \return The random number generated. */ Q_INVOKABLE float random(); public slots: void setGameProject( GluonEngine::GameProject* newGameProject ); void setCurrentScene( Scene* newCurrentScene ); void setCurrentScene( const QString& sceneName ); /** * Resets the current scene to its initial conditions */ void resetCurrentScene(); void runGame() { runGameFixedUpdate(); } /** * Run the game at full framerate (with an optional maximum number of skipped frames), but with a fixed game update rate, defaulting to 25 updates per second * @param int updatesPerSecond The number of updates per second * @param int maxFrameSkip The maximum number of frames that you're allowed to skip before forcing a redraw */ void runGameFixedUpdate( int updatesPerSecond = 25, int maxFrameSkip = 5 ); /** * Run the game using a fixed time between each update * @param int framesPerSecond The number of frames per second that the game will attempt to keep up with */ void runGameFixedTimestep( int framesPerSecond = 25 ); void stopGame(); void setPause( bool pause ); /** * Initialize all objects in the current scene. */ void initializeAll(); /** * Start all objects in the current scene. */ void startAll(); /** * Draw all items in the current scene. */ void drawAll( int time = 1 ); /** * Update all items in the current scene. */ void updateAll( int time = 10 ); /** * Stop all objects in the current scene. */ void stopAll(); /** * Cleanup all objects in the current scene. */ void cleanupAll(); // This allows the reset scene call to emit the Game::currentSceneChanged signal // which ensures that Creator doesn't crash when resetting the scene friend void Scene::resetScene(); signals: void showDebug( const QString& debugText ); void currentSceneChanged( GluonEngine::Scene* ); void currentProjectChanged( GluonEngine::GameProject* ); void projectLoaded( GluonEngine::GameProject* ); void initialized(); void started(); void updated( int ); void painted( int ); void stopped(); void cleaned(); private: friend class GluonCore::Singleton<Game>; friend class GamePrivate; Game( QObject* parent = 0 ); ~Game(); Q_DISABLE_COPY( Game ) QSharedDataPointer<GamePrivate> d; }; } #endif // GLUON_ENGINE_GAME_H
pranavrc/example-gluon
engine/game.h
C
lgpl-2.1
5,790
#!/usr/bin/perl package iMSCP::DataImporter::DbObject::MailUser; use strict; use warnings; 1;
i-MSCP/i-mscp-data-importer
lib/iMSCP/DataImporter/DbObject/MailUser.pm
Perl
lgpl-2.1
97
/* * Copyright (C) 2007-2008 Reto Schuettel, Robin Stocker * * IFS Institute for Software, HSR Rapperswil, Switzerland * * * 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 * */ package ch.hsr.ifs.pystructure.typeinference.evaluators.types; import java.util.LinkedList; import java.util.List; import ch.hsr.ifs.pystructure.typeinference.contexts.ModuleContext; import ch.hsr.ifs.pystructure.typeinference.goals.base.GoalState; import ch.hsr.ifs.pystructure.typeinference.goals.base.IGoal; import ch.hsr.ifs.pystructure.typeinference.goals.types.DefinitionTypeGoal; import ch.hsr.ifs.pystructure.typeinference.model.definitions.Definition; import ch.hsr.ifs.pystructure.typeinference.model.definitions.ImportDefinition; import ch.hsr.ifs.pystructure.typeinference.model.definitions.Module; import ch.hsr.ifs.pystructure.typeinference.model.definitions.Package; import ch.hsr.ifs.pystructure.typeinference.model.definitions.PathElement; import ch.hsr.ifs.pystructure.typeinference.visitors.ImportResolver; /** * Evaluator for the type of an import, which could be a module, a class, a * function, or a global variable. */ public class ImportTypeEvaluator extends DefinitionTypeEvaluator { private final ImportDefinition importDefinition; public ImportTypeEvaluator(DefinitionTypeGoal goal, ImportDefinition importDefinition) { super(goal, importDefinition); this.importDefinition = importDefinition; } @Override public List<IGoal> init() { ImportResolver importResolver = getGoal().getContext().getWorkspace().getImportResolver(); PathElement pathElement = importResolver.resolve(importDefinition.getPath()); if (pathElement == null) { /* this was a module/package which we don't know. Usually * this is just some sort of external library and it isn't that * bad if we can't import it. Some day we have to generate some warnings here * to let the user know that perhaps his syspath isn't set correctly. */ return IGoal.NO_GOALS; } List<Definition> definitions = new LinkedList<Definition>(); if (importDefinition.getElement() == null) { definitions.add((Definition) pathElement); } else { if (pathElement instanceof Module) { Module module = (Module) pathElement; definitions = module.getDefinitions(importDefinition.getElement()); } else if (pathElement instanceof Package) { Package pkg = (Package) pathElement; definitions.add((Definition) pkg.getChild(importDefinition.getElement())); } else { throw new RuntimeException("ImportFrom doesn't import from a package or module"); } } List<IGoal> subgoals = new LinkedList<IGoal>(); for (Definition definition : definitions) { ModuleContext context = getGoal().getContext(); if (!(definition instanceof Package)) { context = new ModuleContext(context, definition.getModule()); } subgoals.add(new DefinitionTypeGoal(context, definition)); } return subgoals; } @Override public List<IGoal> subgoalDone(IGoal subgoal, GoalState subgoalState) { if (!(subgoal instanceof DefinitionTypeGoal)) { unexpectedSubgoal(subgoal); } DefinitionTypeGoal g = (DefinitionTypeGoal) subgoal; resultType.appendType(g.resultType); return IGoal.NO_GOALS; } }
retoo/pystructure
src/ch/hsr/ifs/pystructure/typeinference/evaluators/types/ImportTypeEvaluator.java
Java
lgpl-2.1
3,931
/* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2022, by David Gilbert and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * 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. * * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners.] * * ------------ * Quarter.java * ------------ * (C) Copyright 2001-2022, by David Gilbert. * * Original Author: David Gilbert; * Contributor(s): -; * */ package org.jfree.data.time; import java.io.Serializable; import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.TimeZone; import org.jfree.chart.date.MonthConstants; import org.jfree.chart.date.SerialDate; /** * Defines a quarter (in a given year). The range supported is Q1 1900 to * Q4 9999. This class is immutable, which is a requirement for all * {@link RegularTimePeriod} subclasses. */ public class Quarter extends RegularTimePeriod implements Serializable { /** For serialization. */ private static final long serialVersionUID = 3810061714380888671L; /** Constant for quarter 1. */ public static final int FIRST_QUARTER = 1; /** Constant for quarter 4. */ public static final int LAST_QUARTER = 4; /** The first month in each quarter. */ public static final int[] FIRST_MONTH_IN_QUARTER = { 0, MonthConstants.JANUARY, MonthConstants.APRIL, MonthConstants.JULY, MonthConstants.OCTOBER }; /** The last month in each quarter. */ public static final int[] LAST_MONTH_IN_QUARTER = { 0, MonthConstants.MARCH, MonthConstants.JUNE, MonthConstants.SEPTEMBER, MonthConstants.DECEMBER }; /** The year in which the quarter falls. */ private short year; /** The quarter (1-4). */ private byte quarter; /** The first millisecond. */ private long firstMillisecond; /** The last millisecond. */ private long lastMillisecond; /** * Constructs a new Quarter, based on the current system date/time. * The time zone and locale are determined by the calendar * returned by {@link RegularTimePeriod#getCalendarInstance()}. */ public Quarter() { this(new Date()); } /** * Constructs a new quarter. * The time zone and locale are determined by the calendar * returned by {@link RegularTimePeriod#getCalendarInstance()}. * * @param year the year (1900 to 9999). * @param quarter the quarter (1 to 4). */ public Quarter(int quarter, int year) { if ((quarter < FIRST_QUARTER) || (quarter > LAST_QUARTER)) { throw new IllegalArgumentException("Quarter outside valid range."); } this.year = (short) year; this.quarter = (byte) quarter; peg(getCalendarInstance()); } /** * Constructs a new quarter. * The time zone and locale are determined by the calendar * returned by {@link RegularTimePeriod#getCalendarInstance()}. * * @param quarter the quarter (1 to 4). * @param year the year (1900 to 9999). */ public Quarter(int quarter, Year year) { if ((quarter < FIRST_QUARTER) || (quarter > LAST_QUARTER)) { throw new IllegalArgumentException("Quarter outside valid range."); } this.year = (short) year.getYear(); this.quarter = (byte) quarter; peg(getCalendarInstance()); } /** * Constructs a new instance, based on a date/time. * The time zone and locale are determined by the calendar * returned by {@link RegularTimePeriod#getCalendarInstance()}. * * @param time the date/time ({@code null} not permitted). * * @see #Quarter(Date, TimeZone, Locale) */ public Quarter(Date time) { this(time, getCalendarInstance()); } /** * Creates a new {@code Quarter} instance, using the specified * zone and locale. * * @param time the current time. * @param zone the time zone. * @param locale the locale. * * @since 1.0.12 */ public Quarter(Date time, TimeZone zone, Locale locale) { Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); int month = calendar.get(Calendar.MONTH) + 1; this.quarter = (byte) SerialDate.monthCodeToQuarter(month); this.year = (short) calendar.get(Calendar.YEAR); peg(calendar); } /** * Constructs a new instance, based on a particular date/time. * The time zone and locale are determined by the {@code calendar} * parameter. * * @param time the date/time ({@code null} not permitted). * @param calendar the calendar to use for calculations ({@code null} not permitted). */ public Quarter(Date time, Calendar calendar) { calendar.setTime(time); int month = calendar.get(Calendar.MONTH) + 1; this.quarter = (byte) SerialDate.monthCodeToQuarter(month); this.year = (short) calendar.get(Calendar.YEAR); peg(calendar); } /** * Returns the quarter. * * @return The quarter. */ public int getQuarter() { return this.quarter; } /** * Returns the year. * * @return The year. */ public Year getYear() { return new Year(this.year); } /** * Returns the year. * * @return The year. * * @since 1.0.3 */ public int getYearValue() { return this.year; } /** * Returns the first millisecond of the quarter. This will be determined * relative to the time zone specified in the constructor, or in the * calendar instance passed in the most recent call to the * {@link #peg(Calendar)} method. * * @return The first millisecond of the quarter. * * @see #getLastMillisecond() */ @Override public long getFirstMillisecond() { return this.firstMillisecond; } /** * Returns the last millisecond of the quarter. This will be * determined relative to the time zone specified in the constructor, or * in the calendar instance passed in the most recent call to the * {@link #peg(Calendar)} method. * * @return The last millisecond of the quarter. * * @see #getFirstMillisecond() */ @Override public long getLastMillisecond() { return this.lastMillisecond; } /** * Recalculates the start date/time and end date/time for this time period * relative to the supplied calendar (which incorporates a time zone). * * @param calendar the calendar ({@code null} not permitted). * * @since 1.0.3 */ @Override public void peg(Calendar calendar) { this.firstMillisecond = getFirstMillisecond(calendar); this.lastMillisecond = getLastMillisecond(calendar); } /** * Returns the quarter preceding this one. * No matter what time zone and locale this instance was created with, * the returned instance will use the default calendar for time * calculations, obtained with {@link RegularTimePeriod#getCalendarInstance()}. * * @return The quarter preceding this one (or {@code null} if this is * Q1 1900). */ @Override public RegularTimePeriod previous() { Quarter result; if (this.quarter > FIRST_QUARTER) { result = new Quarter(this.quarter - 1, this.year); } else { if (this.year > 1900) { result = new Quarter(LAST_QUARTER, this.year - 1); } else { result = null; } } return result; } /** * Returns the quarter following this one. * No matter what time zone and locale this instance was created with, * the returned instance will use the default calendar for time * calculations, obtained with {@link RegularTimePeriod#getCalendarInstance()}. * * @return The quarter following this one (or null if this is Q4 9999). */ @Override public RegularTimePeriod next() { Quarter result; if (this.quarter < LAST_QUARTER) { result = new Quarter(this.quarter + 1, this.year); } else { if (this.year < 9999) { result = new Quarter(FIRST_QUARTER, this.year + 1); } else { result = null; } } return result; } /** * Returns a serial index number for the quarter. * * @return The serial index number. */ @Override public long getSerialIndex() { return this.year * 4L + this.quarter; } /** * Tests the equality of this Quarter object to an arbitrary object. * Returns {@code true} if the target is a Quarter instance * representing the same quarter as this object. In all other cases, * returns {@code false}. * * @param obj the object ({@code null} permitted). * * @return {@code true} if quarter and year of this and the object are * the same. */ @Override public boolean equals(Object obj) { if (obj != null) { if (obj instanceof Quarter) { Quarter target = (Quarter) obj; return (this.quarter == target.getQuarter() && (this.year == target.getYearValue())); } else { return false; } } else { return false; } } /** * Returns a hash code for this object instance. The approach described by * Joshua Bloch in "Effective Java" has been used here: * <p> * {@code http://developer.java.sun.com/developer/Books/effectivejava * /Chapter3.pdf} * * @return A hash code. */ @Override public int hashCode() { int result = 17; result = 37 * result + this.quarter; result = 37 * result + this.year; return result; } /** * Returns an integer indicating the order of this Quarter object relative * to the specified object: * * negative == before, zero == same, positive == after. * * @param o1 the object to compare * * @return negative == before, zero == same, positive == after. */ @Override public int compareTo(Object o1) { int result; // CASE 1 : Comparing to another Quarter object // -------------------------------------------- if (o1 instanceof Quarter) { Quarter q = (Quarter) o1; result = this.year - q.getYearValue(); if (result == 0) { result = this.quarter - q.getQuarter(); } } // CASE 2 : Comparing to another TimePeriod object // ----------------------------------------------- else if (o1 instanceof RegularTimePeriod) { // more difficult case - evaluate later... result = 0; } // CASE 3 : Comparing to a non-TimePeriod object // --------------------------------------------- else { // consider time periods to be ordered after general objects result = 1; } return result; } /** * Returns a string representing the quarter (e.g. "Q1/2002"). * * @return A string representing the quarter. */ @Override public String toString() { return "Q" + this.quarter + "/" + this.year; } /** * Returns the first millisecond in the Quarter, evaluated using the * supplied calendar (which determines the time zone). * * @param calendar the calendar ({@code null} not permitted). * * @return The first millisecond in the Quarter. * * @throws NullPointerException if {@code calendar} is * {@code null}. */ @Override public long getFirstMillisecond(Calendar calendar) { int month = Quarter.FIRST_MONTH_IN_QUARTER[this.quarter]; calendar.set(this.year, month - 1, 1, 0, 0, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); } /** * Returns the last millisecond of the Quarter, evaluated using the * supplied calendar (which determines the time zone). * * @param calendar the calendar ({@code null} not permitted). * * @return The last millisecond of the Quarter. * * @throws NullPointerException if {@code calendar} is * {@code null}. */ @Override public long getLastMillisecond(Calendar calendar) { int month = Quarter.LAST_MONTH_IN_QUARTER[this.quarter]; int eom = SerialDate.lastDayOfMonth(month, this.year); calendar.set(this.year, month - 1, eom, 23, 59, 59); calendar.set(Calendar.MILLISECOND, 999); return calendar.getTimeInMillis(); } /** * Parses the string argument as a quarter. * <P> * This method should accept the following formats: "YYYY-QN" and "QN-YYYY", * where the "-" can be a space, a forward-slash (/), comma or a dash (-). * @param s A string representing the quarter. * * @return The quarter. */ public static Quarter parseQuarter(String s) { // find the Q and the integer following it (remove both from the // string)... int i = s.indexOf("Q"); if (i == -1) { throw new TimePeriodFormatException("Missing Q."); } if (i == s.length() - 1) { throw new TimePeriodFormatException("Q found at end of string."); } String qstr = s.substring(i + 1, i + 2); int quarter = Integer.parseInt(qstr); String remaining = s.substring(0, i) + s.substring(i + 2, s.length()); // replace any / , or - with a space remaining = remaining.replace('/', ' '); remaining = remaining.replace(',', ' '); remaining = remaining.replace('-', ' '); // parse the string... Year year = Year.parseYear(remaining.trim()); Quarter result = new Quarter(quarter, year); return result; } }
jfree/jfreechart
src/main/java/org/jfree/data/time/Quarter.java
Java
lgpl-2.1
15,687
#!/bin/sh # Run this to generate all the initial makefiles, etc. test -n "$srcdir" || srcdir=`dirname "$0"` test -n "$srcdir" || srcdir=. olddir=`pwd` cd "$srcdir" AUTORECONF=`which autoreconf` if test -z $AUTORECONF; then echo "*** No autoreconf found, please install it ***" exit 1 fi # INSTALL are required by automake, but may be deleted by clean # up rules. to get automake to work, simply touch these here, they will be # regenerated from their corresponding *.in files by ./configure anyway. touch INSTALL if ! test -f libglnx/README.md -a -f bubblewrap/README.md; then git submodule update --init fi # Workaround automake bug with subdir-objects and computed paths sed -e 's,$(libglnx_srcpath),'${srcdir}/libglnx,g < libglnx/Makefile-libglnx.am >libglnx/Makefile-libglnx.am.inc sed -e 's,$(bwrap_srcpath),'${srcdir}/bubblewrap,g < bubblewrap/Makefile-bwrap.am >bubblewrap/Makefile-bwrap.am.inc GTKDOCIZE=$(which gtkdocize 2>/dev/null) if test -z $GTKDOCIZE; then echo "*** You don't have gtk-doc installed, and thus won't be able to generate the documentation. ***" rm -f gtk-doc.make cat > gtk-doc.make <<EOF EXTRA_DIST = CLEANFILES = EOF else # gtkdocize needs the macro directory to exist before # we call autoreconf mkdir m4 gtkdocize || exit $? fi autoreconf --force --install --verbose || exit $? intltoolize || exit 1 cd "$olddir" test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
alexlarsson/xdg-app
autogen.sh
Shell
lgpl-2.1
1,454
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>wguide1</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <link rel="stylesheet" type="text/css" href="syntax-highlighting.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="wgpluck2.html" title="wgpluck2" /> <link rel="next" href="wguide2.html" title="wguide2" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">wguide1</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="wgpluck2.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="wguide2.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="wguide1"></a> <div class="titlepage"></div> <a id="IndexWguide1" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">wguide1</span> </h2> <p>wguide1 — A simple waveguide model consisting of one delay-line and one first-order lowpass filter. </p> </div> <div class="refsect1"> <a id="idm45947988293872"></a> <h2>Description</h2> <p> A simple waveguide model consisting of one delay-line and one first-order lowpass filter. </p> </div> <div class="refsect1"> <a id="idm45947988292432"></a> <h2>Syntax</h2> <pre class="synopsis">ares <span class="command"><strong>wguide1</strong></span> asig, xfreq, kcutoff, kfeedback</pre> </div> <div class="refsect1"> <a id="idm45947988290176"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>asig</em></span> -- the input of excitation noise. </p> <p> <span class="emphasis"><em>xfreq</em></span> -- the frequency (i.e. the inverse of delay time) Changed to x-rate in Csound version 3.59. </p> <p> <span class="emphasis"><em>kcutoff</em></span> -- the filter cutoff frequency in Hz. </p> <p> <span class="emphasis"><em>kfeedback</em></span> -- the feedback factor. </p> <p> <span class="emphasis"><em>wguide1</em></span> is the most elemental waveguide model, consisting of one delay-line and one first-order lowpass filter. </p> <p> Implementing waveguide algorithms as opcodes, instead of orc instruments, allows the user to set <span class="emphasis"><em>kr</em></span> different than <span class="emphasis"><em>sr</em></span>, allowing better performance particulary when using real-time. </p> <p> </p> <div class="mediaobject"> <img src="images/wguide1.png" alt="wguide1." /> <div class="caption"> <p>wguide1.</p> </div> </div> <p> </p> </div> <div class="refsect1"> <a id="idm45947988215952"></a> <h2>Examples</h2> <p> Here is an example of the wguide1 opcode. It uses the file <a class="ulink" href="examples/wguide1.csd.html" target="_top"> (click here to play) <em class="citetitle">wguide1.csd</em></a>. </p> <div class="example"> <a id="idm45947988214176"></a> <p class="title"> <strong>Example 1129. Example of the wguide1 opcode.</strong> </p> <div class="example-contents"> <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p> <div class="refsect1"> <a id="idm45947808555312"></a> <pre class="programlisting"> <span class="nt">&lt;CsoundSynthesizer&gt;</span> <span class="nt">&lt;CsOptions&gt;</span> <span class="c1">; Select audio/midi flags here according to platform</span> <span class="c1">; Audio out Audio in No messages</span> -odac -iadc -d <span class="c1">;;;RT audio I/O</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o wguide1.wav -W ;;; for file output any platform</span> <span class="nt">&lt;/CsOptions&gt;</span> <span class="nt">&lt;CsInstruments&gt;</span> <span class="c1">; Initialize the global variables.</span> <span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span> <span class="vg">kr</span> <span class="o">=</span> <span class="mi">4410</span> <span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">10</span> <span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">; Instrument #1 - a simple noise waveform.</span> <span class="kd">instr</span> <span class="nf">1</span> <span class="c1">; Generate some noise.</span> a<span class="n">sig</span> <span class="nb">noise</span> <span class="mi">20000</span><span class="p">,</span> <span class="mf">0.5</span> <span class="nb">out</span> a<span class="n">sig</span> <span class="kd">endin</span> <span class="c1">; Instrument #2 - a waveguide example.</span> <span class="kd">instr</span> <span class="nf">2</span> <span class="c1">; Generate some noise.</span> a<span class="n">sig</span> <span class="nb">noise</span> <span class="mi">20000</span><span class="p">,</span> <span class="mf">0.5</span> <span class="c1">; Run it through a wave-guide model.</span> k<span class="n">freq</span> <span class="nb">init</span> <span class="mi">200</span> k<span class="n">cutoff</span> <span class="nb">init</span> <span class="mi">3000</span> k<span class="n">feedback</span> <span class="nb">init</span> <span class="mf">0.8</span> a<span class="n">wg1</span> <span class="nb">wguide1</span> a<span class="n">sig</span><span class="p">,</span> k<span class="n">freq</span><span class="p">,</span> k<span class="n">cutoff</span><span class="p">,</span> k<span class="n">feedback</span> <span class="nb">out</span> a<span class="n">wg1</span> <span class="kd">endin</span> <span class="nt">&lt;/CsInstruments&gt;</span> <span class="nt">&lt;CsScore&gt;</span> <span class="c1">; Play Instrument #1 for 2 seconds.</span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="c1">; Play Instrument #2 for 2 seconds.</span> <span class="nb">i</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">2</span> <span class="nb">e</span> <span class="nt">&lt;/CsScore&gt;</span> <span class="nt">&lt;/CsoundSynthesizer&gt;</span> </pre> </div> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1"> <a id="idm45947988209856"></a> <h2>See Also</h2> <p> <a class="link" href="wguide2.html" title="wguide2"><em class="citetitle">wguide2</em></a> </p> </div> <div class="refsect1"> <a id="idm45947988207744"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Gabriel Maldonado</td> </tr> <tr> <td>Italy</td> </tr> <tr> <td>October 1998</td> </tr> </table> <p> </p> <p>Example written by Kevin Conder.</p> <p>New in Csound version 3.49</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="wgpluck2.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="wguide2.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">wgpluck2 </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> wguide2</td> </tr> </table> </div> </body> </html>
gogins/gogins.github.io
csound/html/wguide1.html
HTML
lgpl-2.1
8,977
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.dialect; /** * Defines how we need to reference columns in the group-by, having, and order-by * clauses. * * @author Steve Ebersole */ public enum ResultColumnReferenceStrategy { /** * This strategy says to reference the result columns by the qualified column name * found in the result source. This strategy is not strictly allowed by ANSI SQL * but is Hibernate's legacy behavior and is also the fastest of the strategies; thus * it should be used if supported by the underlying database. */ SOURCE, /** * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable * approaches. One is to reference the result column by the alias it is given in the * result source (if it is given an alias). This strategy says to use this approach. * <p/> * The other QNSI SQL compliant approach is {@link #ORDINAL}. */ ALIAS, /** * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable * approaches. One is to reference the result column by the ordinal position at which * it appears in the result source. This strategy says to use this approach. * <p/> * The other QNSI SQL compliant approach is {@link #ALIAS}. */ ORDINAL; /** * Resolves the strategy by name, in a case insensitive manner. If the name cannot be resolved, {@link #SOURCE} * is returned as the default. * * @param name The strategy name to resolve * * @return The resolved strategy */ public static ResultColumnReferenceStrategy resolveByName(String name) { if ( ALIAS.name().equalsIgnoreCase( name ) ) { return ALIAS; } else if ( ORDINAL.name().equalsIgnoreCase( name ) ) { return ORDINAL; } else { return SOURCE; } } }
kevin-chen-hw/LDAE
com.huawei.soa.ldae/src/main/java/org/hibernate/dialect/ResultColumnReferenceStrategy.java
Java
lgpl-2.1
2,783
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>CoreGTK: CGTKCheckMenuItem Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">CoreGTK &#160;<span id="projectnumber">3.22.0</span> </div> <div id="projectbrief">CoreGTK is an Objective-C language binding for the GTK+ widget toolkit</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('interface_c_g_t_k_check_menu_item.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Instance Methods</a> &#124; <a href="interface_c_g_t_k_check_menu_item-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">CGTKCheckMenuItem Class Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for CGTKCheckMenuItem:</div> <div class="dyncontent"> <div class="center"><img src="interface_c_g_t_k_check_menu_item__inherit__graph.png" border="0" usemap="#_c_g_t_k_check_menu_item_inherit__map" alt="Inheritance graph"/></div> <map name="_c_g_t_k_check_menu_item_inherit__map" id="_c_g_t_k_check_menu_item_inherit__map"> <area shape="rect" id="node8" href="interface_c_g_t_k_radio_menu_item.html" title="CGTKRadioMenuItem" alt="" coords="7,528,158,555"/> <area shape="rect" id="node2" href="interface_c_g_t_k_menu_item.html" title="CGTKMenuItem" alt="" coords="24,379,141,405"/> <area shape="rect" id="node3" href="interface_c_g_t_k_bin.html" title="CGTKBin" alt="" coords="43,304,122,331"/> <area shape="rect" id="node4" href="interface_c_g_t_k_container.html" title="CGTKContainer" alt="" coords="25,229,140,256"/> <area shape="rect" id="node5" href="interface_c_g_t_k_widget.html" title="CGTKWidget" alt="" coords="33,155,133,181"/> <area shape="rect" id="node6" href="interface_c_g_t_k_base.html" title="CGTKBase" alt="" coords="38,80,127,107"/> </map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for CGTKCheckMenuItem:</div> <div class="dyncontent"> <div class="center"><img src="interface_c_g_t_k_check_menu_item__coll__graph.png" border="0" usemap="#_c_g_t_k_check_menu_item_coll__map" alt="Collaboration graph"/></div> <map name="_c_g_t_k_check_menu_item_coll__map" id="_c_g_t_k_check_menu_item_coll__map"> <area shape="rect" id="node2" href="interface_c_g_t_k_menu_item.html" title="CGTKMenuItem" alt="" coords="24,379,141,405"/> <area shape="rect" id="node3" href="interface_c_g_t_k_bin.html" title="CGTKBin" alt="" coords="43,304,122,331"/> <area shape="rect" id="node4" href="interface_c_g_t_k_container.html" title="CGTKContainer" alt="" coords="25,229,140,256"/> <area shape="rect" id="node5" href="interface_c_g_t_k_widget.html" title="CGTKWidget" alt="" coords="33,155,133,181"/> <area shape="rect" id="node6" href="interface_c_g_t_k_base.html" title="CGTKBase" alt="" coords="38,80,127,107"/> </map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Instance Methods</h2></td></tr> <tr class="memitem:a9e506760de8fb4192282a1ccb98e79b7"><td class="memItemLeft" align="right" valign="top">(id)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#a9e506760de8fb4192282a1ccb98e79b7">init</a></td></tr> <tr class="separator:a9e506760de8fb4192282a1ccb98e79b7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6161275f3474d4ccd4acd500da3807e7"><td class="memItemLeft" align="right" valign="top"><a id="a6161275f3474d4ccd4acd500da3807e7"></a> (id)&#160;</td><td class="memItemRight" valign="bottom">- <b>initWithLabel:</b></td></tr> <tr class="separator:a6161275f3474d4ccd4acd500da3807e7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a98d297da1dd3c0ecd0aea23f68e2ee26"><td class="memItemLeft" align="right" valign="top"><a id="a98d297da1dd3c0ecd0aea23f68e2ee26"></a> (id)&#160;</td><td class="memItemRight" valign="bottom">- <b>initWithMnemonic:</b></td></tr> <tr class="separator:a98d297da1dd3c0ecd0aea23f68e2ee26"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1d73ffcc8da744cda0c06a40b80388a2"><td class="memItemLeft" align="right" valign="top">(GtkCheckMenuItem *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#a1d73ffcc8da744cda0c06a40b80388a2">CHECKMENUITEM</a></td></tr> <tr class="separator:a1d73ffcc8da744cda0c06a40b80388a2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af9f8548342fc5b2afdebb7f49655137d"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#af9f8548342fc5b2afdebb7f49655137d">getActive</a></td></tr> <tr class="separator:af9f8548342fc5b2afdebb7f49655137d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa03299bba722d527f296df672564ea1b"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#aa03299bba722d527f296df672564ea1b">getDrawAsRadio</a></td></tr> <tr class="separator:aa03299bba722d527f296df672564ea1b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abd7047821ba61a0dbbab76588b29d301"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#abd7047821ba61a0dbbab76588b29d301">getInconsistent</a></td></tr> <tr class="separator:abd7047821ba61a0dbbab76588b29d301"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4cc9e1d596fae3c8039a996ac2d81e2f"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#a4cc9e1d596fae3c8039a996ac2d81e2f">setActive:</a></td></tr> <tr class="separator:a4cc9e1d596fae3c8039a996ac2d81e2f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a50d685dc2e5f6000e5b2541603291632"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#a50d685dc2e5f6000e5b2541603291632">setDrawAsRadio:</a></td></tr> <tr class="separator:a50d685dc2e5f6000e5b2541603291632"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a05bac03c2a25788e45bd79e3e7f732e8"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#a05bac03c2a25788e45bd79e3e7f732e8">setInconsistent:</a></td></tr> <tr class="separator:a05bac03c2a25788e45bd79e3e7f732e8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acdaae9c7934c383139263c6ad174bfd1"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_check_menu_item.html#acdaae9c7934c383139263c6ad174bfd1">toggled</a></td></tr> <tr class="separator:acdaae9c7934c383139263c6ad174bfd1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_interface_c_g_t_k_menu_item"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interface_c_g_t_k_menu_item')"><img src="closed.png" alt="-"/>&#160;Instance Methods inherited from <a class="el" href="interface_c_g_t_k_menu_item.html">CGTKMenuItem</a></td></tr> <tr class="memitem:a2f3ade77646f6cb32ff71e6d1a9640b4 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(GtkMenuItem *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a2f3ade77646f6cb32ff71e6d1a9640b4">MENUITEM</a></td></tr> <tr class="separator:a2f3ade77646f6cb32ff71e6d1a9640b4 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad2abb804e33590b25c87801b9efcea69 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#ad2abb804e33590b25c87801b9efcea69">activate</a></td></tr> <tr class="separator:ad2abb804e33590b25c87801b9efcea69 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac5981f31dce3ea40bd5c879b46dadf0e inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#ac5981f31dce3ea40bd5c879b46dadf0e">deselect</a></td></tr> <tr class="separator:ac5981f31dce3ea40bd5c879b46dadf0e inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2720491235747381a9e427586f85a201 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a2720491235747381a9e427586f85a201">getAccelPath</a></td></tr> <tr class="separator:a2720491235747381a9e427586f85a201 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab5fdeea9d0781b0f5b0817eb83282ddf inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#ab5fdeea9d0781b0f5b0817eb83282ddf">getLabel</a></td></tr> <tr class="separator:ab5fdeea9d0781b0f5b0817eb83282ddf inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af67c3f808eebdcb457d9db3574e0980a inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#af67c3f808eebdcb457d9db3574e0980a">getReserveIndicator</a></td></tr> <tr class="separator:af67c3f808eebdcb457d9db3574e0980a inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad8c44d5b0f73a5f9865b4a7b52297c88 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#ad8c44d5b0f73a5f9865b4a7b52297c88">getRightJustified</a></td></tr> <tr class="separator:ad8c44d5b0f73a5f9865b4a7b52297c88 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9b9c4bb5f6dc1d1574571522baf215c7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a9b9c4bb5f6dc1d1574571522baf215c7">getSubmenu</a></td></tr> <tr class="separator:a9b9c4bb5f6dc1d1574571522baf215c7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a15925a10f221e243fef4ded424d3706d inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a15925a10f221e243fef4ded424d3706d">getUseUnderline</a></td></tr> <tr class="separator:a15925a10f221e243fef4ded424d3706d inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a803861b411cce2db29dba913972d80c7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a803861b411cce2db29dba913972d80c7">select</a></td></tr> <tr class="separator:a803861b411cce2db29dba913972d80c7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abccf79b9c635606eb367fd1cd175e067 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#abccf79b9c635606eb367fd1cd175e067">setAccelPath:</a></td></tr> <tr class="separator:abccf79b9c635606eb367fd1cd175e067 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4cde720ca68435e9966e5611ccf92fb5 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a4cde720ca68435e9966e5611ccf92fb5">setLabel:</a></td></tr> <tr class="separator:a4cde720ca68435e9966e5611ccf92fb5 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a78f55a489d5b76a6d1a163ef3c25e499 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a78f55a489d5b76a6d1a163ef3c25e499">setReserveIndicator:</a></td></tr> <tr class="separator:a78f55a489d5b76a6d1a163ef3c25e499 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3d439f407f114f14df326528b0d76097 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a3d439f407f114f14df326528b0d76097">setRightJustified:</a></td></tr> <tr class="separator:a3d439f407f114f14df326528b0d76097 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5799fe2a4c947ae96ba4633a8f84bd93 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a5799fe2a4c947ae96ba4633a8f84bd93">setSubmenu:</a></td></tr> <tr class="separator:a5799fe2a4c947ae96ba4633a8f84bd93 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6cf0e240ff74327c3400188bc8cf3410 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a6cf0e240ff74327c3400188bc8cf3410">setUseUnderline:</a></td></tr> <tr class="separator:a6cf0e240ff74327c3400188bc8cf3410 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a80d6993c867a6603f583e9c00ad727a7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#a80d6993c867a6603f583e9c00ad727a7">toggleSizeAllocate:</a></td></tr> <tr class="separator:a80d6993c867a6603f583e9c00ad727a7 inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aecb79949ccf07fc73d7d62805caef45e inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_menu_item.html#aecb79949ccf07fc73d7d62805caef45e">toggleSizeRequest:</a></td></tr> <tr class="separator:aecb79949ccf07fc73d7d62805caef45e inherit pub_methods_interface_c_g_t_k_menu_item"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_interface_c_g_t_k_bin"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interface_c_g_t_k_bin')"><img src="closed.png" alt="-"/>&#160;Instance Methods inherited from <a class="el" href="interface_c_g_t_k_bin.html">CGTKBin</a></td></tr> <tr class="memitem:a2bdfba158a0a05ac31d981f59fadd3dc inherit pub_methods_interface_c_g_t_k_bin"><td class="memItemLeft" align="right" valign="top">(GtkBin *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_bin.html#a2bdfba158a0a05ac31d981f59fadd3dc">BIN</a></td></tr> <tr class="separator:a2bdfba158a0a05ac31d981f59fadd3dc inherit pub_methods_interface_c_g_t_k_bin"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a958eee797524e34b2b53dfde8c47afc6 inherit pub_methods_interface_c_g_t_k_bin"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_bin.html#a958eee797524e34b2b53dfde8c47afc6">getChild</a></td></tr> <tr class="separator:a958eee797524e34b2b53dfde8c47afc6 inherit pub_methods_interface_c_g_t_k_bin"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_interface_c_g_t_k_container"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interface_c_g_t_k_container')"><img src="closed.png" alt="-"/>&#160;Instance Methods inherited from <a class="el" href="interface_c_g_t_k_container.html">CGTKContainer</a></td></tr> <tr class="memitem:a4f3e4e94d94ef2378f661cd1365d9bb5 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GtkContainer *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a4f3e4e94d94ef2378f661cd1365d9bb5">CONTAINER</a></td></tr> <tr class="separator:a4f3e4e94d94ef2378f661cd1365d9bb5 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a29dcd7dc80c80a401a4e5e6fb9b8cd53 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top"><a id="a29dcd7dc80c80a401a4e5e6fb9b8cd53"></a> (void)&#160;</td><td class="memItemRight" valign="bottom">- <b>addWidget:withProperties:</b></td></tr> <tr class="separator:a29dcd7dc80c80a401a4e5e6fb9b8cd53 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae5772097dbf633d6f732ffd596a49b80 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#ae5772097dbf633d6f732ffd596a49b80">add:</a></td></tr> <tr class="separator:ae5772097dbf633d6f732ffd596a49b80 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7a5896cf03751c4bb21d32716d30e721 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a7a5896cf03751c4bb21d32716d30e721">checkResize</a></td></tr> <tr class="separator:a7a5896cf03751c4bb21d32716d30e721 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa1d50711ed5a4bb450fd5f787c159cda inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#aa1d50711ed5a4bb450fd5f787c159cda">childGetPropertyWithChild:andPropertyName:andValue:</a></td></tr> <tr class="separator:aa1d50711ed5a4bb450fd5f787c159cda inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a600fae87d9fde4f8c12874ee4d732b88 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a600fae87d9fde4f8c12874ee4d732b88">childGetValistWithChild:andFirstPropertyName:andVarArgs:</a></td></tr> <tr class="separator:a600fae87d9fde4f8c12874ee4d732b88 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a259aab1cd0628e5d93525652fd9937a6 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a259aab1cd0628e5d93525652fd9937a6">childNotifyWithChild:andChildProperty:</a></td></tr> <tr class="separator:a259aab1cd0628e5d93525652fd9937a6 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acc046a53ae9b9ef345e2f3641333d5e0 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#acc046a53ae9b9ef345e2f3641333d5e0">childNotifyByPspecWithChild:andPspec:</a></td></tr> <tr class="separator:acc046a53ae9b9ef345e2f3641333d5e0 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8506bb339e164d2591b2a1898931638c inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a8506bb339e164d2591b2a1898931638c">childSetPropertyWithChild:andPropertyName:andValue:</a></td></tr> <tr class="separator:a8506bb339e164d2591b2a1898931638c inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af078de1afd1d0e37520c2fe713480149 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#af078de1afd1d0e37520c2fe713480149">childSetValistWithChild:andFirstPropertyName:andVarArgs:</a></td></tr> <tr class="separator:af078de1afd1d0e37520c2fe713480149 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1f88579a752aadb34893fa10ca2e5964 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GType)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a1f88579a752aadb34893fa10ca2e5964">childType</a></td></tr> <tr class="separator:a1f88579a752aadb34893fa10ca2e5964 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac161ea26099366ab1d490f901e3a4d4e inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#ac161ea26099366ab1d490f901e3a4d4e">forallWithCallback:andCallbackData:</a></td></tr> <tr class="separator:ac161ea26099366ab1d490f901e3a4d4e inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d6991785cf42b2c2db4f8b3120b8208 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a2d6991785cf42b2c2db4f8b3120b8208">foreachWithCallback:andCallbackData:</a></td></tr> <tr class="separator:a2d6991785cf42b2c2db4f8b3120b8208 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaca6da18a53faa4969ee686acb167f9a inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(guint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#aaca6da18a53faa4969ee686acb167f9a">getBorderWidth</a></td></tr> <tr class="separator:aaca6da18a53faa4969ee686acb167f9a inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7b5fd214fa05e4be6cc52703b3fea90a inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GList *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a7b5fd214fa05e4be6cc52703b3fea90a">getChildren</a></td></tr> <tr class="separator:a7b5fd214fa05e4be6cc52703b3fea90a inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a75882742352f84775e73de737d50bdb1 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a75882742352f84775e73de737d50bdb1">getFocusChain:</a></td></tr> <tr class="separator:a75882742352f84775e73de737d50bdb1 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a24e7e405150045f4501c0e2ec886d614 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a24e7e405150045f4501c0e2ec886d614">getFocusChild</a></td></tr> <tr class="separator:a24e7e405150045f4501c0e2ec886d614 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9fb92a1be71d466f1708301984d991dc inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GtkAdjustment *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a9fb92a1be71d466f1708301984d991dc">getFocusHadjustment</a></td></tr> <tr class="separator:a9fb92a1be71d466f1708301984d991dc inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a470cf1286582c8f5c702b06a0aab7198 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GtkAdjustment *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a470cf1286582c8f5c702b06a0aab7198">getFocusVadjustment</a></td></tr> <tr class="separator:a470cf1286582c8f5c702b06a0aab7198 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0033b8a96146be12828d7a0fd3fec0fa inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GtkWidgetPath *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a0033b8a96146be12828d7a0fd3fec0fa">getPathForChild:</a></td></tr> <tr class="separator:a0033b8a96146be12828d7a0fd3fec0fa inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a13a5cc4f8e0342162c383c163a36daab inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(GtkResizeMode)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a13a5cc4f8e0342162c383c163a36daab">getResizeMode</a></td></tr> <tr class="separator:a13a5cc4f8e0342162c383c163a36daab inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f0130ba08482ce712c5d4b62dde92d4 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a9f0130ba08482ce712c5d4b62dde92d4">propagateDrawWithChild:andCr:</a></td></tr> <tr class="separator:a9f0130ba08482ce712c5d4b62dde92d4 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a538934d688fa4e3f5231b1a1e0886286 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a538934d688fa4e3f5231b1a1e0886286">remove:</a></td></tr> <tr class="separator:a538934d688fa4e3f5231b1a1e0886286 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9a15a9b064392ebc86e9db253065b27f inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a9a15a9b064392ebc86e9db253065b27f">resizeChildren</a></td></tr> <tr class="separator:a9a15a9b064392ebc86e9db253065b27f inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af0a135c2d6db989603d35320d077f704 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#af0a135c2d6db989603d35320d077f704">setBorderWidth:</a></td></tr> <tr class="separator:af0a135c2d6db989603d35320d077f704 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a181efda342f41d2dc9b08e443fabf886 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a181efda342f41d2dc9b08e443fabf886">setFocusChain:</a></td></tr> <tr class="separator:a181efda342f41d2dc9b08e443fabf886 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d9ad233faf0179668cb3225c22120fc inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a2d9ad233faf0179668cb3225c22120fc">setFocusChild:</a></td></tr> <tr class="separator:a2d9ad233faf0179668cb3225c22120fc inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa60aa530e405eb768f86733741448e34 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#aa60aa530e405eb768f86733741448e34">setFocusHadjustment:</a></td></tr> <tr class="separator:aa60aa530e405eb768f86733741448e34 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab553d0a635fcd9ab733ff9370213ca9d inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#ab553d0a635fcd9ab733ff9370213ca9d">setFocusVadjustment:</a></td></tr> <tr class="separator:ab553d0a635fcd9ab733ff9370213ca9d inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac1bdcd3e23d2b5d528133ede78b8483a inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#ac1bdcd3e23d2b5d528133ede78b8483a">setReallocateRedraws:</a></td></tr> <tr class="separator:ac1bdcd3e23d2b5d528133ede78b8483a inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6b2a1de63f347b7d7d5c8cd3008d15d5 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#a6b2a1de63f347b7d7d5c8cd3008d15d5">setResizeMode:</a></td></tr> <tr class="separator:a6b2a1de63f347b7d7d5c8cd3008d15d5 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acd66f3ec6b282e887e80179096ba1d67 inherit pub_methods_interface_c_g_t_k_container"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_container.html#acd66f3ec6b282e887e80179096ba1d67">unsetFocusChain</a></td></tr> <tr class="separator:acd66f3ec6b282e887e80179096ba1d67 inherit pub_methods_interface_c_g_t_k_container"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_interface_c_g_t_k_widget"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interface_c_g_t_k_widget')"><img src="closed.png" alt="-"/>&#160;Instance Methods inherited from <a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a></td></tr> <tr class="memitem:ae3f2fdcf83d1901f7aa8756067b52bf7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkWidget *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae3f2fdcf83d1901f7aa8756067b52bf7">WIDGET</a></td></tr> <tr class="separator:ae3f2fdcf83d1901f7aa8756067b52bf7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2c55e8488ef0a80f9b3ebcccb7a127bb inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2c55e8488ef0a80f9b3ebcccb7a127bb">addAcceleratorWithAccelSignal:andAccelGroup:andAccelKey:andAccelMods:andAccelFlags:</a></td></tr> <tr class="separator:a2c55e8488ef0a80f9b3ebcccb7a127bb inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a598b3c4a826b0f5ffd272d9c9dbf1449 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a598b3c4a826b0f5ffd272d9c9dbf1449">addDeviceEventsWithDevice:andEvents:</a></td></tr> <tr class="separator:a598b3c4a826b0f5ffd272d9c9dbf1449 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e4136aa2c462751566aaefc338c203d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6e4136aa2c462751566aaefc338c203d">addEvents:</a></td></tr> <tr class="separator:a6e4136aa2c462751566aaefc338c203d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8a98957f7086a47326b6f87165d1076c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8a98957f7086a47326b6f87165d1076c">addMnemonicLabel:</a></td></tr> <tr class="separator:a8a98957f7086a47326b6f87165d1076c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abd73849da3a9a5f0218a604d6f1692cc inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(guint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abd73849da3a9a5f0218a604d6f1692cc">addTickCallbackWithCallback:andUserData:andNotify:</a></td></tr> <tr class="separator:abd73849da3a9a5f0218a604d6f1692cc inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a14de6dd293c096ff29e30d59b873fb85 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a14de6dd293c096ff29e30d59b873fb85">canActivateAccel:</a></td></tr> <tr class="separator:a14de6dd293c096ff29e30d59b873fb85 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1bf2f9f41c60a287308a7f4058bbfcf5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1bf2f9f41c60a287308a7f4058bbfcf5">childFocus:</a></td></tr> <tr class="separator:a1bf2f9f41c60a287308a7f4058bbfcf5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a22c17c2ae602da5fb17587bd947fb77f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a22c17c2ae602da5fb17587bd947fb77f">childNotify:</a></td></tr> <tr class="separator:a22c17c2ae602da5fb17587bd947fb77f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7e04ba2a57897a511429a6e76011d381 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7e04ba2a57897a511429a6e76011d381">classPathWithPathLength:andPath:andPathReversed:</a></td></tr> <tr class="separator:a7e04ba2a57897a511429a6e76011d381 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ace88057ed514e62acb6c2e9ef89a1820 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ace88057ed514e62acb6c2e9ef89a1820">computeExpand:</a></td></tr> <tr class="separator:ace88057ed514e62acb6c2e9ef89a1820 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4ccbaeecce019b5ea1740fc0d0be9d6c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(PangoContext *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4ccbaeecce019b5ea1740fc0d0be9d6c">createPangoContext</a></td></tr> <tr class="separator:a4ccbaeecce019b5ea1740fc0d0be9d6c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aed32638aef6df0bc9e5b7daa259d6856 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(PangoLayout *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aed32638aef6df0bc9e5b7daa259d6856">createPangoLayout:</a></td></tr> <tr class="separator:aed32638aef6df0bc9e5b7daa259d6856 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a49abc58113965b5df9d5ac9262ea7a66 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a49abc58113965b5df9d5ac9262ea7a66">destroy</a></td></tr> <tr class="separator:a49abc58113965b5df9d5ac9262ea7a66 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a44ea770795efa1fbfdfd1b70c7d50898 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a44ea770795efa1fbfdfd1b70c7d50898">destroyed:</a></td></tr> <tr class="separator:a44ea770795efa1fbfdfd1b70c7d50898 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae3096b5e9f8bfee5ef4638ea1ece57e6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae3096b5e9f8bfee5ef4638ea1ece57e6">deviceIsShadowed:</a></td></tr> <tr class="separator:ae3096b5e9f8bfee5ef4638ea1ece57e6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac0d2f9a3e1187eb355989891ea12c380 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkDragContext *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac0d2f9a3e1187eb355989891ea12c380">gtkDragBeginWithTargets:andActions:andButton:andEvent:</a></td></tr> <tr class="separator:ac0d2f9a3e1187eb355989891ea12c380 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3a86b64f8b116b04bc53cf7a746984ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkDragContext *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3a86b64f8b116b04bc53cf7a746984ec">gtkDragBeginWithCoordinatesWithTargets:andActions:andButton:andEvent:andX:andY:</a></td></tr> <tr class="separator:a3a86b64f8b116b04bc53cf7a746984ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af1e61de2c3b0dfb54c1496b0c3f6d54d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af1e61de2c3b0dfb54c1496b0c3f6d54d">gtkDragCheckThresholdWithStartX:andStartY:andCurrentX:andCurrentY:</a></td></tr> <tr class="separator:af1e61de2c3b0dfb54c1496b0c3f6d54d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a99a555320ff8917b74662a3eec265d68 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a99a555320ff8917b74662a3eec265d68">gtkDragDestAddImageTargets</a></td></tr> <tr class="separator:a99a555320ff8917b74662a3eec265d68 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4251606c07625e0aa42df01371483aac inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4251606c07625e0aa42df01371483aac">gtkDragDestAddTextTargets</a></td></tr> <tr class="separator:a4251606c07625e0aa42df01371483aac inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a48d4a65675d22144d5af82785d125571 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a48d4a65675d22144d5af82785d125571">gtkDragDestAddUriTargets</a></td></tr> <tr class="separator:a48d4a65675d22144d5af82785d125571 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e48f41eb6368df75fdd94c1c83f39a7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkAtom)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6e48f41eb6368df75fdd94c1c83f39a7">gtkDragDestFindTargetWithContext:andTargetList:</a></td></tr> <tr class="separator:a6e48f41eb6368df75fdd94c1c83f39a7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a657afe2546eab067a362530b5a74616b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkTargetList *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a657afe2546eab067a362530b5a74616b">gtkDragDestGetTargetList</a></td></tr> <tr class="separator:a657afe2546eab067a362530b5a74616b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab336da4298ffe5279e097ea7e567ff1d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab336da4298ffe5279e097ea7e567ff1d">gtkDragDestGetTrackMotion</a></td></tr> <tr class="separator:ab336da4298ffe5279e097ea7e567ff1d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5611b3d9fc3fbc57d152b20f579b2831 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5611b3d9fc3fbc57d152b20f579b2831">gtkDragDestSetWithFlags:andTargets:andNtargets:andActions:</a></td></tr> <tr class="separator:a5611b3d9fc3fbc57d152b20f579b2831 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a56fe349f2649a880654b079568f57f04 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a56fe349f2649a880654b079568f57f04">gtkDragDestSetProxyWithProxyWindow:andProtocol:andUseCoordinates:</a></td></tr> <tr class="separator:a56fe349f2649a880654b079568f57f04 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa4a516012bd12167e72ff09f50976dfe inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa4a516012bd12167e72ff09f50976dfe">gtkDragDestSetTargetList:</a></td></tr> <tr class="separator:aa4a516012bd12167e72ff09f50976dfe inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aadb9048643d8538c19b6a5372682d3a6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aadb9048643d8538c19b6a5372682d3a6">gtkDragDestSetTrackMotion:</a></td></tr> <tr class="separator:aadb9048643d8538c19b6a5372682d3a6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1fd99e7021e007b2b5981f472f408d95 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1fd99e7021e007b2b5981f472f408d95">gtkDragDestUnset</a></td></tr> <tr class="separator:a1fd99e7021e007b2b5981f472f408d95 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a83031eff8e872125b6d25172282269a0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a83031eff8e872125b6d25172282269a0">gtkDragGetDataWithContext:andTarget:andTime:</a></td></tr> <tr class="separator:a83031eff8e872125b6d25172282269a0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4a408aebae1bd4d32d4d298773e0c722 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4a408aebae1bd4d32d4d298773e0c722">gtkDragHighlight</a></td></tr> <tr class="separator:a4a408aebae1bd4d32d4d298773e0c722 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6b62c2ba2c9fc0698e9a81372cd65f18 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6b62c2ba2c9fc0698e9a81372cd65f18">gtkDragSourceAddImageTargets</a></td></tr> <tr class="separator:a6b62c2ba2c9fc0698e9a81372cd65f18 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa84fa411fbfa01698e0d46076c521d41 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa84fa411fbfa01698e0d46076c521d41">gtkDragSourceAddTextTargets</a></td></tr> <tr class="separator:aa84fa411fbfa01698e0d46076c521d41 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad39ec50ff4b5c6d4bf8118d1fc6538c5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad39ec50ff4b5c6d4bf8118d1fc6538c5">gtkDragSourceAddUriTargets</a></td></tr> <tr class="separator:ad39ec50ff4b5c6d4bf8118d1fc6538c5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6745b39395764b6da8c706ae4482f1e7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkTargetList *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6745b39395764b6da8c706ae4482f1e7">gtkDragSourceGetTargetList</a></td></tr> <tr class="separator:a6745b39395764b6da8c706ae4482f1e7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aafd48e8eb58ace1682a353bdb9ce9e2a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aafd48e8eb58ace1682a353bdb9ce9e2a">gtkDragSourceSetWithStartButtonMask:andTargets:andNtargets:andActions:</a></td></tr> <tr class="separator:aafd48e8eb58ace1682a353bdb9ce9e2a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a68f6b1274423e4b24d50a1a012a489b1 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a68f6b1274423e4b24d50a1a012a489b1">gtkDragSourceSetIconGicon:</a></td></tr> <tr class="separator:a68f6b1274423e4b24d50a1a012a489b1 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8aedf329170784cf45f38a0648923f53 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8aedf329170784cf45f38a0648923f53">gtkDragSourceSetIconName:</a></td></tr> <tr class="separator:a8aedf329170784cf45f38a0648923f53 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6cef284bfc1e736c4bfb55a0b1a83b29 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6cef284bfc1e736c4bfb55a0b1a83b29">gtkDragSourceSetIconPixbuf:</a></td></tr> <tr class="separator:a6cef284bfc1e736c4bfb55a0b1a83b29 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaaff676ee3e74fb966523b089b9bc960 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aaaff676ee3e74fb966523b089b9bc960">gtkDragSourceSetIconStock:</a></td></tr> <tr class="separator:aaaff676ee3e74fb966523b089b9bc960 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a52e5751ec81f60558718659f033774c0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a52e5751ec81f60558718659f033774c0">gtkDragSourceSetTargetList:</a></td></tr> <tr class="separator:a52e5751ec81f60558718659f033774c0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab338bbfa4c11d07a6aed977b35ad4301 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab338bbfa4c11d07a6aed977b35ad4301">gtkDragSourceUnset</a></td></tr> <tr class="separator:ab338bbfa4c11d07a6aed977b35ad4301 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2c670c0971ceffa3f5d6d3a504a610d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2c670c0971ceffa3f5d6d3a504a610d2">gtkDragUnhighlight</a></td></tr> <tr class="separator:a2c670c0971ceffa3f5d6d3a504a610d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1d810e3e873ba9c627c5a4cd7f494dd0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1d810e3e873ba9c627c5a4cd7f494dd0">draw:</a></td></tr> <tr class="separator:a1d810e3e873ba9c627c5a4cd7f494dd0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8b2ec87d85e38b93f9967b2bc6c97654 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8b2ec87d85e38b93f9967b2bc6c97654">ensureStyle</a></td></tr> <tr class="separator:a8b2ec87d85e38b93f9967b2bc6c97654 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acc695bd0aa1492eaa06e7578e9856a47 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#acc695bd0aa1492eaa06e7578e9856a47">errorBell</a></td></tr> <tr class="separator:acc695bd0aa1492eaa06e7578e9856a47 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a82a32d0f60474b95112dfdbbd5524d76 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a82a32d0f60474b95112dfdbbd5524d76">event:</a></td></tr> <tr class="separator:a82a32d0f60474b95112dfdbbd5524d76 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7d5123c49edd866aa41658e58d81f082 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7d5123c49edd866aa41658e58d81f082">freezeChildNotify</a></td></tr> <tr class="separator:a7d5123c49edd866aa41658e58d81f082 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a31e267f63f7276b0fc37f61a28b27045 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(AtkObject *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a31e267f63f7276b0fc37f61a28b27045">getAccessible</a></td></tr> <tr class="separator:a31e267f63f7276b0fc37f61a28b27045 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a79cdd2eceda00512496e65172b9a4d79 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GActionGroup *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a79cdd2eceda00512496e65172b9a4d79">getActionGroup:</a></td></tr> <tr class="separator:a79cdd2eceda00512496e65172b9a4d79 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aae4f7a57d8de1aae648836acd06b2937 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(int)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aae4f7a57d8de1aae648836acd06b2937">getAllocatedBaseline</a></td></tr> <tr class="separator:aae4f7a57d8de1aae648836acd06b2937 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af0e7cf2d2801f021ca0dce21c5b2a510 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(int)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af0e7cf2d2801f021ca0dce21c5b2a510">getAllocatedHeight</a></td></tr> <tr class="separator:af0e7cf2d2801f021ca0dce21c5b2a510 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a159d298840809f92c028869ced9ce7e6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a159d298840809f92c028869ced9ce7e6">getAllocatedSizeWithAllocation:andBaseline:</a></td></tr> <tr class="separator:a159d298840809f92c028869ced9ce7e6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa298e567e1b87e03f87ee636c4beef23 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(int)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa298e567e1b87e03f87ee636c4beef23">getAllocatedWidth</a></td></tr> <tr class="separator:aa298e567e1b87e03f87ee636c4beef23 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abfadef17f7d5ba42125ea8704b91fb98 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abfadef17f7d5ba42125ea8704b91fb98">getAllocation:</a></td></tr> <tr class="separator:abfadef17f7d5ba42125ea8704b91fb98 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a24222b268964ce198ad9f1fa7ae7bade inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a24222b268964ce198ad9f1fa7ae7bade">getAncestor:</a></td></tr> <tr class="separator:a24222b268964ce198ad9f1fa7ae7bade inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1b09f7fde5bf8295d44aea416fd803dc inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1b09f7fde5bf8295d44aea416fd803dc">getAppPaintable</a></td></tr> <tr class="separator:a1b09f7fde5bf8295d44aea416fd803dc inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f7567616a279ece11f53627410995fc inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a9f7567616a279ece11f53627410995fc">getCanDefault</a></td></tr> <tr class="separator:a9f7567616a279ece11f53627410995fc inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abc938d6b05410e4d21afe5891c8fa95c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abc938d6b05410e4d21afe5891c8fa95c">getCanFocus</a></td></tr> <tr class="separator:abc938d6b05410e4d21afe5891c8fa95c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab830e3b398e1500263f2fea81b5e33d9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab830e3b398e1500263f2fea81b5e33d9">getChildRequisition:</a></td></tr> <tr class="separator:ab830e3b398e1500263f2fea81b5e33d9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a96eb60aa6f7f00ebae204a7fe8c503f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a96eb60aa6f7f00ebae204a7fe8c503f2">getChildVisible</a></td></tr> <tr class="separator:a96eb60aa6f7f00ebae204a7fe8c503f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1d8eb45a4b3ecbb353077619d543c792 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1d8eb45a4b3ecbb353077619d543c792">getClip:</a></td></tr> <tr class="separator:a1d8eb45a4b3ecbb353077619d543c792 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2946f46920be29a985bbf3877bb88c55 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkClipboard *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2946f46920be29a985bbf3877bb88c55">getClipboard:</a></td></tr> <tr class="separator:a2946f46920be29a985bbf3877bb88c55 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a34b8576d79b881ac7c66f5aac985b91d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a34b8576d79b881ac7c66f5aac985b91d">getCompositeName</a></td></tr> <tr class="separator:a34b8576d79b881ac7c66f5aac985b91d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a45cc868226236d52182b6f35660f2301 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a45cc868226236d52182b6f35660f2301">getDeviceEnabled:</a></td></tr> <tr class="separator:a45cc868226236d52182b6f35660f2301 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab962098179bacaab44b76ec586f316a4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkEventMask)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab962098179bacaab44b76ec586f316a4">getDeviceEvents:</a></td></tr> <tr class="separator:ab962098179bacaab44b76ec586f316a4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3e7856b1725cedc96564fe5b6a89b65b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkTextDirection)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3e7856b1725cedc96564fe5b6a89b65b">getDirection</a></td></tr> <tr class="separator:a3e7856b1725cedc96564fe5b6a89b65b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8cbed0b4f8b1632f09e010f60bc98df6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkDisplay *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8cbed0b4f8b1632f09e010f60bc98df6">getDisplay</a></td></tr> <tr class="separator:a8cbed0b4f8b1632f09e010f60bc98df6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aae52c231a3686dd25c5d2b414229dbc3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aae52c231a3686dd25c5d2b414229dbc3">getDoubleBuffered</a></td></tr> <tr class="separator:aae52c231a3686dd25c5d2b414229dbc3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6886aeff62230c00ba766b30b7aadbd2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6886aeff62230c00ba766b30b7aadbd2">getEvents</a></td></tr> <tr class="separator:a6886aeff62230c00ba766b30b7aadbd2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a473946e844002a5759d11c6ae57efd04 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a473946e844002a5759d11c6ae57efd04">getFocusOnClick</a></td></tr> <tr class="separator:a473946e844002a5759d11c6ae57efd04 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5a6210357e1025f04a510e5feabf8911 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(PangoFontMap *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5a6210357e1025f04a510e5feabf8911">getFontMap</a></td></tr> <tr class="separator:a5a6210357e1025f04a510e5feabf8911 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1d14c3991aed02d70bce69031d0621f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(const cairo_font_options_t *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1d14c3991aed02d70bce69031d0621f2">getFontOptions</a></td></tr> <tr class="separator:a1d14c3991aed02d70bce69031d0621f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad81eb03c30db6500a0c208a0a8f88c3f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkFrameClock *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad81eb03c30db6500a0c208a0a8f88c3f">getFrameClock</a></td></tr> <tr class="separator:ad81eb03c30db6500a0c208a0a8f88c3f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad0483caf2c147e429f1ebdc321fb314a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkAlign)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad0483caf2c147e429f1ebdc321fb314a">getHalign</a></td></tr> <tr class="separator:ad0483caf2c147e429f1ebdc321fb314a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a488b757ea2bc1d49e55845ac1d732c73 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a488b757ea2bc1d49e55845ac1d732c73">getHasTooltip</a></td></tr> <tr class="separator:a488b757ea2bc1d49e55845ac1d732c73 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0164b500267217201fcb2df4d3650053 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a0164b500267217201fcb2df4d3650053">getHasWindow</a></td></tr> <tr class="separator:a0164b500267217201fcb2df4d3650053 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab63adc91866c8cf2a949c5692d2ce043 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab63adc91866c8cf2a949c5692d2ce043">getHexpand</a></td></tr> <tr class="separator:ab63adc91866c8cf2a949c5692d2ce043 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa4b3342a0c09e4bfd73ae9582b5e31d4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa4b3342a0c09e4bfd73ae9582b5e31d4">getHexpandSet</a></td></tr> <tr class="separator:aa4b3342a0c09e4bfd73ae9582b5e31d4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad7425bfc70235c5b52b246ae28c8540b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad7425bfc70235c5b52b246ae28c8540b">getMapped</a></td></tr> <tr class="separator:ad7425bfc70235c5b52b246ae28c8540b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2876c83a33b041ee22f9dc6a32efd523 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2876c83a33b041ee22f9dc6a32efd523">getMarginBottom</a></td></tr> <tr class="separator:a2876c83a33b041ee22f9dc6a32efd523 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7504dc7f4f580aea7ce94f38f49e97ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7504dc7f4f580aea7ce94f38f49e97ec">getMarginEnd</a></td></tr> <tr class="separator:a7504dc7f4f580aea7ce94f38f49e97ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae256e596256df7f072a365a5914a630b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae256e596256df7f072a365a5914a630b">getMarginLeft</a></td></tr> <tr class="separator:ae256e596256df7f072a365a5914a630b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a64152aee63ca9236c44fa7e576e1aed9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a64152aee63ca9236c44fa7e576e1aed9">getMarginRight</a></td></tr> <tr class="separator:a64152aee63ca9236c44fa7e576e1aed9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac5fbb05224639d4017c80e0b6ce079b5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac5fbb05224639d4017c80e0b6ce079b5">getMarginStart</a></td></tr> <tr class="separator:ac5fbb05224639d4017c80e0b6ce079b5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5f90aefff6f4825c428a3a1f69ec511d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5f90aefff6f4825c428a3a1f69ec511d">getMarginTop</a></td></tr> <tr class="separator:a5f90aefff6f4825c428a3a1f69ec511d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa6f3e5de5e21168894a92802aa4c841d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkModifierType)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa6f3e5de5e21168894a92802aa4c841d">getModifierMask:</a></td></tr> <tr class="separator:aa6f3e5de5e21168894a92802aa4c841d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a65cb6fd7aa2330b230fccbe72fa6976a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkRcStyle *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a65cb6fd7aa2330b230fccbe72fa6976a">getModifierStyle</a></td></tr> <tr class="separator:a65cb6fd7aa2330b230fccbe72fa6976a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aff8ea0beee274842494440fc46508c13 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aff8ea0beee274842494440fc46508c13">getName</a></td></tr> <tr class="separator:aff8ea0beee274842494440fc46508c13 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad2a8b67da114cb4683ebcb1ad3a3eb5a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad2a8b67da114cb4683ebcb1ad3a3eb5a">getNoShowAll</a></td></tr> <tr class="separator:ad2a8b67da114cb4683ebcb1ad3a3eb5a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae329f13d4777f94d6458fe68694c919e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(double)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae329f13d4777f94d6458fe68694c919e">getOpacity</a></td></tr> <tr class="separator:ae329f13d4777f94d6458fe68694c919e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a73df256927890a8a95e0f64e87d2b00e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(PangoContext *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a73df256927890a8a95e0f64e87d2b00e">getPangoContext</a></td></tr> <tr class="separator:a73df256927890a8a95e0f64e87d2b00e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4c701e5a12b91e00d3c11aa3da3ec7c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4c701e5a12b91e00d3c11aa3da3ec7c7">getParent</a></td></tr> <tr class="separator:a4c701e5a12b91e00d3c11aa3da3ec7c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f91b4b611d995e0cc504312df4afb53 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a9f91b4b611d995e0cc504312df4afb53">getParentWindow</a></td></tr> <tr class="separator:a9f91b4b611d995e0cc504312df4afb53 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a266dc00483d330ba562d1cc695b1364e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkWidgetPath *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a266dc00483d330ba562d1cc695b1364e">getPath</a></td></tr> <tr class="separator:a266dc00483d330ba562d1cc695b1364e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a78aa2a4af9cf27e5adecf64e50f5184d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a78aa2a4af9cf27e5adecf64e50f5184d">getPointerWithX:andY:</a></td></tr> <tr class="separator:a78aa2a4af9cf27e5adecf64e50f5184d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1c1770da319872afa46a776c0af66018 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1c1770da319872afa46a776c0af66018">getPreferredHeightWithMinimumHeight:andNaturalHeight:</a></td></tr> <tr class="separator:a1c1770da319872afa46a776c0af66018 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab9d4ed8eb854e17ea6eed352dbf011a8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab9d4ed8eb854e17ea6eed352dbf011a8">getPreferredHeightAndBaselineForWidthWithWidth:andMinimumHeight:andNaturalHeight:andMinimumBaseline:andNaturalBaseline:</a></td></tr> <tr class="separator:ab9d4ed8eb854e17ea6eed352dbf011a8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a272cb4efdd5f09231e70a1bed9ceb8e8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a272cb4efdd5f09231e70a1bed9ceb8e8">getPreferredHeightForWidthWithWidth:andMinimumHeight:andNaturalHeight:</a></td></tr> <tr class="separator:a272cb4efdd5f09231e70a1bed9ceb8e8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9be055ca4e996fc54ad65859a38d78f3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a9be055ca4e996fc54ad65859a38d78f3">getPreferredSizeWithMinimumSize:andNaturalSize:</a></td></tr> <tr class="separator:a9be055ca4e996fc54ad65859a38d78f3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7389bdb69ebac9ea01ced704eda50e2c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7389bdb69ebac9ea01ced704eda50e2c">getPreferredWidthWithMinimumWidth:andNaturalWidth:</a></td></tr> <tr class="separator:a7389bdb69ebac9ea01ced704eda50e2c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a89cf36ebbffca23180b1f70bb35da4ab inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a89cf36ebbffca23180b1f70bb35da4ab">getPreferredWidthForHeightWithHeight:andMinimumWidth:andNaturalWidth:</a></td></tr> <tr class="separator:a89cf36ebbffca23180b1f70bb35da4ab inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7a5237f1ca1b96a8e7776b99a0f2c061 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7a5237f1ca1b96a8e7776b99a0f2c061">getRealized</a></td></tr> <tr class="separator:a7a5237f1ca1b96a8e7776b99a0f2c061 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa75738b143ef4f0520b5f257fcd16069 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa75738b143ef4f0520b5f257fcd16069">getReceivesDefault</a></td></tr> <tr class="separator:aa75738b143ef4f0520b5f257fcd16069 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa234f86d75f1ed90e4a97e3dc0d380b5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkSizeRequestMode)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa234f86d75f1ed90e4a97e3dc0d380b5">getRequestMode</a></td></tr> <tr class="separator:aa234f86d75f1ed90e4a97e3dc0d380b5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a569c9d224cbd076dfaae5a2a28e9fca6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a569c9d224cbd076dfaae5a2a28e9fca6">getRequisition:</a></td></tr> <tr class="separator:a569c9d224cbd076dfaae5a2a28e9fca6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6f51f3cc9950b191ef3c1be0b4ee8620 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6f51f3cc9950b191ef3c1be0b4ee8620">getRootWindow</a></td></tr> <tr class="separator:a6f51f3cc9950b191ef3c1be0b4ee8620 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a713ff7767f7ca2627eaac4de9f998281 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a713ff7767f7ca2627eaac4de9f998281">getScaleFactor</a></td></tr> <tr class="separator:a713ff7767f7ca2627eaac4de9f998281 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3c15d39fdb11f1e9ba78b78c388bbae7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkScreen *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3c15d39fdb11f1e9ba78b78c388bbae7">getScreen</a></td></tr> <tr class="separator:a3c15d39fdb11f1e9ba78b78c388bbae7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adb1e1d5f08229eb5dd2ce2d1af60880f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#adb1e1d5f08229eb5dd2ce2d1af60880f">getSensitive</a></td></tr> <tr class="separator:adb1e1d5f08229eb5dd2ce2d1af60880f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a816135d1f3821045f6e2996b179a7fb7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkSettings *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a816135d1f3821045f6e2996b179a7fb7">getSettings</a></td></tr> <tr class="separator:a816135d1f3821045f6e2996b179a7fb7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a33ceee8ef4190d2931a08c3b21ce167d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a33ceee8ef4190d2931a08c3b21ce167d">getSizeRequestWithWidth:andHeight:</a></td></tr> <tr class="separator:a33ceee8ef4190d2931a08c3b21ce167d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae6e1b530c246c205d69c59c32903a0ff inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkStateType)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae6e1b530c246c205d69c59c32903a0ff">getState</a></td></tr> <tr class="separator:ae6e1b530c246c205d69c59c32903a0ff inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a60ce210de5e514893aee5abbf8e6b642 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkStateFlags)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a60ce210de5e514893aee5abbf8e6b642">getStateFlags</a></td></tr> <tr class="separator:a60ce210de5e514893aee5abbf8e6b642 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afdd2fa4245f33752516f32175316d6bb inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkStyle *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afdd2fa4245f33752516f32175316d6bb">getStyle</a></td></tr> <tr class="separator:afdd2fa4245f33752516f32175316d6bb inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a531d1f276df05fdf6c33ce0c87f4d2d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkStyleContext *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a531d1f276df05fdf6c33ce0c87f4d2d2">getStyleContext</a></td></tr> <tr class="separator:a531d1f276df05fdf6c33ce0c87f4d2d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a71db754c15fab2afa5924eebac6c265d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a71db754c15fab2afa5924eebac6c265d">getSupportMultidevice</a></td></tr> <tr class="separator:a71db754c15fab2afa5924eebac6c265d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a51e5a19b22ed6696fbf908f19fd73662 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GObject *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a51e5a19b22ed6696fbf908f19fd73662">getTemplateChildWithWidgetType:andName:</a></td></tr> <tr class="separator:a51e5a19b22ed6696fbf908f19fd73662 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad4d4bffea857ec493d053db8325e3f6b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad4d4bffea857ec493d053db8325e3f6b">getTooltipMarkup</a></td></tr> <tr class="separator:ad4d4bffea857ec493d053db8325e3f6b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abbd9b85a8c68802f576c3d5ba414f550 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(NSString *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abbd9b85a8c68802f576c3d5ba414f550">getTooltipText</a></td></tr> <tr class="separator:abbd9b85a8c68802f576c3d5ba414f550 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a049a2d6bf5d2a34a702d217f94d5814a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkWindow *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a049a2d6bf5d2a34a702d217f94d5814a">getTooltipWindow</a></td></tr> <tr class="separator:a049a2d6bf5d2a34a702d217f94d5814a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab9381e76f65b99d0f548feae1e32ddbd inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a> *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab9381e76f65b99d0f548feae1e32ddbd">getToplevel</a></td></tr> <tr class="separator:ab9381e76f65b99d0f548feae1e32ddbd inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a832fcd94fcfab50c3e3f7986ae249c6b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkAlign)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a832fcd94fcfab50c3e3f7986ae249c6b">getValign</a></td></tr> <tr class="separator:a832fcd94fcfab50c3e3f7986ae249c6b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af8323417f59b832c91b7c5cc9dc4e37c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkAlign)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af8323417f59b832c91b7c5cc9dc4e37c">getValignWithBaseline</a></td></tr> <tr class="separator:af8323417f59b832c91b7c5cc9dc4e37c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3767a58021ac0af09c75f46d7dadfd7a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3767a58021ac0af09c75f46d7dadfd7a">getVexpand</a></td></tr> <tr class="separator:a3767a58021ac0af09c75f46d7dadfd7a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a799204ff773b0b41660b7d1d86d2bd2e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a799204ff773b0b41660b7d1d86d2bd2e">getVexpandSet</a></td></tr> <tr class="separator:a799204ff773b0b41660b7d1d86d2bd2e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a19f43e4c58ba1757381a7087a08930be inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a19f43e4c58ba1757381a7087a08930be">getVisible</a></td></tr> <tr class="separator:a19f43e4c58ba1757381a7087a08930be inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8777b3239658b9a1c9a075e4ef01e874 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkVisual *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8777b3239658b9a1c9a075e4ef01e874">getVisual</a></td></tr> <tr class="separator:a8777b3239658b9a1c9a075e4ef01e874 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afb99d0744f06b5f3d8061b1171c8df58 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afb99d0744f06b5f3d8061b1171c8df58">getWindow</a></td></tr> <tr class="separator:afb99d0744f06b5f3d8061b1171c8df58 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af1fc22fb43c4efcb0f3000827470771f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af1fc22fb43c4efcb0f3000827470771f">gtkGrabAdd</a></td></tr> <tr class="separator:af1fc22fb43c4efcb0f3000827470771f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a58c4c989df3bfc0f0986967acc113ba3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a58c4c989df3bfc0f0986967acc113ba3">grabDefault</a></td></tr> <tr class="separator:a58c4c989df3bfc0f0986967acc113ba3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a20524b669db15669e890c5a00b523e70 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a20524b669db15669e890c5a00b523e70">grabFocus</a></td></tr> <tr class="separator:a20524b669db15669e890c5a00b523e70 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a510b5607cf4e5ba97028a236a5f709e5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a510b5607cf4e5ba97028a236a5f709e5">gtkGrabRemove</a></td></tr> <tr class="separator:a510b5607cf4e5ba97028a236a5f709e5 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aee2c646e2d1ca917baecc5e99b9d8802 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aee2c646e2d1ca917baecc5e99b9d8802">hasDefault</a></td></tr> <tr class="separator:aee2c646e2d1ca917baecc5e99b9d8802 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad37d527b774ae4a9f9d2fc14172e17f9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad37d527b774ae4a9f9d2fc14172e17f9">hasFocus</a></td></tr> <tr class="separator:ad37d527b774ae4a9f9d2fc14172e17f9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a172a54d258cd3049559adb92253a0575 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a172a54d258cd3049559adb92253a0575">hasGrab</a></td></tr> <tr class="separator:a172a54d258cd3049559adb92253a0575 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af4ce642168176463da445320793e3297 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af4ce642168176463da445320793e3297">hasRcStyle</a></td></tr> <tr class="separator:af4ce642168176463da445320793e3297 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab4022b5a7b59630684c9d4a8d488bd29 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab4022b5a7b59630684c9d4a8d488bd29">hasScreen</a></td></tr> <tr class="separator:ab4022b5a7b59630684c9d4a8d488bd29 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af5064931b4855095bc788c7f574d2520 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af5064931b4855095bc788c7f574d2520">hasVisibleFocus</a></td></tr> <tr class="separator:af5064931b4855095bc788c7f574d2520 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a18eb1d2ff44967a37b0ccdc07533b93a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a18eb1d2ff44967a37b0ccdc07533b93a">hide</a></td></tr> <tr class="separator:a18eb1d2ff44967a37b0ccdc07533b93a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0c610842d7f05c4cf6f80ca731301075 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a0c610842d7f05c4cf6f80ca731301075">hideOnDelete</a></td></tr> <tr class="separator:a0c610842d7f05c4cf6f80ca731301075 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1e29829a0e7c81c99163c3edf0024410 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1e29829a0e7c81c99163c3edf0024410">inDestruction</a></td></tr> <tr class="separator:a1e29829a0e7c81c99163c3edf0024410 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d6d01ddaca5c83f1e0574823d17f206 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2d6d01ddaca5c83f1e0574823d17f206">initTemplate</a></td></tr> <tr class="separator:a2d6d01ddaca5c83f1e0574823d17f206 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7271ceb5acd8cbf8c4cb103a9f7f6368 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7271ceb5acd8cbf8c4cb103a9f7f6368">inputShapeCombineRegion:</a></td></tr> <tr class="separator:a7271ceb5acd8cbf8c4cb103a9f7f6368 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa689039fda371cb06c2e33183ddfd7cd inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa689039fda371cb06c2e33183ddfd7cd">insertActionGroupWithName:andGroup:</a></td></tr> <tr class="separator:aa689039fda371cb06c2e33183ddfd7cd inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aef54289b1456c75e70ae8ea08762be2c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aef54289b1456c75e70ae8ea08762be2c">intersectWithArea:andIntersection:</a></td></tr> <tr class="separator:aef54289b1456c75e70ae8ea08762be2c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1410c9f9bbfa16176048f5f5304aa072 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1410c9f9bbfa16176048f5f5304aa072">isAncestor:</a></td></tr> <tr class="separator:a1410c9f9bbfa16176048f5f5304aa072 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abe2b4d5aa03a9e16a1b0b901eb7d5ddf inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abe2b4d5aa03a9e16a1b0b901eb7d5ddf">isComposited</a></td></tr> <tr class="separator:abe2b4d5aa03a9e16a1b0b901eb7d5ddf inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3423e25abd513b50942344320fe0ad01 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3423e25abd513b50942344320fe0ad01">isDrawable</a></td></tr> <tr class="separator:a3423e25abd513b50942344320fe0ad01 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a40bea8af8c41c27b8aa3daf04b4b0a93 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a40bea8af8c41c27b8aa3daf04b4b0a93">isFocus</a></td></tr> <tr class="separator:a40bea8af8c41c27b8aa3daf04b4b0a93 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a528b81ff78e755d5c3c7bf819bad4346 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a528b81ff78e755d5c3c7bf819bad4346">isSensitive</a></td></tr> <tr class="separator:a528b81ff78e755d5c3c7bf819bad4346 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac1c2c40164a097b5e02b9032847641e8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac1c2c40164a097b5e02b9032847641e8">isToplevel</a></td></tr> <tr class="separator:ac1c2c40164a097b5e02b9032847641e8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6c035b677e2b3104f8f31317cb54e63b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6c035b677e2b3104f8f31317cb54e63b">isVisible</a></td></tr> <tr class="separator:a6c035b677e2b3104f8f31317cb54e63b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aac193bede5729cdfbc37480a2a9f50b1 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aac193bede5729cdfbc37480a2a9f50b1">keynavFailed:</a></td></tr> <tr class="separator:aac193bede5729cdfbc37480a2a9f50b1 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5a1b57acde17977aa43d42bec974a04c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GList *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5a1b57acde17977aa43d42bec974a04c">listAccelClosures</a></td></tr> <tr class="separator:a5a1b57acde17977aa43d42bec974a04c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad818164dab21652dcc118c03c948ca7a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(const gchar **)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad818164dab21652dcc118c03c948ca7a">listActionPrefixes</a></td></tr> <tr class="separator:ad818164dab21652dcc118c03c948ca7a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab2105cfbf29304fc79f35ea2a474860b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GList *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab2105cfbf29304fc79f35ea2a474860b">listMnemonicLabels</a></td></tr> <tr class="separator:ab2105cfbf29304fc79f35ea2a474860b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad14f1a1d618e9077733922449ce63cf6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad14f1a1d618e9077733922449ce63cf6">map</a></td></tr> <tr class="separator:ad14f1a1d618e9077733922449ce63cf6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aea6173a39482420a935f3c261149ca8c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aea6173a39482420a935f3c261149ca8c">mnemonicActivate:</a></td></tr> <tr class="separator:aea6173a39482420a935f3c261149ca8c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5649fc7fe9bc19316b2c2b1986d42c28 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5649fc7fe9bc19316b2c2b1986d42c28">modifyBaseWithState:andColor:</a></td></tr> <tr class="separator:a5649fc7fe9bc19316b2c2b1986d42c28 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a50e976a3c7831fbcc18a6fae5c5fda56 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a50e976a3c7831fbcc18a6fae5c5fda56">modifyBgWithState:andColor:</a></td></tr> <tr class="separator:a50e976a3c7831fbcc18a6fae5c5fda56 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4703525b25265590d79020e7252d0a1b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4703525b25265590d79020e7252d0a1b">modifyCursorWithPrimary:andSecondary:</a></td></tr> <tr class="separator:a4703525b25265590d79020e7252d0a1b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a74b01ac3098c6145a8bc7d34ea866509 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a74b01ac3098c6145a8bc7d34ea866509">modifyFgWithState:andColor:</a></td></tr> <tr class="separator:a74b01ac3098c6145a8bc7d34ea866509 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9af39fb46882c1c5c2a1034b6cdac799 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a9af39fb46882c1c5c2a1034b6cdac799">modifyFont:</a></td></tr> <tr class="separator:a9af39fb46882c1c5c2a1034b6cdac799 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a71767829b33aecfb6dbbbb6c0002bab8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a71767829b33aecfb6dbbbb6c0002bab8">modifyStyle:</a></td></tr> <tr class="separator:a71767829b33aecfb6dbbbb6c0002bab8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3054e88109435d5376b7432878004b07 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3054e88109435d5376b7432878004b07">modifyTextWithState:andColor:</a></td></tr> <tr class="separator:a3054e88109435d5376b7432878004b07 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab9497e604fa20880240adf8e5f23249b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab9497e604fa20880240adf8e5f23249b">overrideBackgroundColorWithState:andColor:</a></td></tr> <tr class="separator:ab9497e604fa20880240adf8e5f23249b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5e9689020633173c026fe7cd053507db inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a5e9689020633173c026fe7cd053507db">overrideColorWithState:andColor:</a></td></tr> <tr class="separator:a5e9689020633173c026fe7cd053507db inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7d83d6facc8960c52ef0f37f56b71456 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7d83d6facc8960c52ef0f37f56b71456">overrideCursorWithCursor:andSecondaryCursor:</a></td></tr> <tr class="separator:a7d83d6facc8960c52ef0f37f56b71456 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad23c9554f782ec5f06d6149b3825c23f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ad23c9554f782ec5f06d6149b3825c23f">overrideFont:</a></td></tr> <tr class="separator:ad23c9554f782ec5f06d6149b3825c23f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac248f93aa49c5e775d6d5df93ccba2af inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac248f93aa49c5e775d6d5df93ccba2af">overrideSymbolicColorWithName:andColor:</a></td></tr> <tr class="separator:ac248f93aa49c5e775d6d5df93ccba2af inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a12622c4b380c9007043da3177e81e8aa inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a12622c4b380c9007043da3177e81e8aa">pathWithPathLength:andPath:andPathReversed:</a></td></tr> <tr class="separator:a12622c4b380c9007043da3177e81e8aa inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae258b9f503fe8aa097eb6a4ac96b44f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae258b9f503fe8aa097eb6a4ac96b44f2">queueAllocate</a></td></tr> <tr class="separator:ae258b9f503fe8aa097eb6a4ac96b44f2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4aae1336c0e2dcb08be4774d2ebe57f7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4aae1336c0e2dcb08be4774d2ebe57f7">queueComputeExpand</a></td></tr> <tr class="separator:a4aae1336c0e2dcb08be4774d2ebe57f7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a397a2f86ddd1cfd7778410de7eb7c9a6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a397a2f86ddd1cfd7778410de7eb7c9a6">queueDraw</a></td></tr> <tr class="separator:a397a2f86ddd1cfd7778410de7eb7c9a6 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abd55800adfc42adadadb7ab6025f0e2f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abd55800adfc42adadadb7ab6025f0e2f">queueDrawAreaWithX:andY:andWidth:andHeight:</a></td></tr> <tr class="separator:abd55800adfc42adadadb7ab6025f0e2f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac06bdcc0d01cd4fc6889b5f41aa698e4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac06bdcc0d01cd4fc6889b5f41aa698e4">queueDrawRegion:</a></td></tr> <tr class="separator:ac06bdcc0d01cd4fc6889b5f41aa698e4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a57ea2b06dfeacd0a658c32bdc91468c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a57ea2b06dfeacd0a658c32bdc91468c7">queueResize</a></td></tr> <tr class="separator:a57ea2b06dfeacd0a658c32bdc91468c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa45c06501e4ab39c63f71e62e6da7495 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa45c06501e4ab39c63f71e62e6da7495">queueResizeNoRedraw</a></td></tr> <tr class="separator:aa45c06501e4ab39c63f71e62e6da7495 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab73862f0fc23d7dd6c8e23dd29614bff inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab73862f0fc23d7dd6c8e23dd29614bff">realize</a></td></tr> <tr class="separator:ab73862f0fc23d7dd6c8e23dd29614bff inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afa5afe689b61dff81c2e9f958c52ada4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(cairo_region_t *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afa5afe689b61dff81c2e9f958c52ada4">regionIntersect:</a></td></tr> <tr class="separator:afa5afe689b61dff81c2e9f958c52ada4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8cd7cf9072471ba4832f295b0227091c inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8cd7cf9072471ba4832f295b0227091c">registerWindow:</a></td></tr> <tr class="separator:a8cd7cf9072471ba4832f295b0227091c inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3d13e915a1e393e2040449e385183e0f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3d13e915a1e393e2040449e385183e0f">removeAcceleratorWithAccelGroup:andAccelKey:andAccelMods:</a></td></tr> <tr class="separator:a3d13e915a1e393e2040449e385183e0f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a643b6c0d2ce828876e1e4e225193d260 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a643b6c0d2ce828876e1e4e225193d260">removeMnemonicLabel:</a></td></tr> <tr class="separator:a643b6c0d2ce828876e1e4e225193d260 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa8ca32a6ce14d6dba580300408aeb12f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa8ca32a6ce14d6dba580300408aeb12f">removeTickCallback:</a></td></tr> <tr class="separator:aa8ca32a6ce14d6dba580300408aeb12f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a014cb6c33983d20dff40f05f5cdd3c52 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkPixbuf *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a014cb6c33983d20dff40f05f5cdd3c52">renderIconWithStockId:andSize:andDetail:</a></td></tr> <tr class="separator:a014cb6c33983d20dff40f05f5cdd3c52 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a52a7129478b2225a8b0f24bd4e2a16a8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GdkPixbuf *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a52a7129478b2225a8b0f24bd4e2a16a8">renderIconPixbufWithStockId:andSize:</a></td></tr> <tr class="separator:a52a7129478b2225a8b0f24bd4e2a16a8 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8d4a9a0a25f245ae6f9ec4f605ba57f4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8d4a9a0a25f245ae6f9ec4f605ba57f4">reparent:</a></td></tr> <tr class="separator:a8d4a9a0a25f245ae6f9ec4f605ba57f4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af464c26c504c62e173ebf96ca5897897 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af464c26c504c62e173ebf96ca5897897">resetRcStyles</a></td></tr> <tr class="separator:af464c26c504c62e173ebf96ca5897897 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7fe988f7b82f68af5093a9e7ae7aa624 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7fe988f7b82f68af5093a9e7ae7aa624">resetStyle</a></td></tr> <tr class="separator:a7fe988f7b82f68af5093a9e7ae7aa624 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a223360a3b7871a5e57e5ff5db93d59ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(gint)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a223360a3b7871a5e57e5ff5db93d59ec">sendExpose:</a></td></tr> <tr class="separator:a223360a3b7871a5e57e5ff5db93d59ec inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a621cf231992241ea4b6a712a1c72bc60 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a621cf231992241ea4b6a712a1c72bc60">sendFocusChange:</a></td></tr> <tr class="separator:a621cf231992241ea4b6a712a1c72bc60 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa6f616f327918b4a5ebeb8ce74dc7364 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aa6f616f327918b4a5ebeb8ce74dc7364">setAccelPathWithAccelPath:andAccelGroup:</a></td></tr> <tr class="separator:aa6f616f327918b4a5ebeb8ce74dc7364 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e6bc9bce25661bd01d345b619c45f75 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6e6bc9bce25661bd01d345b619c45f75">setAllocation:</a></td></tr> <tr class="separator:a6e6bc9bce25661bd01d345b619c45f75 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afe291d4a47b8153e09759db24d7390a0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afe291d4a47b8153e09759db24d7390a0">setAppPaintable:</a></td></tr> <tr class="separator:afe291d4a47b8153e09759db24d7390a0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abfa0fa606bb6b4806b57e38ab5105c7e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abfa0fa606bb6b4806b57e38ab5105c7e">setCanDefault:</a></td></tr> <tr class="separator:abfa0fa606bb6b4806b57e38ab5105c7e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acdb5b0ff287adff2967debc6f3a5d909 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#acdb5b0ff287adff2967debc6f3a5d909">setCanFocus:</a></td></tr> <tr class="separator:acdb5b0ff287adff2967debc6f3a5d909 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6413144416976875ff2cddb457dcb47b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6413144416976875ff2cddb457dcb47b">setChildVisible:</a></td></tr> <tr class="separator:a6413144416976875ff2cddb457dcb47b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7be14cf860b4de3eaadb244692a78cb7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7be14cf860b4de3eaadb244692a78cb7">setClip:</a></td></tr> <tr class="separator:a7be14cf860b4de3eaadb244692a78cb7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a89a87db3d8f4f5d8845a11a47d4dbef4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a89a87db3d8f4f5d8845a11a47d4dbef4">setCompositeName:</a></td></tr> <tr class="separator:a89a87db3d8f4f5d8845a11a47d4dbef4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abea446f072aae2b7b5ec45f9d1918b38 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#abea446f072aae2b7b5ec45f9d1918b38">setDeviceEnabledWithDevice:andEnabled:</a></td></tr> <tr class="separator:abea446f072aae2b7b5ec45f9d1918b38 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae17b6069d7a6799347bddf614cb6300e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae17b6069d7a6799347bddf614cb6300e">setDeviceEventsWithDevice:andEvents:</a></td></tr> <tr class="separator:ae17b6069d7a6799347bddf614cb6300e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a46eb42bb649a1abd59b1e398e6e3c58d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a46eb42bb649a1abd59b1e398e6e3c58d">setDirection:</a></td></tr> <tr class="separator:a46eb42bb649a1abd59b1e398e6e3c58d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adcfda1434b8a006065595260ecb2361a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#adcfda1434b8a006065595260ecb2361a">setDoubleBuffered:</a></td></tr> <tr class="separator:adcfda1434b8a006065595260ecb2361a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac9578fc2db474f42281e9d2039fb9214 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac9578fc2db474f42281e9d2039fb9214">setEvents:</a></td></tr> <tr class="separator:ac9578fc2db474f42281e9d2039fb9214 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a71625cf1471dcd8a095420c06921bb88 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a71625cf1471dcd8a095420c06921bb88">setFocusOnClick:</a></td></tr> <tr class="separator:a71625cf1471dcd8a095420c06921bb88 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8c00c395c4c35b5ab2961d294b79b5bd inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8c00c395c4c35b5ab2961d294b79b5bd">setFontMap:</a></td></tr> <tr class="separator:a8c00c395c4c35b5ab2961d294b79b5bd inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab709e7da857cc413349e76c82a4eb644 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ab709e7da857cc413349e76c82a4eb644">setFontOptions:</a></td></tr> <tr class="separator:ab709e7da857cc413349e76c82a4eb644 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a909f65ffdce391704302d83763920f10 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a909f65ffdce391704302d83763920f10">setHalign:</a></td></tr> <tr class="separator:a909f65ffdce391704302d83763920f10 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1ae312130de54ba26f948e30e6cbe3a2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1ae312130de54ba26f948e30e6cbe3a2">setHasTooltip:</a></td></tr> <tr class="separator:a1ae312130de54ba26f948e30e6cbe3a2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d5ad35eaf1aa483a1e45961a752c47d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2d5ad35eaf1aa483a1e45961a752c47d">setHasWindow:</a></td></tr> <tr class="separator:a2d5ad35eaf1aa483a1e45961a752c47d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ab2506e8e063882714af8e792676927 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6ab2506e8e063882714af8e792676927">setHexpand:</a></td></tr> <tr class="separator:a6ab2506e8e063882714af8e792676927 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aacb4fdf95b3b5b4fa8aafef1b9c01df0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aacb4fdf95b3b5b4fa8aafef1b9c01df0">setHexpandSet:</a></td></tr> <tr class="separator:aacb4fdf95b3b5b4fa8aafef1b9c01df0 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2e904b919493da61d474e6226e13884d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a2e904b919493da61d474e6226e13884d">setMapped:</a></td></tr> <tr class="separator:a2e904b919493da61d474e6226e13884d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3c4a59759408832a079189cda6c8689e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3c4a59759408832a079189cda6c8689e">setMarginBottom:</a></td></tr> <tr class="separator:a3c4a59759408832a079189cda6c8689e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a56e29b11df29273292a35ef0119d4d7d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a56e29b11df29273292a35ef0119d4d7d">setMarginEnd:</a></td></tr> <tr class="separator:a56e29b11df29273292a35ef0119d4d7d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acdeb4e26f5cdd0f7af4e5aaa87dea0d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#acdeb4e26f5cdd0f7af4e5aaa87dea0d2">setMarginLeft:</a></td></tr> <tr class="separator:acdeb4e26f5cdd0f7af4e5aaa87dea0d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac335c54485edd4855e9945dca7dbbc6e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac335c54485edd4855e9945dca7dbbc6e">setMarginRight:</a></td></tr> <tr class="separator:ac335c54485edd4855e9945dca7dbbc6e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1415b3e839cf72a0512d4b4d1594878e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1415b3e839cf72a0512d4b4d1594878e">setMarginStart:</a></td></tr> <tr class="separator:a1415b3e839cf72a0512d4b4d1594878e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af3a59b808cedc70dcc84a33d96d142c4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af3a59b808cedc70dcc84a33d96d142c4">setMarginTop:</a></td></tr> <tr class="separator:af3a59b808cedc70dcc84a33d96d142c4 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a44a6a0461dfaeb56e2b3ff0e5ec47088 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a44a6a0461dfaeb56e2b3ff0e5ec47088">setName:</a></td></tr> <tr class="separator:a44a6a0461dfaeb56e2b3ff0e5ec47088 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adafb02c611faf14312893a91defaaa5e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#adafb02c611faf14312893a91defaaa5e">setNoShowAll:</a></td></tr> <tr class="separator:adafb02c611faf14312893a91defaaa5e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a151995f128f9bb6cc22812c25c074d49 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a151995f128f9bb6cc22812c25c074d49">setOpacity:</a></td></tr> <tr class="separator:a151995f128f9bb6cc22812c25c074d49 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af56ad043233d7343c7d3bf0d33c9ed49 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af56ad043233d7343c7d3bf0d33c9ed49">setParent:</a></td></tr> <tr class="separator:af56ad043233d7343c7d3bf0d33c9ed49 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac06f0b53ee3781718f509499fa6783fb inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac06f0b53ee3781718f509499fa6783fb">setParentWindow:</a></td></tr> <tr class="separator:ac06f0b53ee3781718f509499fa6783fb inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4a565bfecd9ee4606ccb1c949220cdb3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a4a565bfecd9ee4606ccb1c949220cdb3">setRealized:</a></td></tr> <tr class="separator:a4a565bfecd9ee4606ccb1c949220cdb3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a485c2ae222bf338d20b566f94beafeaa inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a485c2ae222bf338d20b566f94beafeaa">setReceivesDefault:</a></td></tr> <tr class="separator:a485c2ae222bf338d20b566f94beafeaa inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac6214115d0bb3524a139687db29183dc inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac6214115d0bb3524a139687db29183dc">setRedrawOnAllocate:</a></td></tr> <tr class="separator:ac6214115d0bb3524a139687db29183dc inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af779d72c265ad6b420088a4e677795f9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#af779d72c265ad6b420088a4e677795f9">setSensitive:</a></td></tr> <tr class="separator:af779d72c265ad6b420088a4e677795f9 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adb3a0759ea886cf3d993df16b638771a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#adb3a0759ea886cf3d993df16b638771a">setSizeRequestWithWidth:andHeight:</a></td></tr> <tr class="separator:adb3a0759ea886cf3d993df16b638771a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae1e6710e2f81bdd00df56af1843a04d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ae1e6710e2f81bdd00df56af1843a04d2">setState:</a></td></tr> <tr class="separator:ae1e6710e2f81bdd00df56af1843a04d2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3b89087c99f47400392ca1c6d1736129 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3b89087c99f47400392ca1c6d1736129">setStateFlagsWithFlags:andClear:</a></td></tr> <tr class="separator:a3b89087c99f47400392ca1c6d1736129 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a308d2aeb940c9f6693111bdc4e9019a2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a308d2aeb940c9f6693111bdc4e9019a2">setStyle:</a></td></tr> <tr class="separator:a308d2aeb940c9f6693111bdc4e9019a2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1e810a26a2ca787b1199b00a11ce3b4d inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1e810a26a2ca787b1199b00a11ce3b4d">setSupportMultidevice:</a></td></tr> <tr class="separator:a1e810a26a2ca787b1199b00a11ce3b4d inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a11b94bc82753589ce7cc19b0ecd3c29e inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a11b94bc82753589ce7cc19b0ecd3c29e">setTooltipMarkup:</a></td></tr> <tr class="separator:a11b94bc82753589ce7cc19b0ecd3c29e inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afafca4e6bd6d73ec51fb84b1426dc455 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afafca4e6bd6d73ec51fb84b1426dc455">setTooltipText:</a></td></tr> <tr class="separator:afafca4e6bd6d73ec51fb84b1426dc455 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a326a2bb86862cc26924598f52665f87f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a326a2bb86862cc26924598f52665f87f">setTooltipWindow:</a></td></tr> <tr class="separator:a326a2bb86862cc26924598f52665f87f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a67893ebb6d07677f3d00608540a9d5df inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a67893ebb6d07677f3d00608540a9d5df">setValign:</a></td></tr> <tr class="separator:a67893ebb6d07677f3d00608540a9d5df inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a46f0ca07fb2cbe2004f37b0ee2edfe76 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a46f0ca07fb2cbe2004f37b0ee2edfe76">setVexpand:</a></td></tr> <tr class="separator:a46f0ca07fb2cbe2004f37b0ee2edfe76 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a54edff6d04876a172d6f3cbf324962bc inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a54edff6d04876a172d6f3cbf324962bc">setVexpandSet:</a></td></tr> <tr class="separator:a54edff6d04876a172d6f3cbf324962bc inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afcc4c3c6070f49c2cf49ac6328774d97 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afcc4c3c6070f49c2cf49ac6328774d97">setVisible:</a></td></tr> <tr class="separator:afcc4c3c6070f49c2cf49ac6328774d97 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a31a85055a1b7bdfe704b5dc21bba1234 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a31a85055a1b7bdfe704b5dc21bba1234">setVisual:</a></td></tr> <tr class="separator:a31a85055a1b7bdfe704b5dc21bba1234 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a501ab42e3088c78603aee0228371909f inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a501ab42e3088c78603aee0228371909f">setWindow:</a></td></tr> <tr class="separator:a501ab42e3088c78603aee0228371909f inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afed4ead169c3614070d3a52955afe373 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afed4ead169c3614070d3a52955afe373">shapeCombineRegion:</a></td></tr> <tr class="separator:afed4ead169c3614070d3a52955afe373 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7b5d401676c78dbccb41f4ad8d3383af inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a7b5d401676c78dbccb41f4ad8d3383af">show</a></td></tr> <tr class="separator:a7b5d401676c78dbccb41f4ad8d3383af inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1263a8ad40d5f71f74dd9e957628749a inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1263a8ad40d5f71f74dd9e957628749a">showAll</a></td></tr> <tr class="separator:a1263a8ad40d5f71f74dd9e957628749a inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a99a69302361c3191a11763332a657318 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a99a69302361c3191a11763332a657318">showNow</a></td></tr> <tr class="separator:a99a69302361c3191a11763332a657318 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3759d78a2a09fe63af25bf3b02028dba inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3759d78a2a09fe63af25bf3b02028dba">sizeAllocate:</a></td></tr> <tr class="separator:a3759d78a2a09fe63af25bf3b02028dba inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a63c9d00979e2ee28dc3ea33262ac3464 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a63c9d00979e2ee28dc3ea33262ac3464">sizeAllocateWithBaselineWithAllocation:andBaseline:</a></td></tr> <tr class="separator:a63c9d00979e2ee28dc3ea33262ac3464 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a12eb9f5051b0406e87ad256c1da99d28 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a12eb9f5051b0406e87ad256c1da99d28">sizeRequest:</a></td></tr> <tr class="separator:a12eb9f5051b0406e87ad256c1da99d28 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aef49bd32369b6ebba3a6113debe49059 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aef49bd32369b6ebba3a6113debe49059">styleAttach</a></td></tr> <tr class="separator:aef49bd32369b6ebba3a6113debe49059 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6f5e46d70736a8878e84d2ff7689b6b2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a6f5e46d70736a8878e84d2ff7689b6b2">styleGetPropertyWithPropertyName:andValue:</a></td></tr> <tr class="separator:a6f5e46d70736a8878e84d2ff7689b6b2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaa45bebc29fb3ba57b53f94f83f2a342 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#aaa45bebc29fb3ba57b53f94f83f2a342">styleGetValistWithFirstPropertyName:andVarArgs:</a></td></tr> <tr class="separator:aaa45bebc29fb3ba57b53f94f83f2a342 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1ab0ebd7170c0edf4d32d521f19869f7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a1ab0ebd7170c0edf4d32d521f19869f7">thawChildNotify</a></td></tr> <tr class="separator:a1ab0ebd7170c0edf4d32d521f19869f7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3fa237e6e9a657ac27fff2fa94128fb2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a3fa237e6e9a657ac27fff2fa94128fb2">translateCoordinatesWithDestWidget:andSrcX:andSrcY:andDestX:andDestY:</a></td></tr> <tr class="separator:a3fa237e6e9a657ac27fff2fa94128fb2 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0510c02173a437fdd49d94d562f412b3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a0510c02173a437fdd49d94d562f412b3">triggerTooltipQuery</a></td></tr> <tr class="separator:a0510c02173a437fdd49d94d562f412b3 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0273ae8822a1f19b27b78c04def9165b inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a0273ae8822a1f19b27b78c04def9165b">unmap</a></td></tr> <tr class="separator:a0273ae8822a1f19b27b78c04def9165b inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8b9b596cb260a701ddbe450521fbc571 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a8b9b596cb260a701ddbe450521fbc571">unparent</a></td></tr> <tr class="separator:a8b9b596cb260a701ddbe450521fbc571 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a35765c8138aed8d79a05d661e14cab47 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#a35765c8138aed8d79a05d661e14cab47">unrealize</a></td></tr> <tr class="separator:a35765c8138aed8d79a05d661e14cab47 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afca614d00df68991eeadb12864232df7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#afca614d00df68991eeadb12864232df7">unregisterWindow:</a></td></tr> <tr class="separator:afca614d00df68991eeadb12864232df7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac2598a4f7e6c9ea33b1d04c9c64ac4c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_widget.html#ac2598a4f7e6c9ea33b1d04c9c64ac4c7">unsetStateFlags:</a></td></tr> <tr class="separator:ac2598a4f7e6c9ea33b1d04c9c64ac4c7 inherit pub_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_interface_c_g_t_k_base"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interface_c_g_t_k_base')"><img src="closed.png" alt="-"/>&#160;Instance Methods inherited from <a class="el" href="interface_c_g_t_k_base.html">CGTKBase</a></td></tr> <tr class="memitem:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interface_c_g_t_k_base"><td class="memItemLeft" align="right" valign="top">(id)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_base.html#a94d3a3ecf62077e420e370ca4a72bbd6">initWithGObject:</a></td></tr> <tr class="separator:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interface_c_g_t_k_base"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interface_c_g_t_k_base"><td class="memItemLeft" align="right" valign="top">(void)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_base.html#ad080954f73c40813909f6a477d482b75">setGObject:</a></td></tr> <tr class="separator:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interface_c_g_t_k_base"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interface_c_g_t_k_base"><td class="memItemLeft" align="right" valign="top">(GObject *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_c_g_t_k_base.html#a07553be10a943fead663d4b3f5ed791d">GOBJECT</a></td></tr> <tr class="separator:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interface_c_g_t_k_base"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pub_static_methods_interface_c_g_t_k_widget"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_interface_c_g_t_k_widget')"><img src="closed.png" alt="-"/>&#160;Class Methods inherited from <a class="el" href="interface_c_g_t_k_widget.html">CGTKWidget</a></td></tr> <tr class="memitem:a0bd57b572cd41e78a0f78a45eb3aac0a inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top">(GtkTextDirection)&#160;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_c_g_t_k_widget.html#a0bd57b572cd41e78a0f78a45eb3aac0a">getDefaultDirection</a></td></tr> <tr class="separator:a0bd57b572cd41e78a0f78a45eb3aac0a inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a269334f315947dd9abf207add59a5ca7 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top"><a id="a269334f315947dd9abf207add59a5ca7"></a> (GtkStyle *)&#160;</td><td class="memItemRight" valign="bottom">+ <b>getDefaultStyle</b></td></tr> <tr class="separator:a269334f315947dd9abf207add59a5ca7 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a89e1556f7e47fd5dce259cb30360b789 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top"><a id="a89e1556f7e47fd5dce259cb30360b789"></a> (void)&#160;</td><td class="memItemRight" valign="bottom">+ <b>popCompositeChild</b></td></tr> <tr class="separator:a89e1556f7e47fd5dce259cb30360b789 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ca397ec9ebb220659a04c0a4db9aab4 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top"><a id="a6ca397ec9ebb220659a04c0a4db9aab4"></a> (void)&#160;</td><td class="memItemRight" valign="bottom">+ <b>pushCompositeChild</b></td></tr> <tr class="separator:a6ca397ec9ebb220659a04c0a4db9aab4 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a880634844ada752e696c721afa52f055 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memItemLeft" align="right" valign="top"><a id="a880634844ada752e696c721afa52f055"></a> (void)&#160;</td><td class="memItemRight" valign="bottom">+ <b>setDefaultDirection:</b></td></tr> <tr class="separator:a880634844ada752e696c721afa52f055 inherit pub_static_methods_interface_c_g_t_k_widget"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_static_methods_interface_c_g_t_k_base"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_interface_c_g_t_k_base')"><img src="closed.png" alt="-"/>&#160;Class Methods inherited from <a class="el" href="interface_c_g_t_k_base.html">CGTKBase</a></td></tr> <tr class="memitem:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interface_c_g_t_k_base"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interface_c_g_t_k_base.html">CGTKBase</a> *)&#160;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="interface_c_g_t_k_base.html#a804322c9fb01b3873c9fd6d12f1f64a3">withGObject:</a></td></tr> <tr class="separator:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interface_c_g_t_k_base"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_attribs_interface_c_g_t_k_base"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_interface_c_g_t_k_base')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="interface_c_g_t_k_base.html">CGTKBase</a></td></tr> <tr class="memitem:aa36b03af85146ac8863d9785c4648e42 inherit pro_attribs_interface_c_g_t_k_base"><td class="memItemLeft" align="right" valign="top">GObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_c_g_t_k_base.html#aa36b03af85146ac8863d9785c4648e42">__gObject</a></td></tr> <tr class="separator:aa36b03af85146ac8863d9785c4648e42 inherit pro_attribs_interface_c_g_t_k_base"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8h_source.html#l00034">34</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8h_source.html">CGTKCheckMenuItem.h</a>.</p> </div><h2 class="groupheader">Method Documentation</h2> <a id="a1d73ffcc8da744cda0c06a40b80388a2"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1d73ffcc8da744cda0c06a40b80388a2">&#9670;&nbsp;</a></span>CHECKMENUITEM()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (GtkCheckMenuItem *) CHECKMENUITEM </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Methods </p> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00072">72</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="af9f8548342fc5b2afdebb7f49655137d"></a> <h2 class="memtitle"><span class="permalink"><a href="#af9f8548342fc5b2afdebb7f49655137d">&#9670;&nbsp;</a></span>getActive()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (BOOL) getActive </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(BOOL*)getActive;</p> <dl class="section return"><dt>Returns</dt><dd>BOOL </dd></dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00077">77</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="aa03299bba722d527f296df672564ea1b"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa03299bba722d527f296df672564ea1b">&#9670;&nbsp;</a></span>getDrawAsRadio()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (BOOL) getDrawAsRadio </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(BOOL*)getDrawAsRadio;</p> <dl class="section return"><dt>Returns</dt><dd>BOOL </dd></dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00082">82</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="abd7047821ba61a0dbbab76588b29d301"></a> <h2 class="memtitle"><span class="permalink"><a href="#abd7047821ba61a0dbbab76588b29d301">&#9670;&nbsp;</a></span>getInconsistent()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (BOOL) getInconsistent </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(BOOL*)getInconsistent;</p> <dl class="section return"><dt>Returns</dt><dd>BOOL </dd></dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00087">87</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="a9e506760de8fb4192282a1ccb98e79b7"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9e506760de8fb4192282a1ccb98e79b7">&#9670;&nbsp;</a></span>init()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (id) init </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Constructors </p> <p>Reimplemented from <a class="el" href="interface_c_g_t_k_menu_item.html#a40617f4793b852cc6968438660e7ae4a">CGTKMenuItem</a>.</p> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00036">36</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="a4cc9e1d596fae3c8039a996ac2d81e2f"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4cc9e1d596fae3c8039a996ac2d81e2f">&#9670;&nbsp;</a></span>setActive:()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (void) setActive: </td> <td></td> <td class="paramtype">(BOOL)&#160;</td> <td class="paramname"><em>isActive</em></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(void*)<a class="el" href="interface_c_g_t_k_check_menu_item.html#a4cc9e1d596fae3c8039a996ac2d81e2f">setActive:</a> isActive;</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">isActive</td><td></td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00092">92</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="a50d685dc2e5f6000e5b2541603291632"></a> <h2 class="memtitle"><span class="permalink"><a href="#a50d685dc2e5f6000e5b2541603291632">&#9670;&nbsp;</a></span>setDrawAsRadio:()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (void) setDrawAsRadio: </td> <td></td> <td class="paramtype">(BOOL)&#160;</td> <td class="paramname"><em>drawAsRadio</em></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(void*)<a class="el" href="interface_c_g_t_k_check_menu_item.html#a50d685dc2e5f6000e5b2541603291632">setDrawAsRadio:</a> drawAsRadio;</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">drawAsRadio</td><td></td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00097">97</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="a05bac03c2a25788e45bd79e3e7f732e8"></a> <h2 class="memtitle"><span class="permalink"><a href="#a05bac03c2a25788e45bd79e3e7f732e8">&#9670;&nbsp;</a></span>setInconsistent:()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (void) setInconsistent: </td> <td></td> <td class="paramtype">(BOOL)&#160;</td> <td class="paramname"><em>setting</em></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(void*)<a class="el" href="interface_c_g_t_k_check_menu_item.html#a05bac03c2a25788e45bd79e3e7f732e8">setInconsistent:</a> setting;</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">setting</td><td></td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00102">102</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <a id="acdaae9c7934c383139263c6ad174bfd1"></a> <h2 class="memtitle"><span class="permalink"><a href="#acdaae9c7934c383139263c6ad174bfd1">&#9670;&nbsp;</a></span>toggled()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">- (void) toggled </td> <td></td> <td class="paramname"></td> <td></td> </tr> </table> </div><div class="memdoc"> <p>-(void*)toggled; </p> <p class="definition">Definition at line <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html#l00107">107</a> of file <a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="_c_g_t_k_check_menu_item_8h_source.html">CGTKCheckMenuItem.h</a></li> <li><a class="el" href="_c_g_t_k_check_menu_item_8m_source.html">CGTKCheckMenuItem.m</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="interface_c_g_t_k_check_menu_item.html">CGTKCheckMenuItem</a></li> <li class="footer">Generated on Sat Nov 4 2017 23:51:10 for CoreGTK by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html>
coregtk/coregtk
docs/html/interface_c_g_t_k_check_menu_item.html
HTML
lgpl-2.1
179,864
// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Gst.Rtp { using System; using System.Runtime.InteropServices; #region Autogenerated code [Flags] [GLib.GType (typeof (Gst.Rtp.RTPBufferFlagsGType))] public enum RTPBufferFlags { Retransmission = 1048576, Redundant = 2097152, Last = 268435456, } internal class RTPBufferFlagsGType { [DllImport ("libgstrtp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gst_rtp_buffer_flags_get_type (); public static GLib.GType GType { get { return new GLib.GType (gst_rtp_buffer_flags_get_type ()); } } } #endregion }
GStreamer/gstreamer-sharp
sources/generated/Gst.Rtp/RTPBufferFlags.cs
C#
lgpl-2.1
686
<!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:22 CST 2016 --> <title>LobHelper (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="LobHelper (Hibernate JavaDocs)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":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/LobHelper.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/LazyInitializationException.html" title="class in org.hibernate"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../org/hibernate/LockMode.html" title="enum in org.hibernate"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?org/hibernate/LobHelper.html" target="_top">Frames</a></li> <li><a href="LobHelper.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</div> <h2 title="Interface LobHelper" class="title">Interface LobHelper</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel">LobHelper</span></pre> <div class="block">A <a href="../../org/hibernate/Session.html" title="interface in org.hibernate"><code>session's</code></a> helper for creating LOB data.</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/sql/Blob.html?is-external=true" title="class or interface in java.sql">Blob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createBlob-byte:A-">createBlob</a></span>(byte[]&nbsp;bytes)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql"><code>Blob</code></a> from bytes.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql">Blob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createBlob-java.io.InputStream-long-">createBlob</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream, long&nbsp;length)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql"><code>Blob</code></a> from stream data.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createClob-java.io.Reader-long-">createClob</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;reader, long&nbsp;length)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a> from character reader.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createClob-java.lang.String-">createClob</a></span>(<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;string)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a> from content.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql">NClob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createNClob-java.io.Reader-long-">createNClob</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;reader, long&nbsp;length)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</code></a> from character reader.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql">NClob</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/hibernate/LobHelper.html#createNClob-java.lang.String-">createNClob</a></span>(<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;string)</code> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</code></a> from content.</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="createBlob-byte:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createBlob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql">Blob</a>&nbsp;createBlob(byte[]&nbsp;bytes)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql"><code>Blob</code></a> from bytes.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bytes</code> - a byte array</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the created Blob</dd> </dl> </li> </ul> <a name="createBlob-java.io.InputStream-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createBlob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql">Blob</a>&nbsp;createBlob(<a href="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;stream, long&nbsp;length)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Blob.html?is-external=true" title="class or interface in java.sql"><code>Blob</code></a> from stream data.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>stream</code> - a binary stream</dd> <dd><code>length</code> - the number of bytes in the stream</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the create Blob</dd> </dl> </li> </ul> <a name="createClob-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createClob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</a>&nbsp;createClob(<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;string)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a> from content.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>string</code> - The string data</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The created <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a></dd> </dl> </li> </ul> <a name="createClob-java.io.Reader-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createClob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</a>&nbsp;createClob(<a href="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;reader, long&nbsp;length)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a> from character reader.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>reader</code> - a character stream</dd> <dd><code>length</code> - the number of characters in the stream</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The created <a href="http://download.oracle.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql"><code>Clob</code></a></dd> </dl> </li> </ul> <a name="createNClob-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createNClob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql">NClob</a>&nbsp;createNClob(<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;string)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</code></a> from content.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>string</code> - The string data</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The created <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</code></a></dd> </dl> </li> </ul> <a name="createNClob-java.io.Reader-long-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>createNClob</h4> <pre><a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql">NClob</a>&nbsp;createNClob(<a href="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a>&nbsp;reader, long&nbsp;length)</pre> <div class="block">Create a new <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</code></a> from character reader.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>reader</code> - a character stream</dd> <dd><code>length</code> - the number of characters in the stream</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The created <a href="http://download.oracle.com/javase/6/docs/api/java/sql/NClob.html?is-external=true" title="class or interface in java.sql"><code>NClob</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/LobHelper.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/LazyInitializationException.html" title="class in org.hibernate"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../org/hibernate/LockMode.html" title="enum in org.hibernate"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?org/hibernate/LobHelper.html" target="_top">Frames</a></li> <li><a href="LobHelper.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/LobHelper.html
HTML
lgpl-2.1
17,494
#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. THEDIR=`pwd` cd $srcdir DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have autoconf installed to compile libvirt-qmf." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/autoconf" DIE=1 } (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed to compile libvirt-qmf." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" DIE=1 } (automake --version) < /dev/null > /dev/null 2>&1 || { echo DIE=1 echo "You must have automake installed to compile libvirt-qmf." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/automake" } if test "$DIE" -eq 1; then exit 1 fi test -f src/NodeWrap.cpp || { echo "You must run this script in the top-level libvirt-qmf directory" exit 1 } if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " echo "to pass any to it, please specify them on the $0 command line." fi #rm -rf m4 libtoolize --copy --force aclocal autoheader automake --add-missing --foreign autoconf cd $THEDIR if test x$OBJ_DIR != x; then mkdir -p "$OBJ_DIR" cd "$OBJ_DIR" fi $srcdir/configure "$@" && { echo echo "Now type 'make' to compile libvirt-qmf." }
zaneb/libvirt-qmf
autogen.sh
Shell
lgpl-2.1
1,506
<?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" /> <!-- qdeclarativepath.cpp --> <title>Qt 4.8: List of All Members for PathPercent</title> <link rel="stylesheet" type="text/css" href="style/offline.css" /> </head> <body> <div class="header" id="qtdocheader"> <div class="content"> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> </div> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="qdeclarativeelements.html">QML Elements</a></li> <li>List of All Members for PathPercent</li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">List of All Members for PathPercent</h1> <p>This is the complete list of members for <a href="qml-pathpercent.html">QML PathPercent Element</a>, including inherited members.</p> <ul> <li class="fn"><span class="name"><b><a href="qml-pathpercent.html#value-prop">value</a></b></span></li> </ul> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2008-2011 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> </body> </html>
kobolabs/qt-everywhere-4.8.0
doc/html/qml-pathpercent-members.html
HTML
lgpl-2.1
2,276
/** * Peers * Copyright 2012 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany * First released 21.09.2012 at http://yacy.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program in the file lgpl21.txt * If not, see <http://www.gnu.org/licenses/>. */ package net.yacy.cora.federate.yacy; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; import java.util.TreeMap; import net.yacy.cora.federate.yacy.api.Network; import net.yacy.cora.order.Base64Order; import net.yacy.cora.protocol.http.HTTPClient; import net.yacy.cora.util.ConcurrentLog; import yacy.kelondro.util.ASCII; public class Peers extends TreeMap<byte[], Peer> implements Serializable { private final static ConcurrentLog log = new ConcurrentLog(Peers.class.getName()); private static final long serialVersionUID = -2939656606305545080L; private long lastBootstrap; public Peers() { super(Base64Order.enhancedCoder); this.lastBootstrap = 0; } /** * refresh() gets a new network list from one random remote peer once every * minute. This method will load a remote list not more then every one minute * and if it does, it is done concurrently. Therefore this method can be called * every time when a process needs specific remote peers. */ public void refresh() { if (System.currentTimeMillis() - this.lastBootstrap < 60000) return; lastBootstrap = System.currentTimeMillis(); new Thread() { @Override public void run() { String[] peers = bootstrapList(select(false, false)); bootstrap(peers, 1); } }.start(); } /** * this method must be called once to bootstrap a list of network peers. * To do this, a default list of peers must be given. * @param peers a list of known peers * @param selection number of peers which are taken from the given list of peers for bootstraping */ public void bootstrap(final String[] peers, int selection) { int loops = 0; while (this.size() == 0 || loops++ == 0) { if (selection > peers.length) selection = peers.length; Set<Integer> s = new HashSet<Integer>(); Random r = new Random(System.currentTimeMillis()); while (s.size() < selection) s.add(r.nextInt(peers.length)); List<Thread> t = new ArrayList<Thread>(); for (Integer pn: s) { final String bp = peers[pn.intValue()]; Thread t0 = new Thread() { @Override public void run() { Peers ps; try { ps = Network.getNetwork(bp); int c0 = Peers.this.size(); for (Peer p: ps.values()) Peers.this.add(p); int c1 = Peers.this.size(); log.info("bootstrap with peer " + bp + ": added " + (c1 - c0) + " peers"); } catch (final IOException e) { log.info("bootstrap with peer " + bp + ": FAILED - " + e.getMessage()); } } }; t0.start(); t.add(t0); } for (Thread t0: t) try {t0.join(10000);} catch (final InterruptedException e) {} } lastBootstrap = System.currentTimeMillis(); log.info("bootstrap finished: " + this.size() + " peers"); } /** * add a new peer to the list of peers * @param peer */ public synchronized void add(Peer peer) { String hash = peer.get(Peer.Schema.hash); if (hash == null) return; Peer p = this.put(ASCII.getBytes(hash), peer); if (p == null) return; if (p.lastseenTime() < peer.lastseenTime()) this.put(ASCII.getBytes(hash), p); } /** * get a peer using the peer hash * @param hash * @return */ public synchronized Peer get(String hash) { return super.get(ASCII.getBytes(hash)); } /** * select a list of peers according to special needs. The require parameters are combined as conjunction * @param requireNode must be true to select only peers which are node peers * @param requireSolr must be true to select only peers which support the solr interface * @return */ public synchronized List<Peer> select(final boolean requireNode, final boolean requireSolr) { List<Peer> l = new ArrayList<Peer>(); for (Peer p: this.values()) { if (requireNode && !p.get(Peer.Schema.nodestate).equals("1")) continue; if (requireSolr && !p.supportsSolr()) continue; l.add(p); } return l; } /** * convenient method to produce a list of bootstrap peer addresses from given peer lists * @param peers * @return */ public static synchronized String[] bootstrapList(List<Peer> peers) { List<String> l = new ArrayList<String>(); for (Peer p: peers) l.add(p.get(Peer.Schema.address)); return l.toArray(new String[l.size()]); } public static void main(String[] args) { final String[] bootstrapPeers = new String[]{ "search.yacy.net", "yacy.dyndns.org:8000", "yacy-websuche.mxchange.org:8090", "sokrates.homeunix.net:6070", "sokrates.homeunix.net:9090", "141.52.175.27:8080", "62.75.214.113:8080", "141.52.175.30:8080"}; Peers peers = new Peers(); peers.bootstrap(bootstrapPeers, 4); //Peers peers = Network.getNetwork("sokrates.homeunix.net:9090"); /* for (Peer p: peers.values()) { log.info(p.get(Peer.Schema.fullname) + " - " + p.get(Peer.Schema.address)); } */ List<Peer> nodes = peers.select(false, true); for (Peer p: nodes) { log.info(p.get(Peer.Schema.fullname) + " - " + p.get(Peer.Schema.address)); } try {HTTPClient.closeConnectionManager();} catch (final InterruptedException e) {} } }
automenta/kelondro
src/main/java/yacy/cora/federate/yacy/Peers.java
Java
lgpl-2.1
6,900
package soot.coffi; /*- * #%L * Soot - a J*va Optimization Framework * %% * Copyright (C) 2005 Jennifer 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% */ /** * There should be at most one RuntimeVisibleAnnotations attribute in every method, field and class indicating the list of * annotations. * * @see attribute_info * @see method_info#attributes, @see field_info#attributes, * @see coffi_class#attributes * @author Jennifer Lhotak */ public class RuntimeVisibleAnnotations_attribute extends attribute_info { /** Length of annotations table array. */ public int number_of_annotations; /** * Each entry represents a single runtime visible annotation. */ public annotation annotations[]; }
plast-lab/soot
src/main/java/soot/coffi/RuntimeVisibleAnnotations_attribute.java
Java
lgpl-2.1
1,379
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** 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. ** **************************************************************************/ #include "qmlanchors.h" #include "variantproperty.h" #include "bindingproperty.h" #include "nodeabstractproperty.h" #include "nodeinstance.h" #include "rewritertransaction.h" #include "qmlmodelview.h" #include "mathutils.h" namespace QmlDesigner { static QString lineTypeToString(AnchorLine::Type lineType) { QString typeString; switch (lineType) { case AnchorLine::Left: return QLatin1String("left"); case AnchorLine::Top: return QLatin1String("top"); case AnchorLine::Right: return QLatin1String("right"); case AnchorLine::Bottom: return QLatin1String("bottom"); case AnchorLine::HorizontalCenter: return QLatin1String("horizontalCenter"); case AnchorLine::VerticalCenter: return QLatin1String("verticalCenter"); case AnchorLine::Baseline: return QLatin1String("baseline"); case AnchorLine::Fill: return QLatin1String("fill"); case AnchorLine::Center: return QLatin1String("centerIn"); default: return QString(); } } bool AnchorLine::isHorizontalAnchorLine(Type anchorline) { return anchorline & HorizontalMask; } bool AnchorLine::isVerticalAnchorLine(Type anchorline) { return anchorline & VerticalMask; } static AnchorLine::Type propertyNameToLineType(const QString & string) { if (string == QLatin1String("left")) { return AnchorLine::Left; } else if (string == QLatin1String("top")) { return AnchorLine::Top; } else if (string == QLatin1String("right")) { return AnchorLine::Right; } else if (string == QLatin1String("bottom")) { return AnchorLine::Bottom; } else if (string == QLatin1String("horizontalCenter")) { return AnchorLine::HorizontalCenter; } else if (string == QLatin1String("verticalCenter")) { return AnchorLine::VerticalCenter; } else if (string == QLatin1String("baseline")) { return AnchorLine::VerticalCenter; } else if (string == QLatin1String("centerIn")) { return AnchorLine::Center; } else if (string == QLatin1String("fill")) { return AnchorLine::Fill; } return AnchorLine::Invalid; } static QString marginPropertyName(AnchorLine::Type lineType) { switch (lineType) { case AnchorLine::Left: return QLatin1String("anchors.leftMargin"); case AnchorLine::Top: return QLatin1String("anchors.topMargin"); case AnchorLine::Right: return QLatin1String("anchors.rightMargin"); case AnchorLine::Bottom: return QLatin1String("anchors.bottomMargin"); case AnchorLine::HorizontalCenter: return QLatin1String("anchors.horizontalCenterOffset"); case AnchorLine::VerticalCenter: return QLatin1String("anchors.verticalCenterOffset"); default: return QString(); } } static QString anchorPropertyName(AnchorLine::Type lineType) { const QString typeString = lineTypeToString(lineType); if (typeString.isEmpty()) return QString(); else return QString("anchors.%1").arg(typeString); } QmlAnchors::QmlAnchors(const QmlItemNode &fxItemNode) : m_qmlItemNode(fxItemNode) { } QmlItemNode QmlAnchors::qmlItemNode() const { return m_qmlItemNode; } bool QmlAnchors::isValid() const { return m_qmlItemNode.isValid(); } void QmlAnchors::beautify() { if ((instanceHasAnchor(AnchorLine::Left) && instanceHasAnchor(AnchorLine::Right) && instanceHasAnchor(AnchorLine::Top) && instanceHasAnchor(AnchorLine::Bottom)) && (instanceAnchor(AnchorLine::Left).type() == AnchorLine::Left && instanceAnchor(AnchorLine::Right).type() == AnchorLine::Right && instanceAnchor(AnchorLine::Top).type() == AnchorLine::Top && instanceAnchor(AnchorLine::Bottom).type() == AnchorLine::Bottom) && (instanceAnchor(AnchorLine::Left).qmlItemNode() == instanceAnchor(AnchorLine::Right).qmlItemNode() && instanceAnchor(AnchorLine::Top).qmlItemNode() == instanceAnchor(AnchorLine::Bottom).qmlItemNode()) && (instanceAnchor(AnchorLine::Left).qmlItemNode() == instanceAnchor(AnchorLine::Bottom).qmlItemNode())) { if (instanceHasAnchor(AnchorLine::Fill)) return; //avoid recursion QmlItemNode targetNode(instanceAnchor(AnchorLine::Left).qmlItemNode()); removeAnchors(); setAnchor(AnchorLine::Fill, targetNode, AnchorLine::Fill); } if ((instanceHasAnchor(AnchorLine::VerticalCenter) && instanceHasAnchor(AnchorLine::HorizontalCenter)) && (instanceAnchor(AnchorLine::VerticalCenter).type() == AnchorLine::VerticalCenter && instanceAnchor(AnchorLine::HorizontalCenter).type() == AnchorLine::HorizontalCenter) && (instanceAnchor(AnchorLine::VerticalCenter).qmlItemNode() == instanceAnchor(AnchorLine::HorizontalCenter).qmlItemNode())) { if (instanceHasAnchor(AnchorLine::Center)) return; //avoid recursion QmlItemNode targetNode(instanceAnchor(AnchorLine::VerticalCenter).qmlItemNode()); removeAnchors(); setAnchor(AnchorLine::Center, targetNode, AnchorLine::Center); } } void QmlAnchors::setAnchor(AnchorLine::Type sourceAnchorLine, const QmlItemNode &targetQmlItemNode, AnchorLine::Type targetAnchorLine) { RewriterTransaction transaction = qmlItemNode().qmlModelView()->beginRewriterTransaction(); if (qmlItemNode().isInBaseState()) { if ((qmlItemNode().nodeInstance().hasAnchor("anchors.fill") && (sourceAnchorLine & AnchorLine::Fill)) || ((qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn") && (sourceAnchorLine & AnchorLine::Center)))) { removeAnchor(sourceAnchorLine); } const QString propertyName = anchorPropertyName(sourceAnchorLine); QString targetExpression = targetQmlItemNode.modelNode().validId(); if (targetQmlItemNode.modelNode() == qmlItemNode().modelNode().parentProperty().parentModelNode()) targetExpression = "parent"; if (sourceAnchorLine != AnchorLine::Center && sourceAnchorLine != AnchorLine::Fill) targetExpression = targetExpression + QLatin1Char('.') + lineTypeToString(targetAnchorLine); qmlItemNode().modelNode().bindingProperty(propertyName).setExpression(targetExpression); } beautify(); } bool detectHorizontalCycle(const ModelNode &node, QList<ModelNode> knownNodeList) { if (knownNodeList.contains(node)) return true; knownNodeList.append(node); static QStringList validAnchorLines(QStringList() << "right" << "left" << "horizontalCenter"); static QStringList anchorNames(QStringList() << "anchors.right" << "anchors.left" << "anchors.horizontalCenter"); foreach (const QString &anchorName, anchorNames) { if (node.hasBindingProperty(anchorName)) { AbstractProperty targetProperty = node.bindingProperty(anchorName).resolveToProperty(); if (targetProperty.isValid()) { if (!validAnchorLines.contains(targetProperty.name())) return true; if (detectHorizontalCycle(targetProperty.parentModelNode(), knownNodeList)) return true; } } } static QStringList anchorShortcutNames(QStringList() << "anchors.fill" << "anchors.centerIn"); foreach (const QString &anchorName, anchorShortcutNames) { if (node.hasBindingProperty(anchorName)) { ModelNode targetNode = node.bindingProperty(anchorName).resolveToModelNode(); if (targetNode.isValid() && detectHorizontalCycle(targetNode, knownNodeList)) return true; } } return false; } bool detectVerticalCycle(const ModelNode &node, QList<ModelNode> knownNodeList) { if (!node.isValid()) return false; if (knownNodeList.contains(node)) return true; knownNodeList.append(node); static QStringList validAnchorLines(QStringList() << "top" << "bottom" << "verticalCenter" << "baseline"); static QStringList anchorNames(QStringList() << "anchors.top" << "anchors.bottom" << "anchors.verticalCenter" << "anchors.baseline"); foreach (const QString &anchorName, anchorNames) { if (node.hasBindingProperty(anchorName)) { AbstractProperty targetProperty = node.bindingProperty(anchorName).resolveToProperty(); if (targetProperty.isValid()) { if (!validAnchorLines.contains(targetProperty.name())) return true; if (detectVerticalCycle(targetProperty.parentModelNode(), knownNodeList)) return true; } } } static QStringList anchorShortcutNames(QStringList() << "anchors.fill" << "anchors.centerIn"); foreach (const QString &anchorName, anchorShortcutNames) { if (node.hasBindingProperty(anchorName)) { ModelNode targetNode = node.bindingProperty(anchorName).resolveToModelNode(); if (targetNode.isValid() && detectVerticalCycle(targetNode, knownNodeList)) return true; } } return false; } bool QmlAnchors::canAnchor(const QmlItemNode &targetModelNode) const { if (!qmlItemNode().isInBaseState()) return false; if (targetModelNode == qmlItemNode().instanceParent()) return true; if (qmlItemNode().instanceParent() == targetModelNode.instanceParent()) return true; return false; } AnchorLine::Type QmlAnchors::possibleAnchorLines(AnchorLine::Type sourceAnchorLineType, const QmlItemNode &targetQmlItemNode) const { if (!canAnchor(targetQmlItemNode)) return AnchorLine::Invalid; if (AnchorLine::isHorizontalAnchorLine(sourceAnchorLineType)) { if (!detectHorizontalCycle(targetQmlItemNode, QList<ModelNode>() << qmlItemNode().modelNode())) return AnchorLine::HorizontalMask; } if (AnchorLine::isVerticalAnchorLine(sourceAnchorLineType)) { if (!detectVerticalCycle(targetQmlItemNode, QList<ModelNode>() << qmlItemNode().modelNode())) return AnchorLine::VerticalMask; } return AnchorLine::Invalid; } AnchorLine QmlAnchors::instanceAnchor(AnchorLine::Type sourceAnchorLine) const { QPair<QString, NodeInstance> targetAnchorLinePair; if (qmlItemNode().nodeInstance().hasAnchor("anchors.fill") && (sourceAnchorLine & AnchorLine::Fill)) { targetAnchorLinePair = qmlItemNode().nodeInstance().anchor("anchors.fill"); targetAnchorLinePair.first = lineTypeToString(sourceAnchorLine); } else if (qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn") && (sourceAnchorLine & AnchorLine::Center)) { targetAnchorLinePair = qmlItemNode().nodeInstance().anchor("anchors.centerIn"); targetAnchorLinePair.first = lineTypeToString(sourceAnchorLine); } else { targetAnchorLinePair = qmlItemNode().nodeInstance().anchor(anchorPropertyName(sourceAnchorLine)); } AnchorLine::Type targetAnchorLine = propertyNameToLineType(targetAnchorLinePair.first); if (targetAnchorLine == AnchorLine::Invalid ) return AnchorLine(); Q_ASSERT(targetAnchorLinePair.second.isValid()); return AnchorLine(QmlItemNode(qmlItemNode().nodeForInstance(targetAnchorLinePair.second)), targetAnchorLine); } void QmlAnchors::removeAnchor(AnchorLine::Type sourceAnchorLine) { RewriterTransaction transaction = qmlItemNode().qmlModelView()->beginRewriterTransaction(); if (qmlItemNode().isInBaseState()) { const QString propertyName = anchorPropertyName(sourceAnchorLine); if (qmlItemNode().nodeInstance().hasAnchor("anchors.fill") && (sourceAnchorLine & AnchorLine::Fill)) { qmlItemNode().modelNode().removeProperty("anchors.fill"); qmlItemNode().modelNode().bindingProperty("anchors.top").setExpression("parent.top"); qmlItemNode().modelNode().bindingProperty("anchors.left").setExpression("parent.left"); qmlItemNode().modelNode().bindingProperty("anchors.bottom").setExpression("parent.bottom"); qmlItemNode().modelNode().bindingProperty("anchors.right").setExpression("parent.right"); } else if (qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn") && (sourceAnchorLine & AnchorLine::Center)) { qmlItemNode().modelNode().removeProperty("anchors.centerIn"); qmlItemNode().modelNode().bindingProperty("anchors.horizontalCenter").setExpression("parent.horizontalCenter"); qmlItemNode().modelNode().bindingProperty("anchors.verticalCenter").setExpression("parent.verticalCenter"); } qmlItemNode().modelNode().removeProperty(propertyName); } } void QmlAnchors::removeAnchors() { RewriterTransaction transaction = qmlItemNode().qmlModelView()->beginRewriterTransaction(); if (qmlItemNode().nodeInstance().hasAnchor("anchors.fill")) qmlItemNode().modelNode().removeProperty("anchors.fill"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn")) qmlItemNode().modelNode().removeProperty("anchors.centerIn"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.top")) qmlItemNode().modelNode().removeProperty("anchors.top"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.left")) qmlItemNode().modelNode().removeProperty("anchors.left"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.right")) qmlItemNode().modelNode().removeProperty("anchors.right"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.bottom")) qmlItemNode().modelNode().removeProperty("anchors.bottom"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.horizontalCenter")) qmlItemNode().modelNode().removeProperty("anchors.horizontalCenter"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.verticalCenter")) qmlItemNode().modelNode().removeProperty("anchors.verticalCenter"); if (qmlItemNode().nodeInstance().hasAnchor("anchors.baseline")) qmlItemNode().modelNode().removeProperty("anchors.baseline"); } bool QmlAnchors::instanceHasAnchor(AnchorLine::Type sourceAnchorLine) const { const QString propertyName = anchorPropertyName(sourceAnchorLine); if (sourceAnchorLine & AnchorLine::Fill) return qmlItemNode().nodeInstance().hasAnchor(propertyName) || qmlItemNode().nodeInstance().hasAnchor("anchors.fill"); if (sourceAnchorLine & AnchorLine::Center) return qmlItemNode().nodeInstance().hasAnchor(propertyName) || qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn"); return qmlItemNode().nodeInstance().hasAnchor(propertyName); } bool QmlAnchors::instanceHasAnchors() const { return instanceHasAnchor(AnchorLine::Left) || instanceHasAnchor(AnchorLine::Right) || instanceHasAnchor(AnchorLine::Top) || instanceHasAnchor(AnchorLine::Bottom) || instanceHasAnchor(AnchorLine::HorizontalCenter) || instanceHasAnchor(AnchorLine::VerticalCenter) || instanceHasAnchor(AnchorLine::Baseline); } void QmlAnchors::setMargin(AnchorLine::Type sourceAnchorLineType, double margin) const { QString propertyName = marginPropertyName(sourceAnchorLineType); qmlItemNode().setVariantProperty(propertyName, qRound(margin)); } bool QmlAnchors::instanceHasMargin(AnchorLine::Type sourceAnchorLineType) const { return !qIsNull(instanceMargin(sourceAnchorLineType)); } double QmlAnchors::instanceMargin(AnchorLine::Type sourceAnchorLineType) const { return qmlItemNode().nodeInstance().property(marginPropertyName(sourceAnchorLineType)).toDouble(); } void QmlAnchors::removeMargin(AnchorLine::Type sourceAnchorLineType) { if (qmlItemNode().isInBaseState()) { QString propertyName = marginPropertyName(sourceAnchorLineType); qmlItemNode().modelNode().removeProperty(propertyName); } } void QmlAnchors::removeMargins() { RewriterTransaction transaction = qmlItemNode().qmlModelView()->beginRewriterTransaction(); removeMargin(AnchorLine::Left); removeMargin(AnchorLine::Right); removeMargin(AnchorLine::Top); removeMargin(AnchorLine::Bottom); removeMargin(AnchorLine::HorizontalCenter); removeMargin(AnchorLine::VerticalCenter); } QmlItemNode AnchorLine::qmlItemNode() const { return m_qmlItemNode; } void QmlAnchors::fill() { if (instanceHasAnchors()) removeAnchors(); qmlItemNode().modelNode().bindingProperty("anchors.fill").setExpression("parent"); } void QmlAnchors::centerIn() { if (instanceHasAnchors()) removeAnchors(); qmlItemNode().modelNode().bindingProperty("anchors.centerIn").setExpression("parent"); } } //QmlDesigner
gidlbn/dlbn_02
src/plugins/qmldesigner/designercore/model/qmlanchors.cpp
C++
lgpl-2.1
18,197
package com.brandomine.tech.common.init; import com.brandomine.tech.common.item.ItemMaxPowerExpand; import com.brandomine.tech.common.item.ItemStone; import com.brandomine.tech.common.item.ToolExperiencePickaxe; //import com.brandomine.tech.common.item.ItemEnderCapacitor; //import com.brandomine.tech.common.item.ItemExperiencePickaxe; //import com.brandomine.tech.common.item.ItemPowerPickaxe; //import com.brandomine.tech.common.item.ItemPowerUpRefill; //import com.brandomine.tech.common.item.ItemStoneOfExperience; //import com.brandomine.tech.common.item.ItemWrapper; import com.brandomine.tech.common.lib.Names; import com.brandomine.tech.common.lib.Reference; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemPickaxe; import net.minecraftforge.common.util.EnumHelper; @GameRegistry.ObjectHolder(Reference.MODID) public class ModItems { public static ToolMaterial enumToolMaterialExperience = EnumHelper.addToolMaterial("Experience", 3, 100, 11.0F, 5.0F, 30); public static ToolMaterial enumToolMaterialPower = EnumHelper.addToolMaterial("power", 5, 0, 11.0F, 5.0F, 30); public static ToolExperiencePickaxe toolExperiencePickaxe; public static ItemMaxPowerExpand itemMaxPowerExpand; public static ItemStone itemStone; public static void init(){ toolExperiencePickaxe = new ToolExperiencePickaxe(enumToolMaterialExperience); itemMaxPowerExpand = new ItemMaxPowerExpand(); itemStone = new ItemStone(); } @SideOnly(Side.CLIENT) public static void initModels(){ // itemEnderCapacitor.initModel(); toolExperiencePickaxe.initModel(); itemMaxPowerExpand.initModel(); } }
Brandomine/LevelTech
src/main/java/com/brandomine/tech/common/init/ModItems.java
Java
lgpl-2.1
1,828
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "snapper.h" #include <QDebug> #include <QLineF> #include <QPen> #include <QApplication> #include <limits> #include <qmlanchors.h> #include <utils/algorithm.h> namespace QmlDesigner { Snapper::Snapper() : m_containerFormEditorItem(0), m_transformtionSpaceFormEditorItem(0), m_snappingDistance(5.0) { } void Snapper::updateSnappingLines(const QList<FormEditorItem*> &exceptionList) { if (m_containerFormEditorItem) m_containerFormEditorItem->updateSnappingLines(exceptionList, m_transformtionSpaceFormEditorItem); } void Snapper::updateSnappingLines(FormEditorItem* exceptionItem) { QList<FormEditorItem*> exceptionList; exceptionList.append(exceptionItem); updateSnappingLines(exceptionList); } void Snapper::setContainerFormEditorItem(FormEditorItem *formEditorItem) { m_containerFormEditorItem = formEditorItem; } void Snapper::setTransformtionSpaceFormEditorItem(FormEditorItem *formEditorItem) { m_transformtionSpaceFormEditorItem = formEditorItem; } FormEditorItem *Snapper::transformtionSpaceFormEditorItem() const { return m_transformtionSpaceFormEditorItem; } double Snapper::snappedVerticalOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->leftSnappingLines(), boundingRect.left())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->rightSnappingOffsets(), Qt::Vertical, boundingRect.left(), boundingRect.top(), boundingRect.bottom())); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->rightSnappingLines(), boundingRect.right())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->leftSnappingOffsets(), Qt::Vertical, boundingRect.right(), boundingRect.top(), boundingRect.bottom())); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->verticalCenterSnappingLines(), boundingRect.center().x())); return offset; } double Snapper::snappedHorizontalOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->topSnappingLines(), boundingRect.top())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->bottomSnappingOffsets(), Qt::Horizontal, boundingRect.top(), boundingRect.left(), boundingRect.right())); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->bottomSnappingLines(), boundingRect.bottom())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->topSnappingOffsets(), Qt::Horizontal, boundingRect.bottom(), boundingRect.left(), boundingRect.right())); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->horizontalCenterSnappingLines(), boundingRect.center().y())); return offset; } double Snapper::snapTopOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->topSnappingLines(), boundingRect.top())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->bottomSnappingOffsets(), Qt::Horizontal, boundingRect.top(), boundingRect.left(), boundingRect.right())); return offset; } double Snapper::snapRightOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->rightSnappingLines(), boundingRect.right())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->leftSnappingOffsets(), Qt::Vertical, boundingRect.right(), boundingRect.top(), boundingRect.bottom())); return offset; } double Snapper::snapLeftOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->leftSnappingLines(), boundingRect.left())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->rightSnappingOffsets(), Qt::Vertical, boundingRect.left(), boundingRect.top(), boundingRect.bottom())); return offset; } double Snapper::snapBottomOffset(const QRectF &boundingRect) const { double offset = std::numeric_limits<double>::max(); offset = qMin(offset, snappedOffsetForLines(containerFormEditorItem()->bottomSnappingLines(), boundingRect.bottom())); offset = qMin(offset, snappedOffsetForOffsetLines(containerFormEditorItem()->topSnappingOffsets(), Qt::Horizontal, boundingRect.bottom(), boundingRect.left(), boundingRect.right())); return offset; } QList<QLineF> Snapper::verticalSnappedLines(const QRectF &boundingRect, QList<QRectF> *boundingRects) const { QList<QLineF> lineList = findSnappingLines(containerFormEditorItem()->leftSnappingLines(), Qt::Vertical, boundingRect.left(), boundingRect.top(), boundingRect.bottom(), boundingRects); lineList += findSnappingOffsetLines(containerFormEditorItem()->rightSnappingOffsets(), Qt::Vertical, boundingRect.left(), boundingRect.top(), boundingRect.bottom(), boundingRects); lineList += findSnappingLines(containerFormEditorItem()->rightSnappingLines(), Qt::Vertical, boundingRect.right(), boundingRect.top(), boundingRect.bottom(), boundingRects); lineList += findSnappingOffsetLines(containerFormEditorItem()->leftSnappingOffsets(), Qt::Vertical, boundingRect.right(), boundingRect.top(), boundingRect.bottom(), boundingRects); lineList += findSnappingLines(containerFormEditorItem()->verticalCenterSnappingLines(), Qt::Vertical, boundingRect.center().x(), boundingRect.top(), boundingRect.bottom(), boundingRects); return lineList; } QList<QLineF> Snapper::horizontalSnappedLines(const QRectF &boundingRect, QList<QRectF> *boundingRects) const { QList<QLineF> lineList = findSnappingLines(containerFormEditorItem()->topSnappingLines(), Qt::Horizontal, boundingRect.top(), boundingRect.left(), boundingRect.right()); lineList += findSnappingOffsetLines(containerFormEditorItem()->bottomSnappingOffsets(), Qt::Horizontal, boundingRect.top(), boundingRect.left(), boundingRect.right(), boundingRects); lineList += findSnappingLines(containerFormEditorItem()->bottomSnappingLines(), Qt::Horizontal, boundingRect.bottom(), boundingRect.left(), boundingRect.right(), boundingRects); lineList += findSnappingOffsetLines(containerFormEditorItem()->topSnappingOffsets(), Qt::Horizontal, boundingRect.bottom(), boundingRect.left(), boundingRect.right(), boundingRects); lineList += findSnappingLines(containerFormEditorItem()->horizontalCenterSnappingLines(), Qt::Horizontal, boundingRect.center().y(), boundingRect.left(), boundingRect.right(), boundingRects); return lineList; } FormEditorItem *Snapper::containerFormEditorItem() const { return m_containerFormEditorItem; } QLineF Snapper::createSnapLine(Qt::Orientation orientation, double snapLine, double lowerLimit, double upperLimit, const QRectF &itemRect) const { if (orientation == Qt::Horizontal) { double lowerX(qMin(lowerLimit, double(itemRect.left()))); double upperX(qMax(upperLimit, double(itemRect.right()))); return QLineF(lowerX, snapLine, upperX, snapLine); } else { double lowerY(qMin(lowerLimit, double(itemRect.top()))); double upperY(qMax(upperLimit, double(itemRect.bottom()))); return QLineF(snapLine, lowerY, snapLine, upperY); } } static bool compareLines(double snapLine, double lineToSnap) { // if (qAbs(snapLine - lineToSnap) < 1.0) // return true; // // return false; return qFuzzyCompare(snapLine, lineToSnap); } QList<QLineF> Snapper::findSnappingLines(const SnapLineMap &snappingLineMap, Qt::Orientation orientation, double snapLine, double lowerLimit, double upperLimit, QList<QRectF> *boundingRects) const { QList<QLineF> lineList; SnapLineMapIterator snappingLineIterator(snappingLineMap); while (snappingLineIterator.hasNext()) { snappingLineIterator.next(); if (compareLines(snapLine, snappingLineIterator.key())) { // near distance snapping lines lineList += createSnapLine(orientation, snappingLineIterator.key(), lowerLimit, upperLimit, snappingLineIterator.value().first); if (boundingRects != 0) boundingRects->append(snappingLineIterator.value().first); } } return lineList; } QList<QLineF> Snapper::findSnappingOffsetLines(const SnapLineMap &snappingOffsetMap, Qt::Orientation orientation, double snapLine, double lowerLimit, double upperLimit, QList<QRectF> *boundingRects) const { QList<QLineF> lineList; SnapLineMapIterator snappingOffsetIterator(snappingOffsetMap); while (snappingOffsetIterator.hasNext()) { snappingOffsetIterator.next(); const QRectF &formEditorItemRect(snappingOffsetIterator.value().first); double formEditorItemRectLowerLimit; double formEditorItemRectUpperLimit; if (orientation == Qt::Horizontal) { formEditorItemRectLowerLimit = formEditorItemRect.left(); formEditorItemRectUpperLimit = formEditorItemRect.right(); } else { formEditorItemRectLowerLimit = formEditorItemRect.top(); formEditorItemRectUpperLimit = formEditorItemRect.bottom(); } if (qFuzzyCompare(snapLine, snappingOffsetIterator.key()) && !(lowerLimit > formEditorItemRectUpperLimit || upperLimit < formEditorItemRectLowerLimit)) { lineList += createSnapLine(orientation, snapLine, lowerLimit, upperLimit, formEditorItemRect); if (boundingRects != 0) boundingRects->append(snappingOffsetIterator.value().first); } } return lineList; } double Snapper::snappedOffsetForLines(const SnapLineMap &snappingLineMap, double value) const { QMultiMap<double, double> minimumSnappingLineMap; SnapLineMapIterator snappingLineIterator(snappingLineMap); while (snappingLineIterator.hasNext()) { snappingLineIterator.next(); double snapLine = snappingLineIterator.key(); double offset = value - snapLine; double distance = qAbs(offset); if (distance < snappingDistance()) minimumSnappingLineMap.insert(distance, offset); } if (!minimumSnappingLineMap.isEmpty()) return minimumSnappingLineMap.begin().value(); return std::numeric_limits<double>::max(); } double Snapper::snappedOffsetForOffsetLines(const SnapLineMap &snappingOffsetMap, Qt::Orientation orientation, double value, double lowerLimit, double upperLimit) const { QMultiMap<double, double> minimumSnappingLineMap; SnapLineMapIterator snappingOffsetIterator(snappingOffsetMap); while (snappingOffsetIterator.hasNext()) { snappingOffsetIterator.next(); double snapLine = snappingOffsetIterator.key(); const QRectF &formEditorItemRect(snappingOffsetIterator.value().first); double formEditorItemRectLowerLimit; double formEditorItemRectUpperLimit; if (orientation == Qt::Horizontal) { formEditorItemRectLowerLimit = formEditorItemRect.left(); formEditorItemRectUpperLimit = formEditorItemRect.right(); } else { formEditorItemRectLowerLimit = formEditorItemRect.top(); formEditorItemRectUpperLimit = formEditorItemRect.bottom(); } double offset = value - snapLine; double distance = qAbs(offset); if (distance < snappingDistance() && !(lowerLimit > formEditorItemRectUpperLimit || upperLimit < formEditorItemRectLowerLimit)) { minimumSnappingLineMap.insert(distance, offset); } } if (!minimumSnappingLineMap.isEmpty()) return minimumSnappingLineMap.begin().value(); return std::numeric_limits<double>::max(); } void Snapper::setSnappingDistance(double snappingDistance) { m_snappingDistance = snappingDistance; } double Snapper::snappingDistance() const { return m_snappingDistance; } static QLineF mergedHorizontalLine(const QList<QLineF> &lineList) { if (lineList.count() == 1) return lineList.first(); double minimumX = std::numeric_limits<double>::max(); double maximumX = std::numeric_limits<double>::min(); foreach (const QLineF &line, lineList) { minimumX = qMin(minimumX, double(line.x1())); minimumX = qMin(minimumX, double(line.x2())); maximumX = qMax(maximumX, double(line.x1())); maximumX = qMax(maximumX, double(line.x2())); } double y(lineList.first().y1()); return QLineF(minimumX, y, maximumX, y); } static QLineF mergedVerticalLine(const QList<QLineF> &lineList) { if (lineList.count() == 1) return lineList.first(); double minimumY = std::numeric_limits<double>::max(); double maximumY = std::numeric_limits<double>::min(); foreach (const QLineF &line, lineList) { minimumY = qMin(minimumY, double(line.y1())); minimumY = qMin(minimumY, double(line.y2())); maximumY = qMax(maximumY, double(line.y1())); maximumY = qMax(maximumY, double(line.y2())); } double x(lineList.first().x1()); return QLineF(x, minimumY, x, maximumY); } static QList<QLineF> mergedHorizontalLines(const QList<QLineF> &lineList) { QList<QLineF> mergedLineList; QList<QLineF> sortedLineList(lineList); Utils::sort(sortedLineList, [](const QLineF &firstLine, const QLineF &secondLine) { return firstLine.y1() < secondLine.y2(); }); QList<QLineF> lineWithTheSameY; QListIterator<QLineF> sortedLineListIterator(sortedLineList); while (sortedLineListIterator.hasNext()) { QLineF line = sortedLineListIterator.next(); lineWithTheSameY.append(line); if (sortedLineListIterator.hasNext()) { QLineF nextLine = sortedLineListIterator.peekNext(); if (!qFuzzyCompare(line.y1(), nextLine.y1())) { mergedLineList.append(mergedHorizontalLine(lineWithTheSameY)); lineWithTheSameY.clear(); } } else { mergedLineList.append(mergedHorizontalLine(lineWithTheSameY)); } } return mergedLineList; } static QList<QLineF> mergedVerticalLines(const QList<QLineF> &lineList) { QList<QLineF> mergedLineList; QList<QLineF> sortedLineList(lineList); Utils::sort(sortedLineList, [](const QLineF &firstLine, const QLineF &secondLine) { return firstLine.x1() < secondLine.x2(); }); QList<QLineF> lineWithTheSameX; QListIterator<QLineF> sortedLineListIterator(sortedLineList); while (sortedLineListIterator.hasNext()) { QLineF line = sortedLineListIterator.next(); lineWithTheSameX.append(line); if (sortedLineListIterator.hasNext()) { QLineF nextLine = sortedLineListIterator.peekNext(); if (!qFuzzyCompare(line.x1(), nextLine.x1())) { mergedLineList.append(mergedVerticalLine(lineWithTheSameX)); lineWithTheSameX.clear(); } } else { mergedLineList.append(mergedVerticalLine(lineWithTheSameX)); } } return mergedLineList; } QList<QGraphicsItem*> Snapper::generateSnappingLines(const QRectF &boundingRect, QGraphicsItem *layerItem, const QTransform &transform) { QList<QRectF> boundingRectList; boundingRectList.append(boundingRect); return generateSnappingLines(boundingRectList, layerItem, transform); } static QmlItemNode findItemOnSnappingLine(const QmlItemNode &sourceQmlItemNode, const SnapLineMap &snappingLines, double anchorLine, AnchorLineType anchorLineType) { QmlItemNode targetQmlItemNode; double targetAnchorLine = 0.0; targetAnchorLine = std::numeric_limits<double>::max(); AnchorLineType compareAnchorLineType; if (anchorLineType == AnchorLineLeft || anchorLineType == AnchorLineRight) compareAnchorLineType = AnchorLineTop; else compareAnchorLineType = AnchorLineLeft; SnapLineMapIterator snapLineIterator(snappingLines); while (snapLineIterator.hasNext()) { snapLineIterator.next(); double snapLine = snapLineIterator.key(); if (qAbs(snapLine - anchorLine ) < 1.0) { QmlItemNode possibleAchorItemNode = snapLineIterator.value().second->qmlItemNode(); double currentToAnchorLine = possibleAchorItemNode.anchors().instanceAnchorLine(compareAnchorLineType); if (possibleAchorItemNode != sourceQmlItemNode) { if (sourceQmlItemNode.instanceParent() == possibleAchorItemNode) { targetQmlItemNode = possibleAchorItemNode; targetAnchorLine = currentToAnchorLine; break; } else if (currentToAnchorLine < targetAnchorLine) { targetQmlItemNode = possibleAchorItemNode; targetAnchorLine = currentToAnchorLine; } } } } return targetQmlItemNode; } static void adjustAnchorLine(const QmlItemNode &sourceQmlItemNode, const QmlItemNode &containerQmlItemNode, const SnapLineMap &snappingLines, const SnapLineMap &snappingOffsets, AnchorLineType lineAnchorLineType, AnchorLineType offsetAnchorLineType) { QmlAnchors qmlAnchors = sourceQmlItemNode.anchors(); double fromAnchorLine = sourceQmlItemNode.anchors().instanceAnchorLine(lineAnchorLineType); QmlItemNode targetQmlItemNode = findItemOnSnappingLine(sourceQmlItemNode, snappingLines, fromAnchorLine, lineAnchorLineType); if (targetQmlItemNode.isValid() && !targetQmlItemNode.anchors().checkForCycle(lineAnchorLineType, sourceQmlItemNode)) { double margin = 0.0; QRectF boundingRect = targetQmlItemNode.instanceContentItemBoundingRect(); if (boundingRect.isNull()) boundingRect = targetQmlItemNode.instanceBoundingRect(); if (targetQmlItemNode == containerQmlItemNode) { if (lineAnchorLineType == AnchorLineLeft) margin = fromAnchorLine - boundingRect.left(); else if (lineAnchorLineType == AnchorLineTop) margin = fromAnchorLine - boundingRect.top(); else if (lineAnchorLineType == AnchorLineRight) margin = boundingRect.right() - fromAnchorLine; else if (lineAnchorLineType == AnchorLineBottom) margin = boundingRect.bottom() - fromAnchorLine; } if (!qFuzzyIsNull(margin) || !qFuzzyIsNull(qmlAnchors.instanceMargin(lineAnchorLineType))) qmlAnchors.setMargin(lineAnchorLineType, margin); qmlAnchors.setAnchor(lineAnchorLineType, targetQmlItemNode, lineAnchorLineType); } else if (!snappingOffsets.isEmpty()) { targetQmlItemNode = findItemOnSnappingLine(sourceQmlItemNode, snappingOffsets, fromAnchorLine, lineAnchorLineType); if (targetQmlItemNode.isValid() && !targetQmlItemNode.anchors().checkForCycle(lineAnchorLineType, sourceQmlItemNode)) { double margin = fromAnchorLine - targetQmlItemNode.anchors().instanceAnchorLine(offsetAnchorLineType); if (lineAnchorLineType == AnchorLineRight || lineAnchorLineType == AnchorLineBottom) margin *= -1.; if (!qFuzzyIsNull(margin) || !qFuzzyIsNull(qmlAnchors.instanceMargin(lineAnchorLineType))) qmlAnchors.setMargin(lineAnchorLineType, margin); qmlAnchors.setAnchor(lineAnchorLineType, targetQmlItemNode, offsetAnchorLineType); } } } void Snapper::adjustAnchoringOfItem(FormEditorItem *formEditorItem) { QmlItemNode qmlItemNode = formEditorItem->qmlItemNode(); QmlAnchors qmlAnchors = qmlItemNode.anchors(); if (!qmlAnchors.instanceHasAnchor(AnchorLineHorizontalCenter)) { adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->leftSnappingLines(), containerFormEditorItem()->rightSnappingOffsets(), AnchorLineLeft, AnchorLineRight); } if (!qmlAnchors.instanceHasAnchor(AnchorLineVerticalCenter)) { adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->topSnappingLines(), containerFormEditorItem()->bottomSnappingOffsets(), AnchorLineTop, AnchorLineBottom); adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->bottomSnappingLines(), containerFormEditorItem()->topSnappingOffsets(), AnchorLineBottom, AnchorLineTop); } if (!qmlAnchors.instanceHasAnchor(AnchorLineHorizontalCenter)) { adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->rightSnappingLines(), containerFormEditorItem()->leftSnappingOffsets(), AnchorLineRight, AnchorLineLeft); } if (!qmlAnchors.instanceHasAnchor(AnchorLineLeft) && !qmlAnchors.instanceHasAnchor(AnchorLineRight)) { adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->verticalCenterSnappingLines(), SnapLineMap(), AnchorLineHorizontalCenter, AnchorLineHorizontalCenter); } if (!qmlAnchors.instanceHasAnchor(AnchorLineTop) && !qmlAnchors.instanceHasAnchor(AnchorLineBottom)) { adjustAnchorLine(qmlItemNode, containerFormEditorItem()->qmlItemNode(), containerFormEditorItem()->horizontalCenterSnappingLines(), SnapLineMap(), AnchorLineVerticalCenter, AnchorLineVerticalCenter); } } //static void alignLine(QLineF &line) //{ // line.setP1(QPointF(std::floor(line.p1().x()) + 0.5, // std::floor(line.p1().y()) + 0.5)); // line.setP2(QPointF(std::floor(line.p2().x()) + 0.5, // std::floor(line.p2().y()) + 0.5)); //} QList<QGraphicsItem*> Snapper::generateSnappingLines(const QList<QRectF> &boundingRectList, QGraphicsItem *layerItem, const QTransform &transform) { QList<QGraphicsItem*> graphicsItemList; QList<QLineF> lineList; foreach (const QRectF &boundingRect, boundingRectList) { QList<QRectF> snappedBoundingRectList; lineList += mergedHorizontalLines(horizontalSnappedLines(boundingRect, &snappedBoundingRectList)); lineList += mergedVerticalLines(verticalSnappedLines(boundingRect, &snappedBoundingRectList)); // snappedBoundingRectList.append(boundingRect); // foreach (const QRectF &snappedBoundingRect, snappedBoundingRectList) { // QPolygonF rect = transform.map(snappedBoundingRect); // alignVertices(rect); // QGraphicsPolygonItem * item = new QGraphicsPolygonItem(rect, layerItem); // item->setZValue(20); // QColor brushColor(QApplication::palette().highlight().color()); // QColor brushColor(Qt::gray); // brushColor.setAlphaF(0.25); // QBrush brush(brushColor); // item->setBrush(brush); // item->setPen(Qt::NoPen); // graphicsItemList.append(item); // } } foreach (const QLineF &line, lineList) { QLineF lineInTransformationSpace = transform.map(line); // alignLine(lineInTransformationSpace); QGraphicsLineItem * lineItem = new QGraphicsLineItem(lineInTransformationSpace, layerItem); lineItem->setZValue(40); QPen linePen; // linePen.setStyle(Qt::DashLine); linePen.setColor("#5d2dd7"); lineItem->setPen(linePen); graphicsItemList.append(lineItem); } return graphicsItemList; } }
maui-packages/qt-creator
src/plugins/qmldesigner/components/formeditor/snapper.cpp
C++
lgpl-2.1
31,463
#!/usr/bin/python # -*- coding: utf-8 -*- # Distutils installer for PyJack # Test for Jack2 #---------------------------------------------------# import os if os.path.exists("/usr/local/include/jack/jack.h"): path = "/usr/local/include/jack/jack.h" elif os.path.exists("/usr/include/jack/jack.h"): path = "/usr/include/jack/jack.h" else: print("You don't seem to have the jack headers installed.\nPlease install them first") exit(-1) test = open(path).read() pyjack_macros=[] if ("jack_get_version_string" in test): pyjack_macros+=[('JACK2', '1')] else: pyjack_macros+=[('JACK1', '1')] #----------------------------------------------------# from distutils.core import setup, Extension import numpy.distutils numpy_include_dirs = numpy.distutils.misc_util.get_numpy_include_dirs() setup( name = "pyjack", version = "0.5.1", description = "Python bindings for the Jack Audio Server", author = "Andrew W. Schmeder, falkTX, IOhannes m zmölnig", author_email = "andy@a2hd.com", url = "http://sourceforge.net/projects/py-jack", long_description = '''PyJack is a module written in C which exposes the Jack API to Python. For information about Jack see http://jackaudio.org. This enables a Python program to connect to and interact with pro-audio applications which use the Jack Audio Server''', license = "GNU LGPL2.1", ext_modules = [Extension("jack", ["pyjack.c"], libraries=["jack", "dl"], include_dirs=numpy_include_dirs, define_macros=pyjack_macros, )], )
kylerbrown/pyjack
setup.py
Python
lgpl-2.1
1,661
// -*- Mode: C++; tab-width: 2; -*- // vi: set ts=2: // // $Id: ballAndStickModel.h,v 1.17.18.1 2007/03/25 21:26:05 oliver Exp $ // #ifndef BALL_VIEW_MODELS_BALLANDSTICKMODEL_H #define BALL_VIEW_MODELS_BALLANDSTICKMODEL_H #ifndef BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H # include <BALL/VIEW/MODELS/atomBondModelBaseProcessor.h> #endif #ifndef BALL_KERNEL_ATOM_H #include <BALL/KERNEL/atom.h> #endif namespace BALL { class Atom; namespace VIEW { /** AddBallAndStickModel class. The class AddBallAndStickModel is a model processor that is responsible for creating either a <b>ball and stick</b> model or a <b>stick</b> model. In a ball and stick model the graphical representation of the Atom objects (Sphere objects) have a different radius than the representation of the Bond objects (Tube objects). Otherwise in the stick model the radi of the ball and the stick components are equal. For information about the processor concept see Processor in the BALL documentation. \ingroup ViewModels */ class BALL_VIEW_EXPORT AddBallAndStickModel: public AtomBondModelBaseProcessor { public: BALL_CREATE(AddBallAndStickModel) /** @name Constructors and Destructors */ //@{ /** Default Constructor. Set the appearance to: - set the appearance to ball and stick model - set the ball radius to 0.4 - set the stick radius to 0.2 */ AddBallAndStickModel(); /** Copy constructor. */ AddBallAndStickModel(const AddBallAndStickModel& add_ball_and_stick_model); /** Destructor. */ virtual ~AddBallAndStickModel(); /** Explicit default initialization. Reset the state of this AddBallAndStickModel to: - set the appearance to ball and stick model - set the ball radius to 0.4 - set the stick radius to 0.2 Calls AtomBondModelBaseProcessor::clear. */ virtual void clear(); //@} /** @name Assignment */ //@{ /** Assignment. Calls AtomBondModelBaseProcessor::set. */ void set(const AddBallAndStickModel& add_ball_and_stick_model); /** Assignment operator. Calls set(). */ const AddBallAndStickModel& operator = (const AddBallAndStickModel& processor); //@} /** @name Accessors: inspectors and mutators This methods are used to specify the appearance of the model. This processor can either be used for creating a <b>ball and stick</b> model or a <b>stick</b> model. For the ball-component (the graphical representation of the Atom object) and the stick-component (the graphical representation of the Bond object) different radi can be assigned. */ //@{ /** Change the radius of the ball-component. \param radius the new radius of the ball-component: (<b>radius > 0</b>) \exception OutOfRange thrown if <b>radius <= 0</b> */ void setBallRadius(const float radius) throw(Exception::OutOfRange); /** Inspection of the radius of the ball-component. */ float getBallRadius() const; /** Change the radius of the stick-component. \param radius the new radius of the stick-component: (radius > 0) \exception OutOfRange thrown if radius <= 0 */ void setStickRadius(const float radius) throw(Exception::OutOfRange); /** Inspection of the radius of the stick-component. */ float getStickRadius() const; /** Enable the creation of the ball and stick model. */ void enableBallAndStickModel(); /** Enable the creation of the stick model. */ void enableStickModel(); //@} /** @name Processor specific methods */ //@{ /** Operator () method. This method iterates over each Composite object reachable in the Composite tree. If the composite is of kind Atom than a Sphere is created for that atom, and the atom is inserted with the method insertAtom_(). If the AddBallAndStickModel should create a ball and stick model the radius assigned to the sphere will be the ball radius (see method setBallRadius()); if a stick model should be created than the stick radius is assigned to the sphere (see method setStickRadius()). All atoms inserted with the method insertAtom_() will later used for creating the model of the reachable Bond objects. Those models will be created with the method buildBondModels_(). \param composite the Composite object that will be processed \return Processor::Result the result \exception OutOfMemory thrown if the memory allocation for a Sphere object failed */ virtual Processor::Result operator() (Composite& composite); //@} /** @name Predicates */ //@{ /** Test if create ball and stick model. \return bool true if a ball and stick model should be created, false if stick model */ bool isBallAndStickModel() const; /** Test if create a stick model. \return bool true if a stick model should be created, false if ball and stick model */ bool isStickModel() const; /// bool dashedBondsEnabled() const { return dashed_bonds_;} /// void enableDashedBonds(bool state) { dashed_bonds_ = state;} //@} /** @name debuggers and diagnostics */ //@{ /** Internal value dump. Dump the current state of this AddBallAndStickModel to the output ostream <b>s</b> with dumping depth <b>depth</b>. Calls AtomBondModelBaseProcessor::dump. \param s output stream where to output the state \param depth the dumping depth */ virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; //@} virtual bool createGeometricObjects(); protected: void visualiseBond_(const Bond& bond); virtual void visualiseRings_(); inline void renderStandardBond_(const Bond& bond); inline void renderMultipleBond_(const Bond& bond, Vector3 normal, Vector3 dir); inline void renderDashedBond_(const Bond& bond, Vector3 n) throw(Exception::DivisionByZero); void collectRingBonds_(); Vector3 getSP2Plane_(const Atom& atom, const Bond& bond, const Vector3& dir) const; private: float ball_radius_; float stick_radius_; float special_radius_; bool ball_and_stick_; bool dashed_bonds_; vector<vector<Bond*> > ring_bonds_; }; # ifndef BALL_NO_INLINE_FUNCTIONS # include <BALL/VIEW/MODELS/ballAndStickModel.iC> # endif } // namespace VIEW } // namespace BALL #endif // BALL_VIEW_MODELS_BALLANDSTICKMODEL_H
tkemmer/ball
include/BALL/VIEW/MODELS/ballAndStickModel.h
C
lgpl-2.1
6,522
/* * Copyright (C) 2014 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @addtogroup driver_periph * @{ * * @file * @brief Low-level CPUID driver implementation * * @author Troels Hoffmeyer <troels.d.hoffmeyer@gmail.com> */ #include <string.h> #include "cpu-conf.h" #include "periph/cpuid.h" #define SAMD21_CPUID_WORD0 (*(volatile uint32_t *)0x0080A00C) #define SAMD21_CPUID_WORD1 (*(volatile uint32_t *)0x0080A040) #define SAMD21_CPUID_WORD2 (*(volatile uint32_t *)0x0080A044) #define SAMD21_CPUID_WORD3 (*(volatile uint32_t *)0x0080A048) void cpuid_get(void *id) { uint32_t source_address[] = { SAMD21_CPUID_WORD0, SAMD21_CPUID_WORD1, SAMD21_CPUID_WORD2, SAMD21_CPUID_WORD3}; memcpy(id, (void*) source_address, CPUID_ID_LEN); }
fnack/RIOT
cpu/samd21/periph/cpuid.c
C
lgpl-2.1
1,028
/* usb.c * * Copyright (C) 2001-2004 Mariusz Woloszyn <emsi@ipartners.pl> * Copyright (C) 2003-2011 Marcus Meissner <marcus@jet.franken.de> * Copyright (C) 2006-2007 Linus Walleij <triad@df.lth.se> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #define _BSD_SOURCE #include <config.h> #include "ptp.h" #include "ptp-private.h" #include "ptp-bugs.h" #include <stdlib.h> #include <stdarg.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <gphoto2/gphoto2-library.h> #include <gphoto2/gphoto2-port-log.h> #include <gphoto2/gphoto2-setting.h> #ifdef ENABLE_NLS # include <libintl.h> # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #define CONTEXT_BLOCK_SIZE 100000 #define PTP_CNT_INIT(cnt) {memset(&cnt,0,sizeof(cnt));} /* PTP2_FAST_TIMEOUT: how long (in milliseconds) we should wait for * an URB to come back on an interrupt endpoint */ #define PTP2_FAST_TIMEOUT 100 /* Pack / unpack functions */ #include "ptp-pack.c" /* send / receive functions */ uint16_t ptp_usb_sendreq (PTPParams* params, PTPContainer* req) { int res; PTPUSBBulkContainer usbreq; unsigned long towrite; Camera *camera = ((PTPData *)params->data)->camera; /* build appropriate USB container */ usbreq.length=htod32(PTP_USB_BULK_REQ_LEN- (sizeof(uint32_t)*(5-req->Nparam))); usbreq.type=htod16(PTP_USB_CONTAINER_COMMAND); usbreq.code=htod16(req->Code); usbreq.trans_id=htod32(req->Transaction_ID); usbreq.payload.params.param1=htod32(req->Param1); usbreq.payload.params.param2=htod32(req->Param2); usbreq.payload.params.param3=htod32(req->Param3); usbreq.payload.params.param4=htod32(req->Param4); usbreq.payload.params.param5=htod32(req->Param5); /* send it to responder */ towrite = PTP_USB_BULK_REQ_LEN-(sizeof(uint32_t)*(5-req->Nparam)); res = gp_port_write (camera->port, (char*)&usbreq, towrite); if (res != towrite) { gp_log (GP_LOG_DEBUG, "ptp2/usb_sendreq", "request code 0x%04x sending req result %d", req->Code,res); return PTP_ERROR_IO; } return PTP_RC_OK; } uint16_t ptp_usb_senddata (PTPParams* params, PTPContainer* ptp, uint64_t size, PTPDataHandler *handler ) { uint16_t ret = PTP_RC_OK; int res, wlen, datawlen; PTPUSBBulkContainer usbdata; unsigned long bytes_left_to_transfer, written; Camera *camera = ((PTPData *)params->data)->camera; unsigned char *bytes; int progressid = 0; int usecontext = (size > CONTEXT_BLOCK_SIZE); GPContext *context = ((PTPData *)params->data)->context; /* build appropriate USB container */ usbdata.length = htod32(PTP_USB_BULK_HDR_LEN+size); usbdata.type = htod16(PTP_USB_CONTAINER_DATA); usbdata.code = htod16(ptp->Code); usbdata.trans_id= htod32(ptp->Transaction_ID); if (params->split_header_data) { datawlen = 0; wlen = PTP_USB_BULK_HDR_LEN; } else { unsigned long gotlen; /* For all camera devices. */ datawlen = (size<PTP_USB_BULK_PAYLOAD_LEN_WRITE)?size:PTP_USB_BULK_PAYLOAD_LEN_WRITE; wlen = PTP_USB_BULK_HDR_LEN + datawlen; ret = handler->getfunc(params, handler->priv, datawlen, usbdata.payload.data, &gotlen); if (ret != PTP_RC_OK) return ret; if (gotlen != datawlen) return PTP_RC_GeneralError; } res = gp_port_write (camera->port, (char*)&usbdata, wlen); if (res != wlen) { gp_log (GP_LOG_DEBUG, "ptp2/usb_senddata", "request code 0x%04x sending data error 0x%04x", ptp->Code,ret); return PTP_ERROR_IO; } if (size <= datawlen) { /* nothing more to do */ written = wlen; goto finalize; } if (usecontext) progressid = gp_context_progress_start (context, (size/CONTEXT_BLOCK_SIZE), _("Uploading...")); bytes = malloc (4096); if (!bytes) return PTP_RC_GeneralError; /* if everything OK send the rest */ bytes_left_to_transfer = size-datawlen; ret = PTP_RC_OK; written = 0; while(bytes_left_to_transfer > 0) { unsigned long readlen, toread, oldwritten = written; int res; toread = 4096; if (toread > bytes_left_to_transfer) toread = bytes_left_to_transfer; ret = handler->getfunc (params, handler->priv, toread, bytes, &readlen); if (ret != PTP_RC_OK) break; res = gp_port_write (camera->port, (char*)bytes, readlen); if (res < 0) { ret = PTP_ERROR_IO; break; } bytes_left_to_transfer -= res; written += res; if (usecontext && (oldwritten/CONTEXT_BLOCK_SIZE < written/CONTEXT_BLOCK_SIZE)) gp_context_progress_update (context, progressid, written/CONTEXT_BLOCK_SIZE); #if 0 /* Does not work this way... Hmm. */ if (gp_context_cancel(context) == GP_CONTEXT_FEEDBACK_CANCEL) { ret = ptp_usb_control_cancel_request (params,ptp->Transaction_ID); if (ret == PTP_RC_OK) ret = PTP_ERROR_CANCEL; break; } #endif } if (usecontext) gp_context_progress_stop (context, progressid); free (bytes); finalize: if ((ret == PTP_RC_OK) && ((written % params->maxpacketsize) == 0)) gp_port_write (camera->port, "x", 0); if ((ret!=PTP_RC_OK) && (ret!=PTP_ERROR_CANCEL)) ret = PTP_ERROR_IO; return ret; } static uint16_t ptp_usb_getpacket(PTPParams *params, PTPUSBBulkContainer *packet, unsigned long *rlen) { int tries = 0, result; Camera *camera = ((PTPData *)params->data)->camera; gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getpacket", "getting next ptp packet"); /* read the header and potentially the first data */ if (params->response_packet_size > 0) { gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getpacket", "queuing buffered response packet"); /* If there is a buffered packet, just use it. */ memcpy(packet, params->response_packet, params->response_packet_size); *rlen = params->response_packet_size; free(params->response_packet); params->response_packet = NULL; params->response_packet_size = 0; /* Here this signifies a "virtual read" */ return PTP_RC_OK; } retry: /* A packet should come in a single read always. */ result = gp_port_read (camera->port, (char*)packet, sizeof(*packet)); /* This might be a left over zero-write of the device at the end of the previous transmission */ if (result == 0) result = gp_port_read (camera->port, (char*)packet, sizeof(*packet)); if (result > 0) { *rlen = result; return PTP_RC_OK; } if (result == GP_ERROR_IO_READ) { gp_log (GP_LOG_DEBUG, "ptp2/usbread", "Clearing halt on IN EP and retrying once."); gp_port_usb_clear_halt (camera->port, GP_PORT_USB_ENDPOINT_IN); /* retrying only makes sense if we did not read anything yet */ if ((tries++ < 1) && (result == 0)) goto retry; } return PTP_ERROR_IO; } #define READLEN 64*1024 /* read blob size */ uint16_t ptp_usb_getdata (PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler) { uint16_t ret; PTPUSBBulkContainer usbdata; unsigned char *data; unsigned long bytes_to_read, written, curread, oldsize; Camera *camera = ((PTPData *)params->data)->camera; int usecontext, progressid = 0, tries = 0, res; GPContext *context = ((PTPData *)params->data)->context; gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getdata", "reading data"); PTP_CNT_INIT(usbdata); do { unsigned long len, rlen; ret = ptp_usb_getpacket(params, &usbdata, &rlen); if (ret!=PTP_RC_OK) { ret = PTP_ERROR_IO; break; } if (dtoh16(usbdata.type)!=PTP_USB_CONTAINER_DATA) { /* We might have got a response instead. On error for instance. */ if (dtoh16(usbdata.type) == PTP_USB_CONTAINER_RESPONSE) { params->response_packet = malloc(dtoh32(usbdata.length)); if (!params->response_packet) return PTP_RC_GeneralError; memcpy(params->response_packet, (uint8_t *) &usbdata, dtoh32(usbdata.length)); params->response_packet_size = dtoh32(usbdata.length); ret = PTP_RC_OK; } else { ret = PTP_ERROR_DATA_EXPECTED; } break; } if (dtoh16(usbdata.code)!=ptp->Code) { /* A creative Zen device breaks down here, by leaving out * Code and Transaction ID */ if (MTP_ZEN_BROKEN_HEADER(params)) { gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getdata", "Read broken PTP header (Code is %04x vs %04x), compensating.", dtoh16(usbdata.code), ptp->Code ); usbdata.code = dtoh16(ptp->Code); usbdata.trans_id = htod32(ptp->Transaction_ID); } else { gp_log (GP_LOG_ERROR, "ptp2/ptp_usb_getdata", "Read broken PTP header (Code is %04x vs %04x).", dtoh16(usbdata.code), ptp->Code ); ret = PTP_ERROR_IO; break; } } if (usbdata.length == 0xffffffffU) { unsigned char *data = malloc (PTP_USB_BULK_HS_MAX_PACKET_LEN_READ); if (!data) return PTP_RC_GeneralError; /* Copy first part of data to 'data' */ handler->putfunc( params, handler->priv, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, &written ); /* stuff data directly to passed data handler */ while (1) { unsigned long written; int result = gp_port_read (camera->port, (char*)data, PTP_USB_BULK_HS_MAX_PACKET_LEN_READ); if (result < 0) { free (data); return PTP_ERROR_IO; } handler->putfunc (params, handler->priv, result, data, &written); if (result < PTP_USB_BULK_HS_MAX_PACKET_LEN_READ) break; } free (data); return PTP_RC_OK; } if (rlen > dtoh32(usbdata.length)) { /* * Buffer the surplus response packet if it is >= * PTP_USB_BULK_HDR_LEN * (i.e. it is probably an entire package) * else discard it as erroneous surplus data. * This will even work if more than 2 packets appear * in the same transaction, they will just be handled * iteratively. * * Marcus observed stray bytes on iRiver devices; * these are still discarded. */ unsigned int packlen = dtoh32(usbdata.length); unsigned int surplen = rlen - packlen; if (surplen >= PTP_USB_BULK_HDR_LEN) { params->response_packet = malloc(surplen); if (!params->response_packet) return PTP_RC_GeneralError; memcpy(params->response_packet, (uint8_t *) &usbdata + packlen, surplen); params->response_packet_size = surplen; } else { gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getdata", "read %ld bytes too much, expect problems!", rlen - dtoh32(usbdata.length)); } rlen = packlen; } /* For most PTP devices rlen is 512 == sizeof(usbdata) * here. For MTP devices splitting header and data it might * be 12. */ /* Evaluate full data length. */ len=dtoh32(usbdata.length)-PTP_USB_BULK_HDR_LEN; /* autodetect split header/data MTP devices */ if (dtoh32(usbdata.length) > 12 && (rlen==12)) params->split_header_data = 1; /* Copy first part of data to 'data' */ handler->putfunc( params, handler->priv, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, &written ); /* Is that all of data? */ if (len+PTP_USB_BULK_HDR_LEN<=rlen) break; /* If not read the rest of it. */ retry: oldsize = 0; data = malloc(READLEN); if (!data) return PTP_RC_GeneralError; bytes_to_read = len - (rlen - PTP_USB_BULK_HDR_LEN); usecontext = (bytes_to_read > CONTEXT_BLOCK_SIZE); ret = PTP_RC_OK; if (usecontext) progressid = gp_context_progress_start (context, (bytes_to_read/CONTEXT_BLOCK_SIZE), _("Downloading...")); curread = 0; res = 0; while (bytes_to_read > 0) { unsigned long toread = bytes_to_read; int res; /* read in large blobs. * if smaller than large blob, read all but the last short packet * depending on EP packetsize. */ if (toread > READLEN) toread = READLEN; else if (toread > params->maxpacketsize) toread = toread - (toread % params->maxpacketsize); res = gp_port_read (camera->port, (char*)data, toread); if (res <= 0) { ret = PTP_ERROR_IO; break; } ret = handler->putfunc (params, handler->priv, res, data, &written ); if (ret != PTP_RC_OK) break; if (written != res) { ret = PTP_ERROR_IO; break; } bytes_to_read -= res; curread += res; if (usecontext && (oldsize/CONTEXT_BLOCK_SIZE < curread/CONTEXT_BLOCK_SIZE)) gp_context_progress_update (context, progressid, curread/CONTEXT_BLOCK_SIZE); if (gp_context_cancel(context) == GP_CONTEXT_FEEDBACK_CANCEL) { ret = PTP_ERROR_CANCEL; break; } oldsize = curread; } free (data); if (usecontext) gp_context_progress_stop (context, progressid); if (res == GP_ERROR_IO_READ) { gp_log (GP_LOG_DEBUG, "ptp2/usbread", "Clearing halt on IN EP and retrying once."); gp_port_usb_clear_halt (camera->port, GP_PORT_USB_ENDPOINT_IN); /* retrying only makes sense if we did not read anything yet */ if ((tries++ < 1) && (curread == 0)) goto retry; } if ((ret!=PTP_RC_OK) && (ret!=PTP_ERROR_CANCEL)) { ret = PTP_ERROR_IO; break; } } while (0); if ((ret!=PTP_RC_OK) && (ret!=PTP_ERROR_CANCEL)) { gp_log (GP_LOG_DEBUG, "ptp2/usb_getdata", "request code 0x%04x getting data error 0x%04x", ptp->Code, ret); } return ret; } uint16_t ptp_usb_getresp (PTPParams* params, PTPContainer* resp) { uint16_t ret; unsigned long rlen; PTPUSBBulkContainer usbresp; /*GPContext *context = ((PTPData *)params->data)->context;*/ gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getresp", "reading response"); PTP_CNT_INIT(usbresp); /* read response, it should never be longer than sizeof(usbresp) */ ret = ptp_usb_getpacket(params, &usbresp, &rlen); if (ret!=PTP_RC_OK) { ret = PTP_ERROR_IO; } else if (dtoh16(usbresp.type)!=PTP_USB_CONTAINER_RESPONSE) { ret = PTP_ERROR_RESP_EXPECTED; } else if (dtoh16(usbresp.code)!=resp->Code) { ret = dtoh16(usbresp.code); } if (ret!=PTP_RC_OK) { gp_log (GP_LOG_DEBUG, "ptp2/usb_getresp","request code 0x%04x getting resp error 0x%04x", resp->Code, ret); return ret; } /* build an appropriate PTPContainer */ resp->Code=dtoh16(usbresp.code); resp->SessionID=params->session_id; resp->Transaction_ID=dtoh32(usbresp.trans_id); if (resp->Transaction_ID != params->transaction_id - 1) { if (MTP_ZEN_BROKEN_HEADER(params)) { gp_log (GP_LOG_DEBUG, "ptp2/ptp_usb_getresp", "Read broken PTP header (transid is %08x vs %08x), compensating.", resp->Transaction_ID, params->transaction_id - 1 ); resp->Transaction_ID=params->transaction_id-1; } /* else will be handled by ptp.c as error. */ } resp->Nparam=(rlen-12)/4; resp->Param1=dtoh32(usbresp.payload.params.param1); resp->Param2=dtoh32(usbresp.payload.params.param2); resp->Param3=dtoh32(usbresp.payload.params.param3); resp->Param4=dtoh32(usbresp.payload.params.param4); resp->Param5=dtoh32(usbresp.payload.params.param5); return ret; } /* Event handling functions */ /* PTP Events wait for or check mode */ #define PTP_EVENT_CHECK 0x0000 /* waits for */ #define PTP_EVENT_CHECK_FAST 0x0001 /* checks */ static inline uint16_t ptp_usb_event (PTPParams* params, PTPContainer* event, int wait) { int result, timeout, fasttimeout; unsigned long rlen; PTPUSBEventContainer usbevent; Camera *camera = ((PTPData *)params->data)->camera; if (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) fasttimeout = PTP2_FAST_TIMEOUT*2; else fasttimeout = PTP2_FAST_TIMEOUT; PTP_CNT_INIT(usbevent); if (event==NULL) return PTP_ERROR_BADPARAM; switch(wait) { case PTP_EVENT_CHECK: result = gp_port_check_int (camera->port, (char*)&usbevent, sizeof(usbevent)); if (result <= 0) result = gp_port_check_int (camera->port, (char*)&usbevent, sizeof(usbevent)); break; case PTP_EVENT_CHECK_FAST: gp_port_get_timeout (camera->port, &timeout); gp_port_set_timeout (camera->port, fasttimeout); result = gp_port_check_int (camera->port, (char*)&usbevent, sizeof(usbevent)); if (result <= 0) result = gp_port_check_int (camera->port, (char*)&usbevent, sizeof(usbevent)); gp_port_set_timeout (camera->port, timeout); break; default: return PTP_ERROR_BADPARAM; } if (result < 0) { gp_log (GP_LOG_DEBUG, "ptp2/usb_event", "reading event an error %d occurred", result); if (result == GP_ERROR_TIMEOUT) return PTP_ERROR_TIMEOUT; return PTP_ERROR_IO; } if (result == 0) { gp_log (GP_LOG_DEBUG, "ptp2/usb_event", "reading event an 0 read occurred, assuming timeout."); return PTP_ERROR_TIMEOUT; } rlen = result; if (rlen < 8) { gp_log (GP_LOG_ERROR, "ptp2/usb_event", "reading event an short read of %ld bytes occurred", rlen); return PTP_ERROR_IO; } /* Only do the additional reads for "events". Canon IXUS 2 likes to * send unrelated data. */ if ( (dtoh16(usbevent.type) == PTP_USB_CONTAINER_EVENT) && (dtoh32(usbevent.length) > rlen) ) { gp_log (GP_LOG_DEBUG, "ptp2/usb_event","Canon incremental read (done: %ld, todo: %d)", rlen, dtoh32(usbevent.length)); gp_port_get_timeout (camera->port, &timeout); gp_port_set_timeout (camera->port, PTP2_FAST_TIMEOUT); while (dtoh32(usbevent.length) > rlen) { result = gp_port_check_int (camera->port, ((char*)&usbevent)+rlen, sizeof(usbevent)-rlen); if (result <= 0) break; rlen += result; } gp_port_set_timeout (camera->port, timeout); } /* if we read anything over interrupt endpoint it must be an event */ /* build an appropriate PTPContainer */ event->Nparam = (rlen-12)/4; event->Code = dtoh16(usbevent.code); event->SessionID=params->session_id; event->Transaction_ID=dtoh32(usbevent.trans_id); event->Param1 = dtoh32(usbevent.param1); event->Param2 = dtoh32(usbevent.param2); event->Param3 = dtoh32(usbevent.param3); return PTP_RC_OK; } uint16_t ptp_usb_event_check (PTPParams* params, PTPContainer* event) { return ptp_usb_event (params, event, PTP_EVENT_CHECK_FAST); } uint16_t ptp_usb_event_wait (PTPParams* params, PTPContainer* event) { return ptp_usb_event (params, event, PTP_EVENT_CHECK); } uint16_t ptp_usb_control_get_extended_event_data (PTPParams *params, char *buffer, int *size) { Camera *camera = ((PTPData *)params->data)->camera; int ret; gp_log (GP_LOG_DEBUG, "ptp2/get_extended_event_data", "get event data"); ret = gp_port_usb_msg_class_read (camera->port, 0x65, 0x0000, 0x0000, buffer, *size); if (ret < GP_OK) return PTP_ERROR_IO; *size = ret; gp_log_data ("ptp2/get_extended_event_data", buffer, ret); return PTP_RC_OK; } uint16_t ptp_usb_control_device_reset_request (PTPParams *params) { Camera *camera = ((PTPData *)params->data)->camera; int ret; gp_log (GP_LOG_DEBUG, "ptp2/device_reset_request", "sending reset"); ret = gp_port_usb_msg_class_write (camera->port, 0x66, 0x0000, 0x0000, NULL, 0); if (ret < GP_OK) return PTP_ERROR_IO; return PTP_RC_OK; } uint16_t ptp_usb_control_get_device_status (PTPParams *params, char *buffer, int *size) { Camera *camera = ((PTPData *)params->data)->camera; int ret; ret = gp_port_usb_msg_class_read (camera->port, 0x67, 0x0000, 0x0000, buffer, *size); if (ret < GP_OK) return PTP_ERROR_IO; gp_log_data ("ptp2/get_device_status", buffer, ret); *size = ret; return PTP_RC_OK; } uint16_t ptp_usb_control_cancel_request (PTPParams *params, uint32_t transactionid) { Camera *camera = ((PTPData *)params->data)->camera; int ret; unsigned char buffer[6]; htod16a(&buffer[0],PTP_EC_CancelTransaction); htod32a(&buffer[2],transactionid); ret = gp_port_usb_msg_class_write (camera->port, 0x64, 0x0000, 0x0000, (char*)buffer, sizeof (buffer)); if (ret < GP_OK) return PTP_ERROR_IO; return PTP_RC_OK; }
simonswine/libgphoto2
camlibs/ptp2/usb.c
C
lgpl-2.1
20,180
// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #include "StandardLogSink.h" #include "Logger.h" #include <iostream> #include <iomanip> using namespace std; namespace avg { StandardLogSink::StandardLogSink() { } StandardLogSink::~StandardLogSink() { } void StandardLogSink::logMessage(const tm* pTime, unsigned millis, const category_t& category, severity_t severity, const UTF8String& sMsg) { char timeString[256]; strftime(timeString, sizeof(timeString), "%y-%m-%d %H:%M:%S", pTime); cerr << "[" << timeString << "." << setw(3) << setfill('0') << millis << setw(0) << "]["; cerr << setw(4) << setfill('.') << Logger::severityToString(severity) << "]["; cerr << setw(9) << setfill('.') << category << "] : " << sMsg << endl; cerr.flush(); } }
c-base/libavg
src/base/StandardLogSink.cpp
C++
lgpl-2.1
1,634