本文整理汇总了C++中Binding类的典型用法代码示例。如果您正苦于以下问题:C++ Binding类的具体用法?C++ Binding怎么用?C++ Binding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Binding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: S9xProcessEvents
void
S9xProcessEvents (bool8 block)
{
#ifdef USE_JOYSTICK
JoyEvent event;
Binding binding;
if (S9xGrabJoysticks ())
{
for (int i = 0; gui_config->joystick[i]; i++)
{
while (gui_config->joystick[i]->get_event (&event))
{
binding = Binding (i, event.parameter, 0);
S9xReportButton (binding.hex (), event.state == JOY_PRESSED ? 1 : 0);
gui_config->screensaver_needs_reset = TRUE;
}
}
S9xReleaseJoysticks ();
}
#endif
return;
}
示例2: pollBindingPriv
void pollBindingPriv(const Binding &b,
Input::ButtonCode &repeatCand)
{
if (!b.sourceActive())
return;
if (b.target == Input::None)
return;
ButtonState &state = getState(b.target);
ButtonState &oldState = getOldState(b.target);
state.pressed = true;
/* Must have been released before to trigger */
if (!oldState.pressed)
state.triggered = true;
/* Unbound keys don't create/break repeat */
if (repeatCand != Input::None)
return;
if (repeating != b.target &&
!oldState.pressed)
{
if (b.sourceRepeatable())
repeatCand = b.target;
else
/* Unrepeatable keys still break current repeat */
repeating = Input::None;
}
}
示例3: on_data_binding_changed
static void
on_data_binding_changed(GObject *object, GParamSpec *spec, GitgDataBinding *binding)
{
Binding *source = binding->source.object == object ? &binding->source : &binding->dest;
Binding *dest = binding->source.object == object ? &binding->dest : &binding->source;
/* Transmit to dest */
GValue value = { 0, };
g_value_init(&value, dest->type);
GValue svalue = { 0, };
g_value_init(&svalue, source->type);
g_object_get_property(source->object, source->property, &svalue);
g_object_get_property(dest->object, dest->property, &value);
if (source->conversion(&svalue, &value, source->userdata))
{
if (dest->notify_id)
g_signal_handler_block(dest->object, dest->notify_id);
g_object_set_property(dest->object, dest->property, &value);
if (dest->notify_id)
g_signal_handler_unblock(dest->object, dest->notify_id);
}
g_value_unset(&value);
g_value_unset(&svalue);
}
示例4: createBinding
void Action::bind(const String& bindable1, const String& bindable2)
{
Binding* b = createBinding();
b->bind(bindable1);
b->bind(bindable2);
}
示例5: bind
/** @brief Bind a Symbol to a specified value.
*
* @param symbol Non-null pointer to the Symbol to be bound or
* rebound.
*
* @param value Pointer, possibly null, to the RObject to
* which \a symbol is now to be bound. Any previous
* binding of \a symbol is overwritten.
*
* @param origin Origin of the newly bound value.
*
* @return Pointer to the resulting Binding.
*/
Binding* bind(const Symbol* symbol, RObject* value,
Frame::Binding::Origin origin = Frame::Binding::EXPLICIT)
{
Binding* bdg = obtainBinding(symbol);
bdg->setValue(value, origin);
return bdg;
}
示例6: soapBinding
SoapBinding::Style Converter::soapStyle( const Binding& binding ) const
{
if ( binding.type() == Binding::SOAPBinding ) {
const SoapBinding soapBinding( binding.soapBinding() );
return soapBinding.binding().style();
}
return SoapBinding::RPCStyle;
}
示例7: RemoveListener
//--------------------------------------------------------------------------------------
void BoundValueTable::RemoveListener( BindAddressHandle handle, IBoundValueTableListener* pListener )
{
Binding* binding = NULL;
if(!GetOrAddBinding(&binding, handle, false))
return;
binding->RemoveListener( pListener );
if(binding->bPromoteToParent && m_pParent)
m_pParent->RemoveListener( handle, pListener );
}
示例8: binding
/** @brief Access binding of an already-defined Symbol.
*
* This function provides a pointer to the Binding of a
* Symbol. In this variant the pointer is non-const, and
* consequently the calling code can use it to modify the
* Binding (provided the Binding is not locked).
*
* @param location assigned to the Symbol in the FrameDescriptor.
*
* @return A pointer to the required binding, or a null
* pointer if it was not set.
*/
Binding* binding(int location)
{
assert(m_descriptor != nullptr);
assert(location >= 0);
assert(location < m_descriptor->getNumberOfSymbols());
Binding* binding = m_bindings + location;
if (binding->isSet()) {
return binding;
} else {
return nullptr;
}
}
示例9: AddListener
void BoundValueTable::AddListener( BindAddressHandle handle, IBoundValueTableListener* pListener )
{
Binding* binding = NULL;
if(!GetOrAddBinding(&binding, handle, true))
return;
binding->AddListener( pListener );
// If the listener is placed upon a NULL value, then the listener will automatically
// be propagated up the parent chain until a value is found
if( binding->bPromoteToParent && m_pParent )
m_pParent->AddListener( handle, pListener );
}
示例10: newClass
void Converter::convertService( const Service &service )
{
KODE::Class newClass( service.name() );
newClass.addBaseClass( mQObject );
newClass.addHeaderInclude( "qobject.h" );
newClass.addHeaderInclude( "qstring.h" );
newClass.addHeaderInclude( "transport.h" );
newClass.addInclude( "serializer.h" );
KODE::Function ctor( service.name() );
KODE::Function dtor( "~" + service.name() );
KODE::Code ctorCode, dtorCode;
const Service::Port::List servicePorts = service.ports();
Service::Port::List::ConstIterator it;
for ( it = servicePorts.begin(); it != servicePorts.end(); ++it ) {
Binding binding = mWSDL.findBinding( (*it).mBinding );
Port port = mWSDL.findPort( binding.type() );
const Port::Operation::List operations = port.operations();
Port::Operation::List::ConstIterator opIt;
for ( opIt = operations.begin(); opIt != operations.end(); ++opIt ) {
Message inputMessage = mWSDL.findMessage( (*opIt).input() );
Message outputMessage = mWSDL.findMessage( (*opIt).output() );
convertInputMessage( port, inputMessage, newClass );
convertOutputMessage( port, outputMessage, newClass );
KODE::MemberVariable transport( inputMessage.name() + "Transport", "Transport" );
ctorCode += transport.name() + " = new Transport( \"" + (*it).mLocation + "\" );";
ctorCode += "connect( " + transport.name() + ", SIGNAL( result( const QString& ) ),";
ctorCode.indent();
ctorCode += "this, SLOT( " + outputMessage.name() + "Slot( const QString& ) ) );";
ctorCode.unindent();
dtorCode += "delete " + transport.name() + ";";
dtorCode += transport.name() + " = 0;";
}
}
ctor.setBody( ctorCode );
newClass.addFunction( ctor );
dtor.setBody( dtorCode );
newClass.addFunction( dtor );
mClasses.append( newClass );
}
示例11: if
int
Snes9xConfig::parse_binding (xmlNodePtr node, int joypad_number)
{
char *name = NULL;
char *type = NULL;
Binding b;
for (xmlAttrPtr attr = node->properties; attr; attr = attr->next)
{
if (!xmlStrcasecmp (attr->name, BAD_CAST "name"))
name = (char *) attr->children->content;
else if (!xmlStrcasecmp (attr->name, BAD_CAST "binding"))
type = (char *) attr->children->content;
}
b = Binding ((unsigned int) strtoul (type, NULL, 10));
if (joypad_number > -1 && joypad_number < NUM_JOYPAD_LINKS)
{
for (int i = 0; i < NUM_JOYPAD_LINKS; i++)
{
if (!strcasecmp (b_links[i].snes9x_name, name))
{
Binding *buttons = (Binding *) &pad[joypad_number];
if (b.is_key () || b.is_joy ())
buttons[i] = b;
else
buttons[i].clear ();
}
}
}
else
{
for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++)
{
if (!strcasecmp (b_links[i].snes9x_name, name))
{
if (b.is_key () || b.is_joy ())
shortcut[i - NUM_JOYPAD_LINKS] = b;
else
shortcut[i - NUM_JOYPAD_LINKS].clear ();
}
}
}
return 0;
}
示例12: binding_is_new_signature
inline bool Tracematch::binding_is_new_signature(Binding& binding,
const TracematchArguments& arguments)
{
const ADDRINT& target_variable_id = arguments.target_variable_id;
const ADDRINT& target = arguments.target;
const ADDRINT& returning_variable_id = arguments.returning_variable_id;
const ADDRINT& returning = arguments.returning;
for (Binding::size_type i = 0; i < binding.size(); ++i) {
if (target != 0 && i == target_variable_id) {
if (binding[i] != target) {
return false;
}
}
else if (returning != 0 && i == returning_variable_id) {
if (binding[i] != returning) {
return false;
}
}
else {
if (binding[i] != 0) {
return false;
}
}
}
return true;
}
示例13: selectedParts
static Part::List selectedParts( const Binding& binding, const Message& message, const Operation& operation, bool input )
{
if ( binding.type() == Binding::SOAPBinding ) {
const SoapBinding soapBinding = binding.soapBinding();
const SoapBinding::Operation op = soapBinding.operations().value( operation.name() );
const QString selectedPart = input ? op.input().part() : op.output().part();
if (!selectedPart.isEmpty()) {
Part::List selected;
Q_FOREACH( const Part& part, message.parts() ) {
if ( part.name() == selectedPart ) { // support for <soap:body parts="MoveFolderResult"/> (msexchange)
selected << part;
}
}
return selected;
}
}
示例14: RemoveAllListeners
//--------------------------------------------------------------------------------------
void BoundValueTable::RemoveAllListeners( BindAddressHandle handle )
{
Binding* binding = NULL;
if(!GetOrAddBinding(&binding, handle, false))
return;
if(binding->bPromoteToParent && m_pParent)
{
for( vector<IBoundValueTableListener*>::iterator itr = binding->Listeners.begin();
itr != binding->Listeners.end();
itr++ )
{
m_pParent->RemoveListener( handle, *itr );
}
}
binding->RemoveAllListeners();
}
示例15: setStorage
void RenderBuffer::setStorage(Binding<RenderBuffer>& binding,
InternalFormat internalFormat,
glm::ivec2 dimensions)
{
binding.assertBound();
glRenderbufferStorage(GL_RENDERBUFFER, static_cast<GLenum>(internalFormat), dimensions.x,
dimensions.y);
gl::GlError::assertValidateState();
}