From d5d691acfb99257d0f02d296bc8ba8522cce5bda Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 9 Apr 2011 17:13:14 +0200 Subject: integrate protobuf in qmake --- pacman-c++/pacman.pb.cc | 552 ------------------------------------------- pacman-c++/pacman.pb.h | 276 ---------------------- pacman-c++/pacman.pro | 21 +- pacman-c++/pacman.server.pro | 26 +- pacman-c++/protobuf.pri | 33 +++ 5 files changed, 60 insertions(+), 848 deletions(-) delete mode 100644 pacman-c++/pacman.pb.cc delete mode 100644 pacman-c++/pacman.pb.h create mode 100644 pacman-c++/protobuf.pri (limited to 'pacman-c++') diff --git a/pacman-c++/pacman.pb.cc b/pacman-c++/pacman.pb.cc deleted file mode 100644 index 8777326..0000000 --- a/pacman-c++/pacman.pb.cc +++ /dev/null @@ -1,552 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION -#include "pacman.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -namespace { - -const ::google::protobuf::Descriptor* KeyPressUpdate_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - KeyPressUpdate_reflection_ = NULL; -const ::google::protobuf::Descriptor* MapUpdate_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - MapUpdate_reflection_ = NULL; - -} // namespace - - -void protobuf_AssignDesc_pacman_2eproto() { - protobuf_AddDesc_pacman_2eproto(); - const ::google::protobuf::FileDescriptor* file = - ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( - "pacman.proto"); - GOOGLE_CHECK(file != NULL); - KeyPressUpdate_descriptor_ = file->message_type(0); - static const int KeyPressUpdate_offsets_[1] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(KeyPressUpdate, newkey_), - }; - KeyPressUpdate_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - KeyPressUpdate_descriptor_, - KeyPressUpdate::default_instance_, - KeyPressUpdate_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(KeyPressUpdate, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(KeyPressUpdate, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(KeyPressUpdate)); - MapUpdate_descriptor_ = file->message_type(1); - static const int MapUpdate_offsets_[1] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapUpdate, field_), - }; - MapUpdate_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - MapUpdate_descriptor_, - MapUpdate::default_instance_, - MapUpdate_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapUpdate, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapUpdate, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(MapUpdate)); -} - -namespace { - -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); -inline void protobuf_AssignDescriptorsOnce() { - ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, - &protobuf_AssignDesc_pacman_2eproto); -} - -void protobuf_RegisterTypes(const ::std::string&) { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - KeyPressUpdate_descriptor_, &KeyPressUpdate::default_instance()); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - MapUpdate_descriptor_, &MapUpdate::default_instance()); -} - -} // namespace - -void protobuf_ShutdownFile_pacman_2eproto() { - delete KeyPressUpdate::default_instance_; - delete KeyPressUpdate_reflection_; - delete MapUpdate::default_instance_; - delete MapUpdate_reflection_; -} - -void protobuf_AddDesc_pacman_2eproto() { - static bool already_here = false; - if (already_here) return; - already_here = true; - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\014pacman.proto\" \n\016KeyPressUpdate\022\016\n\006newK" - "ey\030\001 \002(\r\"\036\n\tMapUpdate\022\021\n\005field\030\001 \003(\rB\002\020\001", 80); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( - "pacman.proto", &protobuf_RegisterTypes); - KeyPressUpdate::default_instance_ = new KeyPressUpdate(); - MapUpdate::default_instance_ = new MapUpdate(); - KeyPressUpdate::default_instance_->InitAsDefaultInstance(); - MapUpdate::default_instance_->InitAsDefaultInstance(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_pacman_2eproto); -} - -// Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_pacman_2eproto { - StaticDescriptorInitializer_pacman_2eproto() { - protobuf_AddDesc_pacman_2eproto(); - } -} static_descriptor_initializer_pacman_2eproto_; - - -// =================================================================== - -#ifndef _MSC_VER -const int KeyPressUpdate::kNewKeyFieldNumber; -#endif // !_MSC_VER - -KeyPressUpdate::KeyPressUpdate() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void KeyPressUpdate::InitAsDefaultInstance() { -} - -KeyPressUpdate::KeyPressUpdate(const KeyPressUpdate& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void KeyPressUpdate::SharedCtor() { - _cached_size_ = 0; - newkey_ = 0u; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -KeyPressUpdate::~KeyPressUpdate() { - SharedDtor(); -} - -void KeyPressUpdate::SharedDtor() { - if (this != default_instance_) { - } -} - -void KeyPressUpdate::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* KeyPressUpdate::descriptor() { - protobuf_AssignDescriptorsOnce(); - return KeyPressUpdate_descriptor_; -} - -const KeyPressUpdate& KeyPressUpdate::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_pacman_2eproto(); return *default_instance_; -} - -KeyPressUpdate* KeyPressUpdate::default_instance_ = NULL; - -KeyPressUpdate* KeyPressUpdate::New() const { - return new KeyPressUpdate; -} - -void KeyPressUpdate::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - newkey_ = 0u; - } - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool KeyPressUpdate::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required uint32 newKey = 1; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( - input, &newkey_))); - set_has_newkey(); - } else { - goto handle_uninterpreted; - } - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void KeyPressUpdate::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // required uint32 newKey = 1; - if (has_newkey()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->newkey(), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* KeyPressUpdate::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // required uint32 newKey = 1; - if (has_newkey()) { - target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->newkey(), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int KeyPressUpdate::ByteSize() const { - int total_size = 0; - - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required uint32 newKey = 1; - if (has_newkey()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::UInt32Size( - this->newkey()); - } - - } - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void KeyPressUpdate::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const KeyPressUpdate* source = - ::google::protobuf::internal::dynamic_cast_if_available( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void KeyPressUpdate::MergeFrom(const KeyPressUpdate& from) { - GOOGLE_CHECK_NE(&from, this); - if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (from.has_newkey()) { - set_newkey(from.newkey()); - } - } - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void KeyPressUpdate::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void KeyPressUpdate::CopyFrom(const KeyPressUpdate& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool KeyPressUpdate::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; - - return true; -} - -void KeyPressUpdate::Swap(KeyPressUpdate* other) { - if (other != this) { - std::swap(newkey_, other->newkey_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata KeyPressUpdate::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = KeyPressUpdate_descriptor_; - metadata.reflection = KeyPressUpdate_reflection_; - return metadata; -} - - -// =================================================================== - -#ifndef _MSC_VER -const int MapUpdate::kFieldFieldNumber; -#endif // !_MSC_VER - -MapUpdate::MapUpdate() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void MapUpdate::InitAsDefaultInstance() { -} - -MapUpdate::MapUpdate(const MapUpdate& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void MapUpdate::SharedCtor() { - _cached_size_ = 0; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -MapUpdate::~MapUpdate() { - SharedDtor(); -} - -void MapUpdate::SharedDtor() { - if (this != default_instance_) { - } -} - -void MapUpdate::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* MapUpdate::descriptor() { - protobuf_AssignDescriptorsOnce(); - return MapUpdate_descriptor_; -} - -const MapUpdate& MapUpdate::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_pacman_2eproto(); return *default_instance_; -} - -MapUpdate* MapUpdate::default_instance_ = NULL; - -MapUpdate* MapUpdate::New() const { - return new MapUpdate; -} - -void MapUpdate::Clear() { - field_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool MapUpdate::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated uint32 field = 1 [packed = true]; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< - ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( - input, this->mutable_field()))); - } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) - == ::google::protobuf::internal::WireFormatLite:: - WIRETYPE_VARINT) { - DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( - 1, 10, input, this->mutable_field()))); - } else { - goto handle_uninterpreted; - } - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void MapUpdate::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // repeated uint32 field = 1 [packed = true]; - if (this->field_size() > 0) { - ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_field_cached_byte_size_); - } - for (int i = 0; i < this->field_size(); i++) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( - this->field(i), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* MapUpdate::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // repeated uint32 field = 1 [packed = true]; - if (this->field_size() > 0) { - target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( - 1, - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( - _field_cached_byte_size_, target); - } - for (int i = 0; i < this->field_size(); i++) { - target = ::google::protobuf::internal::WireFormatLite:: - WriteUInt32NoTagToArray(this->field(i), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int MapUpdate::ByteSize() const { - int total_size = 0; - - // repeated uint32 field = 1 [packed = true]; - { - int data_size = 0; - for (int i = 0; i < this->field_size(); i++) { - data_size += ::google::protobuf::internal::WireFormatLite:: - UInt32Size(this->field(i)); - } - if (data_size > 0) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); - } - _field_cached_byte_size_ = data_size; - total_size += data_size; - } - - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void MapUpdate::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const MapUpdate* source = - ::google::protobuf::internal::dynamic_cast_if_available( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void MapUpdate::MergeFrom(const MapUpdate& from) { - GOOGLE_CHECK_NE(&from, this); - field_.MergeFrom(from.field_); - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void MapUpdate::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void MapUpdate::CopyFrom(const MapUpdate& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool MapUpdate::IsInitialized() const { - - return true; -} - -void MapUpdate::Swap(MapUpdate* other) { - if (other != this) { - field_.Swap(&other->field_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata MapUpdate::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = MapUpdate_descriptor_; - metadata.reflection = MapUpdate_reflection_; - return metadata; -} - - -// @@protoc_insertion_point(namespace_scope) - -// @@protoc_insertion_point(global_scope) diff --git a/pacman-c++/pacman.pb.h b/pacman-c++/pacman.pb.h deleted file mode 100644 index 6f94834..0000000 --- a/pacman-c++/pacman.pb.h +++ /dev/null @@ -1,276 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: pacman.proto - -#ifndef PROTOBUF_pacman_2eproto__INCLUDED -#define PROTOBUF_pacman_2eproto__INCLUDED - -#include - -#include - -#if GOOGLE_PROTOBUF_VERSION < 2004000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 2004000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -// @@protoc_insertion_point(includes) - -// Internal implementation detail -- do not call these. -void protobuf_AddDesc_pacman_2eproto(); -void protobuf_AssignDesc_pacman_2eproto(); -void protobuf_ShutdownFile_pacman_2eproto(); - -class KeyPressUpdate; -class MapUpdate; - -// =================================================================== - -class KeyPressUpdate : public ::google::protobuf::Message { - public: - KeyPressUpdate(); - virtual ~KeyPressUpdate(); - - KeyPressUpdate(const KeyPressUpdate& from); - - inline KeyPressUpdate& operator=(const KeyPressUpdate& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const KeyPressUpdate& default_instance(); - - void Swap(KeyPressUpdate* other); - - // implements Message ---------------------------------------------- - - KeyPressUpdate* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const KeyPressUpdate& from); - void MergeFrom(const KeyPressUpdate& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { return _cached_size_; } - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // required uint32 newKey = 1; - inline bool has_newkey() const; - inline void clear_newkey(); - static const int kNewKeyFieldNumber = 1; - inline ::google::protobuf::uint32 newkey() const; - inline void set_newkey(::google::protobuf::uint32 value); - - // @@protoc_insertion_point(class_scope:KeyPressUpdate) - private: - inline void set_has_newkey(); - inline void clear_has_newkey(); - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::google::protobuf::uint32 newkey_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; - - friend void protobuf_AddDesc_pacman_2eproto(); - friend void protobuf_AssignDesc_pacman_2eproto(); - friend void protobuf_ShutdownFile_pacman_2eproto(); - - void InitAsDefaultInstance(); - static KeyPressUpdate* default_instance_; -}; -// ------------------------------------------------------------------- - -class MapUpdate : public ::google::protobuf::Message { - public: - MapUpdate(); - virtual ~MapUpdate(); - - MapUpdate(const MapUpdate& from); - - inline MapUpdate& operator=(const MapUpdate& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const MapUpdate& default_instance(); - - void Swap(MapUpdate* other); - - // implements Message ---------------------------------------------- - - MapUpdate* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const MapUpdate& from); - void MergeFrom(const MapUpdate& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { return _cached_size_; } - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // repeated uint32 field = 1 [packed = true]; - inline int field_size() const; - inline void clear_field(); - static const int kFieldFieldNumber = 1; - inline ::google::protobuf::uint32 field(int index) const; - inline void set_field(int index, ::google::protobuf::uint32 value); - inline void add_field(::google::protobuf::uint32 value); - inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& - field() const; - inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* - mutable_field(); - - // @@protoc_insertion_point(class_scope:MapUpdate) - private: - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > field_; - mutable int _field_cached_byte_size_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; - - friend void protobuf_AddDesc_pacman_2eproto(); - friend void protobuf_AssignDesc_pacman_2eproto(); - friend void protobuf_ShutdownFile_pacman_2eproto(); - - void InitAsDefaultInstance(); - static MapUpdate* default_instance_; -}; -// =================================================================== - - -// =================================================================== - -// KeyPressUpdate - -// required uint32 newKey = 1; -inline bool KeyPressUpdate::has_newkey() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -inline void KeyPressUpdate::set_has_newkey() { - _has_bits_[0] |= 0x00000001u; -} -inline void KeyPressUpdate::clear_has_newkey() { - _has_bits_[0] &= ~0x00000001u; -} -inline void KeyPressUpdate::clear_newkey() { - newkey_ = 0u; - clear_has_newkey(); -} -inline ::google::protobuf::uint32 KeyPressUpdate::newkey() const { - return newkey_; -} -inline void KeyPressUpdate::set_newkey(::google::protobuf::uint32 value) { - set_has_newkey(); - newkey_ = value; -} - -// ------------------------------------------------------------------- - -// MapUpdate - -// repeated uint32 field = 1 [packed = true]; -inline int MapUpdate::field_size() const { - return field_.size(); -} -inline void MapUpdate::clear_field() { - field_.Clear(); -} -inline ::google::protobuf::uint32 MapUpdate::field(int index) const { - return field_.Get(index); -} -inline void MapUpdate::set_field(int index, ::google::protobuf::uint32 value) { - field_.Set(index, value); -} -inline void MapUpdate::add_field(::google::protobuf::uint32 value) { - field_.Add(value); -} -inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& -MapUpdate::field() const { - return field_; -} -inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* -MapUpdate::mutable_field() { - return &field_; -} - - -// @@protoc_insertion_point(namespace_scope) - -#ifndef SWIG -namespace google { -namespace protobuf { - - -} // namespace google -} // namespace protobuf -#endif // SWIG - -// @@protoc_insertion_point(global_scope) - -#endif // PROTOBUF_pacman_2eproto__INCLUDED diff --git a/pacman-c++/pacman.pro b/pacman-c++/pacman.pro index 32f2151..9274297 100644 --- a/pacman-c++/pacman.pro +++ b/pacman-c++/pacman.pro @@ -1,3 +1,7 @@ +TEMPLATE = app +LANGUAGE = C++ +VERSION = 0.1 + QT += phonon SOURCES += pixmapitem.cpp \ actor.cpp \ @@ -9,9 +13,8 @@ SOURCES += pixmapitem.cpp \ point.cpp \ audioplayer.cpp \ clicklabel.cpp \ - sceneholder.cpp \ - util.cpp \ - pacman.pb.cc + sceneholder.cpp \ + util.cpp HEADERS += pixmapitem.h \ actor.h \ animationmanager.h \ @@ -23,9 +26,8 @@ HEADERS += pixmapitem.h \ point.h \ audioplayer.h \ clicklabel.h \ - sceneholder.h \ - util.h \ - pacman.pb.h + sceneholder.h \ + util.h RESOURCES += pacman.qrc OBJECTS_DIR = .obj @@ -34,7 +36,10 @@ RC_FILE = pacman.rc OTHER_FILES += \ style.qss \ - pacman.rc + pacman.rc \ + pacman.proto +PROTOS = pacman.proto +PROTOPATH += $(INCPATH) +include(protobuf.pri) LIBS += -lprotobuf - diff --git a/pacman-c++/pacman.server.pro b/pacman-c++/pacman.server.pro index 5a31ffe..5045cd2 100644 --- a/pacman-c++/pacman.server.pro +++ b/pacman-c++/pacman.server.pro @@ -1,3 +1,8 @@ +TEMPLATE = app +LANGUAGE = C++ +VERSION = 0.1 +DEFINES += SERVER + QT += phonon SOURCES += pixmapitem.cpp \ actor.cpp \ @@ -8,10 +13,9 @@ SOURCES += pixmapitem.cpp \ mainwidget.cpp \ point.cpp \ audioplayer.cpp \ - sceneholder.cpp \ - util.cpp \ - clicklabel.cpp \ - pacman.pb.cc + sceneholder.cpp \ + util.cpp \ + clicklabel.cpp HEADERS += pixmapitem.h \ actor.h \ animationmanager.h \ @@ -22,11 +26,9 @@ HEADERS += pixmapitem.h \ constants.h \ point.h \ audioplayer.h \ - sceneholder.h \ - util.h \ - clicklabel.h \ - pacman.pb.h -HEADERS += pixmapitem.h \ + sceneholder.h \ + util.h \ + clicklabel.h RESOURCES += pacman.qrc OBJECTS_DIR = .obj @@ -37,7 +39,7 @@ OTHER_FILES += \ style.qss \ pacman.rc -DEFINES += SERVER - +PROTOS = pacman.proto +PROTOPATH += $(INCPATH) +include(protobuf.pri) LIBS += -lprotobuf - diff --git a/pacman-c++/protobuf.pri b/pacman-c++/protobuf.pri new file mode 100644 index 0000000..03b9514 --- /dev/null +++ b/pacman-c++/protobuf.pri @@ -0,0 +1,33 @@ +# +# Qt qmake integration with Google Protocol Buffers compiler protoc +# +# To compile protocol buffers with qt qmake, specify PROTOS variable and +# include this file +# +# Example: +# PROTOS = a.proto b.proto +# include(protobuf.pri) +# +# By default protoc looks for .proto files (including the imported ones) in +# the current directory where protoc is run. If you need to include additional +# paths specify the PROTOPATH variable +# + +PROTOPATH += . +PROTOPATHS = +for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} + +protobuf_decl.name = protobuf header +protobuf_decl.input = PROTOS +protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h +protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} ${QMAKE_FILE_IN} +protobuf_decl.variable_out = GENERATED_FILES +QMAKE_EXTRA_COMPILERS += protobuf_decl + +protobuf_impl.name = protobuf implementation +protobuf_impl.input = PROTOS +protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc +protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h +protobuf_impl.commands = $$escape_expand(\\n) +protobuf_impl.variable_out = GENERATED_SOURCES +QMAKE_EXTRA_COMPILERS += protobuf_impl -- cgit v1.2.3