max_stars_count
int64 301
224k
| text
stringlengths 6
1.05M
| token_count
int64 3
727k
|
---|---|---|
435 | {
"copyright_text": null,
"description": "From humble beginnings in 2001, the SciPy library has grown into one of\nthe cornerstones of the scientific Python ecosystem, and it recently had\na milestone 1.0 release. In this talk I'd like to explore the road to\nthat 1.0 release, as well as some questions and ideas about what's next\nfor the project and community. How do we grow and sustain the project in\nthe future? What is happening around sustainability of projects in the\necosystem? And what does this mean for users and aspiring\ncontributors?Presenter(s): Speaker: <NAME>, FP Innovations, Scion\n",
"duration": 3184,
"language": "eng",
"recorded": "2018-07-11",
"related_urls": [
{
"label": "Conference schedule",
"url": "https://scipy2018.scipy.org/ehome/299527/721463/"
},
{
"label": "Conference slides",
"url": "https://github.com/deniederhut/Slides-SciPyConf-2018"
}
],
"speakers": [
"<NAME>"
],
"tags": [
"keynote"
],
"thumbnail_url": "https://i.ytimg.com/vi/oHmm3mPxg6Y/maxresdefault.jpg",
"title": "Keynote: SciPy 1.0 and Beyond - a Story of Code and Community",
"videos": [
{
"type": "youtube",
"url": "https://www.youtube.com/watch?v=oHmm3mPxg6Y"
}
]
}
| 469 |
743 | // Copyright 2021 Sony Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_LINUX_EMBEDDED_WINDOW_RENDERER_ELINUX_SHADER_H_
#define FLUTTER_SHELL_PLATFORM_LINUX_EMBEDDED_WINDOW_RENDERER_ELINUX_SHADER_H_
#ifdef USE_GLES3
#include <GLES3/gl32.h>
#else
#include <GLES2/gl2.h>
#endif
#include <memory>
#include <string>
#include "flutter/shell/platform/linux_embedded/logger.h"
#include "flutter/shell/platform/linux_embedded/window/renderer/elinux_shader_context.h"
#include "flutter/shell/platform/linux_embedded/window/renderer/elinux_shader_program.h"
namespace flutter {
class ELinuxShader {
public:
ELinuxShader() = default;
~ELinuxShader() = default;
void LoadProgram(std::string vertex_code, std::string fragment_code);
void Bind();
void Unbind();
GLuint Program() const { return program_->Program(); }
private:
std::unique_ptr<ELinuxShaderProgram> program_;
std::unique_ptr<ELinuxShaderContext> vertex_;
std::unique_ptr<ELinuxShaderContext> fragment_;
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_LINUX_EMBEDDED_WINDOW_RENDERER_ELINUX_SHADER_H_
| 460 |
1,466 | <filename>java/main/com/facebook/profilo/config/Config.java<gh_stars>1000+
/**
* Copyright 2004-present, Facebook, Inc.
*
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.profilo.config;
import javax.annotation.Nullable;
public interface Config {
// System config parameters
int getSystemConfigParamInt(String key);
int optSystemConfigParamInt(String key, int defaultVal);
boolean getSystemConfigParamBool(String key);
boolean optSystemConfigParamBool(String key, boolean defaultVal);
String getSystemConfigParamString(String key);
@Nullable
String optSystemConfigParamString(String key, @Nullable String defaultVal);
int[] getSystemConfigParamIntList(String key);
@Nullable
int[] optSystemConfigParamIntList(String key);
String[] getSystemConfigParamStringList(String key);
String[] optSystemConfigParamStringList(String key);
// Trace config parameters
int[] getTraceConfigIdxs(String triggerType, String triggerAction);
String[] getTraceConfigProviders(int traceConfigIdx);
int getTraceConfigParamInt(int traceConfigIdx, String key);
int optTraceConfigParamInt(int traceConfigIdx, String key, int defaultVal);
boolean getTraceConfigParamBool(int traceConfigIdx, String key);
boolean optTraceConfigParamBool(int traceConfigIdx, String key, boolean defaultVal);
String getTraceConfigParamString(int traceConfigIdx, String key);
@Nullable
String optTraceConfigParamString(int traceConfigIdx, String key, @Nullable String defaultVal);
int[] getTraceConfigParamIntList(int traceConfigIdx, String key);
@Nullable
int[] optTraceConfigParamIntList(int traceConfigIdx, String key);
String[] getTraceConfigParamStringList(int traceConfigIdx, String key);
@Nullable
String[] optTraceConfigParamStringList(int traceConfigIdx, String key);
// Trigger parameters
int getTraceConfigTriggerParamInt(
int traceConfigIdx, String triggerType, String triggerAction, String key);
int optTraceConfigTriggerParamInt(
int traceConfigIdx, String triggerType, String triggerAction, String key, int defaultVal);
boolean getTraceConfigTriggerParamBool(
int traceConfigIdx, String triggerType, String triggerAction, String key);
boolean optTraceConfigTriggerParamBool(
int traceConfigIdx, String triggerType, String triggerAction, String key, boolean defaultVal);
String getTraceConfigTriggerParamString(
int traceConfigIdx, String triggerType, String triggerAction, String key);
@Nullable
String optTraceConfigTriggerParamString(
int traceConfigIdx,
String triggerType,
String triggerAction,
String key,
@Nullable String defaultVal);
int[] getTraceConfigTriggerParamIntList(
int traceconfigIdx, String triggerType, String triggerAction, String key);
@Nullable
int[] optTraceConfigTriggerParamIntList(
int traceconfigIdx, String triggerType, String triggerAction, String key);
String[] getTraceConfigTriggerParamStringList(
int traceconfigIdx, String triggerType, String triggerAction, String key);
@Nullable
String[] optTraceConfigTriggerParamStringList(
int traceconfigIdx, String triggerType, String triggerAction, String key);
/** Only use when serializing a TraceConfig. The explicit accessors are much faster. */
ConfigParams getTraceConfigParams(int traceConfigIdx);
// Misc
boolean isDisablingConfig();
int getVersion();
long getID();
}
| 1,123 |
14,668 | <reponame>zealoussnow/chromium<gh_stars>1000+
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_
#define ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_
#include "ash/hud_display/graph.h"
#include "ash/hud_display/graph_page_view_base.h"
namespace ash {
namespace hud_display {
// Draws CPU graphs;
class CpuGraphPageView : public GraphPageViewBase {
public:
METADATA_HEADER(CpuGraphPageView);
explicit CpuGraphPageView(const base::TimeDelta refresh_interval);
CpuGraphPageView(const CpuGraphPageView&) = delete;
CpuGraphPageView& operator=(const CpuGraphPageView&) = delete;
~CpuGraphPageView() override;
// views::View
void OnPaint(gfx::Canvas* canvas) override;
// Update page data from the new snapshot.
void UpdateData(const DataSource::Snapshot& snapshot) override;
private:
// Stacked, percent of CPU ticks per interval:
Graph cpu_other_;
Graph cpu_system_;
Graph cpu_user_;
Graph cpu_idle_;
};
} // namespace hud_display
} // namespace ash
#endif // ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_
| 415 |
1,584 | <gh_stars>1000+
//===========================================================================
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//===========================================================================
#ifndef _INC_PROPKEY
#define _INC_PROPKEY
#ifndef DEFINE_API_PKEY
#define DEFINE_API_PKEY(name, managed_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \
DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid)
#endif
#include <propkeydef.h>
#ifndef _WIN32_IE
#define _WIN32_IE 0x0501
#else
#if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
#error _WIN32_IE setting conflicts with _WIN32_WINNT setting
#endif
#endif
//-----------------------------------------------------------------------------
// Audio properties
// Name: System.Audio.ChannelCount -- PKEY_Audio_ChannelCount
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 7 (PIDASI_CHANNEL_COUNT)
//
// Indicates the channel count for the audio file. Values: 1 (mono), 2 (stereo).
DEFINE_PROPERTYKEY(PKEY_Audio_ChannelCount, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 7);
// Possible discrete values for PKEY_Audio_ChannelCount are:
#define AUDIO_CHANNELCOUNT_MONO 1ul
#define AUDIO_CHANNELCOUNT_STEREO 2ul
// Name: System.Audio.Compression -- PKEY_Audio_Compression
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 10 (PIDASI_COMPRESSION)
//
//
DEFINE_PROPERTYKEY(PKEY_Audio_Compression, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 10);
// Name: System.Audio.EncodingBitrate -- PKEY_Audio_EncodingBitrate
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 4 (PIDASI_AVG_DATA_RATE)
//
// Indicates the average data rate in Hz for the audio file in "bits per second".
DEFINE_PROPERTYKEY(PKEY_Audio_EncodingBitrate, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4);
// Name: System.Audio.Format -- PKEY_Audio_Format
// Type: String -- VT_LPWSTR (For variants: VT_BSTR) Legacy code may treat this as VT_BSTR.
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 2 (PIDASI_FORMAT)
//
// Indicates the format of the audio file.
DEFINE_PROPERTYKEY(PKEY_Audio_Format, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 2);
// Name: System.Audio.IsVariableBitRate -- PKEY_Audio_IsVariableBitRate
// Type: Boolean -- VT_BOOL
// FormatID: E6822FEE-8C17-4D62-823C-8E9CFCBD1D5C, 100
DEFINE_PROPERTYKEY(PKEY_Audio_IsVariableBitRate, 0xE6822FEE, 0x8C17, 0x4D62, 0x82, 0x3C, 0x8E, 0x9C, 0xFC, 0xBD, 0x1D, 0x5C, 100);
// Name: System.Audio.PeakValue -- PKEY_Audio_PeakValue
// Type: UInt32 -- VT_UI4
// FormatID: 2579E5D0-1116-4084-BD9A-9B4F7CB4DF5E, 100
DEFINE_PROPERTYKEY(PKEY_Audio_PeakValue, 0x2579E5D0, 0x1116, 0x4084, 0xBD, 0x9A, 0x9B, 0x4F, 0x7C, 0xB4, 0xDF, 0x5E, 100);
// Name: System.Audio.SampleRate -- PKEY_Audio_SampleRate
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 5 (PIDASI_SAMPLE_RATE)
//
// Indicates the audio sample rate for the audio file in "samples per second".
DEFINE_PROPERTYKEY(PKEY_Audio_SampleRate, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 5);
// Name: System.Audio.SampleSize -- PKEY_Audio_SampleSize
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 6 (PIDASI_SAMPLE_SIZE)
//
// Indicates the audio sample size for the audio file in "bits per sample".
DEFINE_PROPERTYKEY(PKEY_Audio_SampleSize, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6);
// Name: System.Audio.StreamName -- PKEY_Audio_StreamName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 9 (PIDASI_STREAM_NAME)
//
//
DEFINE_PROPERTYKEY(PKEY_Audio_StreamName, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9);
// Name: System.Audio.StreamNumber -- PKEY_Audio_StreamNumber
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 8 (PIDASI_STREAM_NUMBER)
//
//
DEFINE_PROPERTYKEY(PKEY_Audio_StreamNumber, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 8);
//-----------------------------------------------------------------------------
// Calendar properties
// Name: System.Calendar.Duration -- PKEY_Calendar_Duration
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 293CA35A-09AA-4DD2-B180-1FE245728A52, 100
//
// The duration as specified in a string.
DEFINE_PROPERTYKEY(PKEY_Calendar_Duration, 0x293CA35A, 0x09AA, 0x4DD2, 0xB1, 0x80, 0x1F, 0xE2, 0x45, 0x72, 0x8A, 0x52, 100);
// Name: System.Calendar.IsOnline -- PKEY_Calendar_IsOnline
// Type: Boolean -- VT_BOOL
// FormatID: BFEE9149-E3E2-49A7-A862-C05988145CEC, 100
//
// Identifies if the event is an online event.
DEFINE_PROPERTYKEY(PKEY_Calendar_IsOnline, 0xBFEE9149, 0xE3E2, 0x49A7, 0xA8, 0x62, 0xC0, 0x59, 0x88, 0x14, 0x5C, 0xEC, 100);
// Name: System.Calendar.IsRecurring -- PKEY_Calendar_IsRecurring
// Type: Boolean -- VT_BOOL
// FormatID: 315B9C8D-80A9-4EF9-AE16-8E746DA51D70, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_IsRecurring, 0x315B9C8D, 0x80A9, 0x4EF9, 0xAE, 0x16, 0x8E, 0x74, 0x6D, 0xA5, 0x1D, 0x70, 100);
// Name: System.Calendar.Location -- PKEY_Calendar_Location
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F6272D18-CECC-40B1-B26A-3911717AA7BD, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_Location, 0xF6272D18, 0xCECC, 0x40B1, 0xB2, 0x6A, 0x39, 0x11, 0x71, 0x7A, 0xA7, 0xBD, 100);
// Name: System.Calendar.OptionalAttendeeAddresses -- PKEY_Calendar_OptionalAttendeeAddresses
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D55BAE5A-3892-417A-A649-C6AC5AAAEAB3, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_OptionalAttendeeAddresses, 0xD55BAE5A, 0x3892, 0x417A, 0xA6, 0x49, 0xC6, 0xAC, 0x5A, 0xAA, 0xEA, 0xB3, 100);
// Name: System.Calendar.OptionalAttendeeNames -- PKEY_Calendar_OptionalAttendeeNames
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 09429607-582D-437F-84C3-DE93A2B24C3C, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_OptionalAttendeeNames, 0x09429607, 0x582D, 0x437F, 0x84, 0xC3, 0xDE, 0x93, 0xA2, 0xB2, 0x4C, 0x3C, 100);
// Name: System.Calendar.OrganizerAddress -- PKEY_Calendar_OrganizerAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 744C8242-4DF5-456C-AB9E-014EFB9021E3, 100
//
// Address of the organizer organizing the event.
DEFINE_PROPERTYKEY(PKEY_Calendar_OrganizerAddress, 0x744C8242, 0x4DF5, 0x456C, 0xAB, 0x9E, 0x01, 0x4E, 0xFB, 0x90, 0x21, 0xE3, 100);
// Name: System.Calendar.OrganizerName -- PKEY_Calendar_OrganizerName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: AAA660F9-9865-458E-B484-01BC7FE3973E, 100
//
// Name of the organizer organizing the event.
DEFINE_PROPERTYKEY(PKEY_Calendar_OrganizerName, 0xAAA660F9, 0x9865, 0x458E, 0xB4, 0x84, 0x01, 0xBC, 0x7F, 0xE3, 0x97, 0x3E, 100);
// Name: System.Calendar.ReminderTime -- PKEY_Calendar_ReminderTime
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 72FC5BA4-24F9-4011-9F3F-ADD27AFAD818, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_ReminderTime, 0x72FC5BA4, 0x24F9, 0x4011, 0x9F, 0x3F, 0xAD, 0xD2, 0x7A, 0xFA, 0xD8, 0x18, 100);
// Name: System.Calendar.RequiredAttendeeAddresses -- PKEY_Calendar_RequiredAttendeeAddresses
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 0BA7D6C3-568D-4159-AB91-781A91FB71E5, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_RequiredAttendeeAddresses, 0x0BA7D6C3, 0x568D, 0x4159, 0xAB, 0x91, 0x78, 0x1A, 0x91, 0xFB, 0x71, 0xE5, 100);
// Name: System.Calendar.RequiredAttendeeNames -- PKEY_Calendar_RequiredAttendeeNames
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: B33AF30B-F552-4584-936C-CB93E5CDA29F, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_RequiredAttendeeNames, 0xB33AF30B, 0xF552, 0x4584, 0x93, 0x6C, 0xCB, 0x93, 0xE5, 0xCD, 0xA2, 0x9F, 100);
// Name: System.Calendar.Resources -- PKEY_Calendar_Resources
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 00F58A38-C54B-4C40-8696-97235980EAE1, 100
DEFINE_PROPERTYKEY(PKEY_Calendar_Resources, 0x00F58A38, 0xC54B, 0x4C40, 0x86, 0x96, 0x97, 0x23, 0x59, 0x80, 0xEA, 0xE1, 100);
// Name: System.Calendar.ShowTimeAs -- PKEY_Calendar_ShowTimeAs
// Type: UInt16 -- VT_UI2
// FormatID: 5BF396D4-5EB2-466F-BDE9-2FB3F2361D6E, 100
//
//
DEFINE_PROPERTYKEY(PKEY_Calendar_ShowTimeAs, 0x5BF396D4, 0x5EB2, 0x466F, 0xBD, 0xE9, 0x2F, 0xB3, 0xF2, 0x36, 0x1D, 0x6E, 100);
// Possible discrete values for PKEY_Calendar_ShowTimeAs are:
#define CALENDAR_SHOWTIMEAS_FREE 0u
#define CALENDAR_SHOWTIMEAS_TENTATIVE 1u
#define CALENDAR_SHOWTIMEAS_BUSY 2u
#define CALENDAR_SHOWTIMEAS_OOF 3u
// Name: System.Calendar.ShowTimeAsText -- PKEY_Calendar_ShowTimeAsText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 53DA57CF-62C0-45C4-81DE-7610BCEFD7F5, 100
//
// This is the user-friendly form of System.Calendar.ShowTimeAs. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Calendar_ShowTimeAsText, 0x53DA57CF, 0x62C0, 0x45C4, 0x81, 0xDE, 0x76, 0x10, 0xBC, 0xEF, 0xD7, 0xF5, 100);
//-----------------------------------------------------------------------------
// Communication properties
// Name: System.Communication.AccountName -- PKEY_Communication_AccountName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 9
//
// Account Name
DEFINE_PROPERTYKEY(PKEY_Communication_AccountName, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 9);
// Name: System.Communication.Suffix -- PKEY_Communication_Suffix
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 807B653A-9E91-43EF-8F97-11CE04EE20C5, 100
DEFINE_PROPERTYKEY(PKEY_Communication_Suffix, 0x807B653A, 0x9E91, 0x43EF, 0x8F, 0x97, 0x11, 0xCE, 0x04, 0xEE, 0x20, 0xC5, 100);
// Name: System.Communication.TaskStatus -- PKEY_Communication_TaskStatus
// Type: UInt16 -- VT_UI2
// FormatID: BE1A72C6-9A1D-46B7-AFE7-AFAF8CEF4999, 100
DEFINE_PROPERTYKEY(PKEY_Communication_TaskStatus, 0xBE1A72C6, 0x9A1D, 0x46B7, 0xAF, 0xE7, 0xAF, 0xAF, 0x8C, 0xEF, 0x49, 0x99, 100);
// Possible discrete values for PKEY_Communication_TaskStatus are:
#define TASKSTATUS_NOTSTARTED 0u
#define TASKSTATUS_INPROGRESS 1u
#define TASKSTATUS_COMPLETE 2u
#define TASKSTATUS_WAITING 3u
#define TASKSTATUS_DEFERRED 4u
// Name: System.Communication.TaskStatusText -- PKEY_Communication_TaskStatusText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A6744477-C237-475B-A075-54F34498292A, 100
//
// This is the user-friendly form of System.Communication.TaskStatus. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Communication_TaskStatusText, 0xA6744477, 0xC237, 0x475B, 0xA0, 0x75, 0x54, 0xF3, 0x44, 0x98, 0x29, 0x2A, 100);
//-----------------------------------------------------------------------------
// Computer properties
// Name: System.Computer.DecoratedFreeSpace -- PKEY_Computer_DecoratedFreeSpace
// Type: Multivalue UInt64 -- VT_VECTOR | VT_UI8 (For variants: VT_ARRAY | VT_UI8)
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 7 (Filesystem Volume Properties)
//
// Free space and total space: "%s free of %s"
DEFINE_PROPERTYKEY(PKEY_Computer_DecoratedFreeSpace, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 7);
//-----------------------------------------------------------------------------
// Contact properties
// Name: System.Contact.Anniversary -- PKEY_Contact_Anniversary
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 9AD5BADB-CEA7-4470-A03D-B84E51B9949E, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Anniversary, 0x9AD5BADB, 0xCEA7, 0x4470, 0xA0, 0x3D, 0xB8, 0x4E, 0x51, 0xB9, 0x94, 0x9E, 100);
// Name: System.Contact.AssistantName -- PKEY_Contact_AssistantName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CD102C9C-5540-4A88-A6F6-64E4981C8CD1, 100
DEFINE_PROPERTYKEY(PKEY_Contact_AssistantName, 0xCD102C9C, 0x5540, 0x4A88, 0xA6, 0xF6, 0x64, 0xE4, 0x98, 0x1C, 0x8C, 0xD1, 100);
// Name: System.Contact.AssistantTelephone -- PKEY_Contact_AssistantTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 9A93244D-A7AD-4FF8-9B99-45EE4CC09AF6, 100
DEFINE_PROPERTYKEY(PKEY_Contact_AssistantTelephone, 0x9A93244D, 0xA7AD, 0x4FF8, 0x9B, 0x99, 0x45, 0xEE, 0x4C, 0xC0, 0x9A, 0xF6, 100);
// Name: System.Contact.Birthday -- PKEY_Contact_Birthday
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 47
DEFINE_PROPERTYKEY(PKEY_Contact_Birthday, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 47);
// Name: System.Contact.BusinessAddress -- PKEY_Contact_BusinessAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 730FB6DD-CF7C-426B-A03F-BD166CC9EE24, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddress, 0x730FB6DD, 0xCF7C, 0x426B, 0xA0, 0x3F, 0xBD, 0x16, 0x6C, 0xC9, 0xEE, 0x24, 100);
// Name: System.Contact.BusinessAddressCity -- PKEY_Contact_BusinessAddressCity
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 402B5934-EC5A-48C3-93E6-85E86A2D934E, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressCity, 0x402B5934, 0xEC5A, 0x48C3, 0x93, 0xE6, 0x85, 0xE8, 0x6A, 0x2D, 0x93, 0x4E, 100);
// Name: System.Contact.BusinessAddressCountry -- PKEY_Contact_BusinessAddressCountry
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: B0B87314-FCF6-4FEB-8DFF-A50DA6AF561C, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressCountry, 0xB0B87314, 0xFCF6, 0x4FEB, 0x8D, 0xFF, 0xA5, 0x0D, 0xA6, 0xAF, 0x56, 0x1C, 100);
// Name: System.Contact.BusinessAddressPostalCode -- PKEY_Contact_BusinessAddressPostalCode
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E1D4A09E-D758-4CD1-B6EC-34A8B5A73F80, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressPostalCode, 0xE1D4A09E, 0xD758, 0x4CD1, 0xB6, 0xEC, 0x34, 0xA8, 0xB5, 0xA7, 0x3F, 0x80, 100);
// Name: System.Contact.BusinessAddressPostOfficeBox -- PKEY_Contact_BusinessAddressPostOfficeBox
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: BC4E71CE-17F9-48D5-BEE9-021DF0EA5409, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressPostOfficeBox, 0xBC4E71CE, 0x17F9, 0x48D5, 0xBE, 0xE9, 0x02, 0x1D, 0xF0, 0xEA, 0x54, 0x09, 100);
// Name: System.Contact.BusinessAddressState -- PKEY_Contact_BusinessAddressState
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 446F787F-10C4-41CB-A6C4-4D0343551597, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressState, 0x446F787F, 0x10C4, 0x41CB, 0xA6, 0xC4, 0x4D, 0x03, 0x43, 0x55, 0x15, 0x97, 100);
// Name: System.Contact.BusinessAddressStreet -- PKEY_Contact_BusinessAddressStreet
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DDD1460F-C0BF-4553-8CE4-10433C908FB0, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessAddressStreet, 0xDDD1460F, 0xC0BF, 0x4553, 0x8C, 0xE4, 0x10, 0x43, 0x3C, 0x90, 0x8F, 0xB0, 100);
// Name: System.Contact.BusinessFaxNumber -- PKEY_Contact_BusinessFaxNumber
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 91EFF6F3-2E27-42CA-933E-7C999FBE310B, 100
//
// Business fax number of the contact.
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessFaxNumber, 0x91EFF6F3, 0x2E27, 0x42CA, 0x93, 0x3E, 0x7C, 0x99, 0x9F, 0xBE, 0x31, 0x0B, 100);
// Name: System.Contact.BusinessHomePage -- PKEY_Contact_BusinessHomePage
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 56310920-2491-4919-99CE-EADB06FAFDB2, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessHomePage, 0x56310920, 0x2491, 0x4919, 0x99, 0xCE, 0xEA, 0xDB, 0x06, 0xFA, 0xFD, 0xB2, 100);
// Name: System.Contact.BusinessTelephone -- PKEY_Contact_BusinessTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6A15E5A0-0A1E-4CD7-BB8C-D2F1B0C929BC, 100
DEFINE_PROPERTYKEY(PKEY_Contact_BusinessTelephone, 0x6A15E5A0, 0x0A1E, 0x4CD7, 0xBB, 0x8C, 0xD2, 0xF1, 0xB0, 0xC9, 0x29, 0xBC, 100);
// Name: System.Contact.CallbackTelephone -- PKEY_Contact_CallbackTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: BF53D1C3-49E0-4F7F-8567-5A821D8AC542, 100
DEFINE_PROPERTYKEY(PKEY_Contact_CallbackTelephone, 0xBF53D1C3, 0x49E0, 0x4F7F, 0x85, 0x67, 0x5A, 0x82, 0x1D, 0x8A, 0xC5, 0x42, 100);
// Name: System.Contact.CarTelephone -- PKEY_Contact_CarTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8FDC6DEA-B929-412B-BA90-397A257465FE, 100
DEFINE_PROPERTYKEY(PKEY_Contact_CarTelephone, 0x8FDC6DEA, 0xB929, 0x412B, 0xBA, 0x90, 0x39, 0x7A, 0x25, 0x74, 0x65, 0xFE, 100);
// Name: System.Contact.Children -- PKEY_Contact_Children
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D4729704-8EF1-43EF-9024-2BD381187FD5, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Children, 0xD4729704, 0x8EF1, 0x43EF, 0x90, 0x24, 0x2B, 0xD3, 0x81, 0x18, 0x7F, 0xD5, 100);
// Name: System.Contact.CompanyMainTelephone -- PKEY_Contact_CompanyMainTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8589E481-6040-473D-B171-7FA89C2708ED, 100
DEFINE_PROPERTYKEY(PKEY_Contact_CompanyMainTelephone, 0x8589E481, 0x6040, 0x473D, 0xB1, 0x71, 0x7F, 0xA8, 0x9C, 0x27, 0x08, 0xED, 100);
// Name: System.Contact.Department -- PKEY_Contact_Department
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: FC9F7306-FF8F-4D49-9FB6-3FFE5C0951EC, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Department, 0xFC9F7306, 0xFF8F, 0x4D49, 0x9F, 0xB6, 0x3F, 0xFE, 0x5C, 0x09, 0x51, 0xEC, 100);
// Name: System.Contact.EmailAddress -- PKEY_Contact_EmailAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F8FA7FA3-D12B-4785-8A4E-691A94F7A3E7, 100
DEFINE_PROPERTYKEY(PKEY_Contact_EmailAddress, 0xF8FA7FA3, 0xD12B, 0x4785, 0x8A, 0x4E, 0x69, 0x1A, 0x94, 0xF7, 0xA3, 0xE7, 100);
// Name: System.Contact.EmailAddress2 -- PKEY_Contact_EmailAddress2
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 38965063-EDC8-4268-8491-B7723172CF29, 100
DEFINE_PROPERTYKEY(PKEY_Contact_EmailAddress2, 0x38965063, 0xEDC8, 0x4268, 0x84, 0x91, 0xB7, 0x72, 0x31, 0x72, 0xCF, 0x29, 100);
// Name: System.Contact.EmailAddress3 -- PKEY_Contact_EmailAddress3
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 644D37B4-E1B3-4BAD-B099-7E7C04966ACA, 100
DEFINE_PROPERTYKEY(PKEY_Contact_EmailAddress3, 0x644D37B4, 0xE1B3, 0x4BAD, 0xB0, 0x99, 0x7E, 0x7C, 0x04, 0x96, 0x6A, 0xCA, 100);
// Name: System.Contact.EmailAddresses -- PKEY_Contact_EmailAddresses
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 84D8F337-981D-44B3-9615-C7596DBA17E3, 100
DEFINE_PROPERTYKEY(PKEY_Contact_EmailAddresses, 0x84D8F337, 0x981D, 0x44B3, 0x96, 0x15, 0xC7, 0x59, 0x6D, 0xBA, 0x17, 0xE3, 100);
// Name: System.Contact.EmailName -- PKEY_Contact_EmailName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CC6F4F24-6083-4BD4-8754-674D0DE87AB8, 100
DEFINE_PROPERTYKEY(PKEY_Contact_EmailName, 0xCC6F4F24, 0x6083, 0x4BD4, 0x87, 0x54, 0x67, 0x4D, 0x0D, 0xE8, 0x7A, 0xB8, 100);
// Name: System.Contact.FileAsName -- PKEY_Contact_FileAsName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F1A24AA7-9CA7-40F6-89EC-97DEF9FFE8DB, 100
DEFINE_PROPERTYKEY(PKEY_Contact_FileAsName, 0xF1A24AA7, 0x9CA7, 0x40F6, 0x89, 0xEC, 0x97, 0xDE, 0xF9, 0xFF, 0xE8, 0xDB, 100);
// Name: System.Contact.FirstName -- PKEY_Contact_FirstName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 14977844-6B49-4AAD-A714-A4513BF60460, 100
DEFINE_PROPERTYKEY(PKEY_Contact_FirstName, 0x14977844, 0x6B49, 0x4AAD, 0xA7, 0x14, 0xA4, 0x51, 0x3B, 0xF6, 0x04, 0x60, 100);
// Name: System.Contact.FullName -- PKEY_Contact_FullName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 635E9051-50A5-4BA2-B9DB-4ED056C77296, 100
DEFINE_PROPERTYKEY(PKEY_Contact_FullName, 0x635E9051, 0x50A5, 0x4BA2, 0xB9, 0xDB, 0x4E, 0xD0, 0x56, 0xC7, 0x72, 0x96, 100);
// Name: System.Contact.Gender -- PKEY_Contact_Gender
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 3C8CEE58-D4F0-4CF9-B756-4E5D24447BCD, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Gender, 0x3C8CEE58, 0xD4F0, 0x4CF9, 0xB7, 0x56, 0x4E, 0x5D, 0x24, 0x44, 0x7B, 0xCD, 100);
// Name: System.Contact.Hobbies -- PKEY_Contact_Hobbies
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 5DC2253F-5E11-4ADF-9CFE-910DD01E3E70, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Hobbies, 0x5DC2253F, 0x5E11, 0x4ADF, 0x9C, 0xFE, 0x91, 0x0D, 0xD0, 0x1E, 0x3E, 0x70, 100);
// Name: System.Contact.HomeAddress -- PKEY_Contact_HomeAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 98F98354-617A-46B8-8560-5B1B64BF1F89, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddress, 0x98F98354, 0x617A, 0x46B8, 0x85, 0x60, 0x5B, 0x1B, 0x64, 0xBF, 0x1F, 0x89, 100);
// Name: System.Contact.HomeAddressCity -- PKEY_Contact_HomeAddressCity
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 65
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressCity, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 65);
// Name: System.Contact.HomeAddressCountry -- PKEY_Contact_HomeAddressCountry
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 08A65AA1-F4C9-43DD-9DDF-A33D8E7EAD85, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressCountry, 0x08A65AA1, 0xF4C9, 0x43DD, 0x9D, 0xDF, 0xA3, 0x3D, 0x8E, 0x7E, 0xAD, 0x85, 100);
// Name: System.Contact.HomeAddressPostalCode -- PKEY_Contact_HomeAddressPostalCode
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8AFCC170-8A46-4B53-9EEE-90BAE7151E62, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressPostalCode, 0x8AFCC170, 0x8A46, 0x4B53, 0x9E, 0xEE, 0x90, 0xBA, 0xE7, 0x15, 0x1E, 0x62, 100);
// Name: System.Contact.HomeAddressPostOfficeBox -- PKEY_Contact_HomeAddressPostOfficeBox
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7B9F6399-0A3F-4B12-89BD-4ADC51C918AF, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressPostOfficeBox, 0x7B9F6399, 0x0A3F, 0x4B12, 0x89, 0xBD, 0x4A, 0xDC, 0x51, 0xC9, 0x18, 0xAF, 100);
// Name: System.Contact.HomeAddressState -- PKEY_Contact_HomeAddressState
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C89A23D0-7D6D-4EB8-87D4-776A82D493E5, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressState, 0xC89A23D0, 0x7D6D, 0x4EB8, 0x87, 0xD4, 0x77, 0x6A, 0x82, 0xD4, 0x93, 0xE5, 100);
// Name: System.Contact.HomeAddressStreet -- PKEY_Contact_HomeAddressStreet
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 0ADEF160-DB3F-4308-9A21-06237B16FA2A, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeAddressStreet, 0x0ADEF160, 0xDB3F, 0x4308, 0x9A, 0x21, 0x06, 0x23, 0x7B, 0x16, 0xFA, 0x2A, 100);
// Name: System.Contact.HomeFaxNumber -- PKEY_Contact_HomeFaxNumber
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 660E04D6-81AB-4977-A09F-82313113AB26, 100
DEFINE_PROPERTYKEY(PKEY_Contact_HomeFaxNumber, 0x660E04D6, 0x81AB, 0x4977, 0xA0, 0x9F, 0x82, 0x31, 0x31, 0x13, 0xAB, 0x26, 100);
// Name: System.Contact.HomeTelephone -- PKEY_Contact_HomeTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 20
DEFINE_PROPERTYKEY(PKEY_Contact_HomeTelephone, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 20);
// Name: System.Contact.IMAddress -- PKEY_Contact_IMAddress
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D68DBD8A-3374-4B81-9972-3EC30682DB3D, 100
DEFINE_PROPERTYKEY(PKEY_Contact_IMAddress, 0xD68DBD8A, 0x3374, 0x4B81, 0x99, 0x72, 0x3E, 0xC3, 0x06, 0x82, 0xDB, 0x3D, 100);
// Name: System.Contact.Initials -- PKEY_Contact_Initials
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F3D8F40D-50CB-44A2-9718-40CB9119495D, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Initials, 0xF3D8F40D, 0x50CB, 0x44A2, 0x97, 0x18, 0x40, 0xCB, 0x91, 0x19, 0x49, 0x5D, 100);
// Name: System.Contact.JA.CompanyNamePhonetic -- PKEY_Contact_JA_CompanyNamePhonetic
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 897B3694-FE9E-43E6-8066-260F590C0100, 2
//
//
DEFINE_PROPERTYKEY(PKEY_Contact_JA_CompanyNamePhonetic, 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 2);
// Name: System.Contact.JA.FirstNamePhonetic -- PKEY_Contact_JA_FirstNamePhonetic
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 897B3694-FE9E-43E6-8066-260F590C0100, 3
//
//
DEFINE_PROPERTYKEY(PKEY_Contact_JA_FirstNamePhonetic, 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 3);
// Name: System.Contact.JA.LastNamePhonetic -- PKEY_Contact_JA_LastNamePhonetic
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 897B3694-FE9E-43E6-8066-260F590C0100, 4
//
//
DEFINE_PROPERTYKEY(PKEY_Contact_JA_LastNamePhonetic, 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 4);
// Name: System.Contact.JobTitle -- PKEY_Contact_JobTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 6
DEFINE_PROPERTYKEY(PKEY_Contact_JobTitle, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 6);
// Name: System.Contact.Label -- PKEY_Contact_Label
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 97B0AD89-DF49-49CC-834E-660974FD755B, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Label, 0x97B0AD89, 0xDF49, 0x49CC, 0x83, 0x4E, 0x66, 0x09, 0x74, 0xFD, 0x75, 0x5B, 100);
// Name: System.Contact.LastName -- PKEY_Contact_LastName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8F367200-C270-457C-B1D4-E07C5BCD90C7, 100
DEFINE_PROPERTYKEY(PKEY_Contact_LastName, 0x8F367200, 0xC270, 0x457C, 0xB1, 0xD4, 0xE0, 0x7C, 0x5B, 0xCD, 0x90, 0xC7, 100);
// Name: System.Contact.MailingAddress -- PKEY_Contact_MailingAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C0AC206A-827E-4650-95AE-77E2BB74FCC9, 100
DEFINE_PROPERTYKEY(PKEY_Contact_MailingAddress, 0xC0AC206A, 0x827E, 0x4650, 0x95, 0xAE, 0x77, 0xE2, 0xBB, 0x74, 0xFC, 0xC9, 100);
// Name: System.Contact.MiddleName -- PKEY_Contact_MiddleName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 71
DEFINE_PROPERTYKEY(PKEY_Contact_MiddleName, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 71);
// Name: System.Contact.MobileTelephone -- PKEY_Contact_MobileTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 35
DEFINE_PROPERTYKEY(PKEY_Contact_MobileTelephone, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 35);
// Name: System.Contact.NickName -- PKEY_Contact_NickName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 74
DEFINE_PROPERTYKEY(PKEY_Contact_NickName, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 74);
// Name: System.Contact.OfficeLocation -- PKEY_Contact_OfficeLocation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 7
DEFINE_PROPERTYKEY(PKEY_Contact_OfficeLocation, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 7);
// Name: System.Contact.OtherAddress -- PKEY_Contact_OtherAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 508161FA-313B-43D5-83A1-C1ACCF68622C, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddress, 0x508161FA, 0x313B, 0x43D5, 0x83, 0xA1, 0xC1, 0xAC, 0xCF, 0x68, 0x62, 0x2C, 100);
// Name: System.Contact.OtherAddressCity -- PKEY_Contact_OtherAddressCity
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6E682923-7F7B-4F0C-A337-CFCA296687BF, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressCity, 0x6E682923, 0x7F7B, 0x4F0C, 0xA3, 0x37, 0xCF, 0xCA, 0x29, 0x66, 0x87, 0xBF, 100);
// Name: System.Contact.OtherAddressCountry -- PKEY_Contact_OtherAddressCountry
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8F167568-0AAE-4322-8ED9-6055B7B0E398, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressCountry, 0x8F167568, 0x0AAE, 0x4322, 0x8E, 0xD9, 0x60, 0x55, 0xB7, 0xB0, 0xE3, 0x98, 100);
// Name: System.Contact.OtherAddressPostalCode -- PKEY_Contact_OtherAddressPostalCode
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 95C656C1-2ABF-4148-9ED3-9EC602E3B7CD, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressPostalCode, 0x95C656C1, 0x2ABF, 0x4148, 0x9E, 0xD3, 0x9E, 0xC6, 0x02, 0xE3, 0xB7, 0xCD, 100);
// Name: System.Contact.OtherAddressPostOfficeBox -- PKEY_Contact_OtherAddressPostOfficeBox
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 8B26EA41-058F-43F6-AECC-4035681CE977, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressPostOfficeBox, 0x8B26EA41, 0x058F, 0x43F6, 0xAE, 0xCC, 0x40, 0x35, 0x68, 0x1C, 0xE9, 0x77, 100);
// Name: System.Contact.OtherAddressState -- PKEY_Contact_OtherAddressState
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 71B377D6-E570-425F-A170-809FAE73E54E, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressState, 0x71B377D6, 0xE570, 0x425F, 0xA1, 0x70, 0x80, 0x9F, 0xAE, 0x73, 0xE5, 0x4E, 100);
// Name: System.Contact.OtherAddressStreet -- PKEY_Contact_OtherAddressStreet
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: FF962609-B7D6-4999-862D-95180D529AEA, 100
DEFINE_PROPERTYKEY(PKEY_Contact_OtherAddressStreet, 0xFF962609, 0xB7D6, 0x4999, 0x86, 0x2D, 0x95, 0x18, 0x0D, 0x52, 0x9A, 0xEA, 100);
// Name: System.Contact.PagerTelephone -- PKEY_Contact_PagerTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D6304E01-F8F5-4F45-8B15-D024A6296789, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PagerTelephone, 0xD6304E01, 0xF8F5, 0x4F45, 0x8B, 0x15, 0xD0, 0x24, 0xA6, 0x29, 0x67, 0x89, 100);
// Name: System.Contact.PersonalTitle -- PKEY_Contact_PersonalTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 69
DEFINE_PROPERTYKEY(PKEY_Contact_PersonalTitle, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 69);
// Name: System.Contact.PrimaryAddressCity -- PKEY_Contact_PrimaryAddressCity
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C8EA94F0-A9E3-4969-A94B-9C62A95324E0, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressCity, 0xC8EA94F0, 0xA9E3, 0x4969, 0xA9, 0x4B, 0x9C, 0x62, 0xA9, 0x53, 0x24, 0xE0, 100);
// Name: System.Contact.PrimaryAddressCountry -- PKEY_Contact_PrimaryAddressCountry
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E53D799D-0F3F-466E-B2FF-74634A3CB7A4, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressCountry, 0xE53D799D, 0x0F3F, 0x466E, 0xB2, 0xFF, 0x74, 0x63, 0x4A, 0x3C, 0xB7, 0xA4, 100);
// Name: System.Contact.PrimaryAddressPostalCode -- PKEY_Contact_PrimaryAddressPostalCode
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 18BBD425-ECFD-46EF-B612-7B4A6034EDA0, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressPostalCode, 0x18BBD425, 0xECFD, 0x46EF, 0xB6, 0x12, 0x7B, 0x4A, 0x60, 0x34, 0xED, 0xA0, 100);
// Name: System.Contact.PrimaryAddressPostOfficeBox -- PKEY_Contact_PrimaryAddressPostOfficeBox
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DE5EF3C7-46E1-484E-9999-62C5308394C1, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressPostOfficeBox, 0xDE5EF3C7, 0x46E1, 0x484E, 0x99, 0x99, 0x62, 0xC5, 0x30, 0x83, 0x94, 0xC1, 100);
// Name: System.Contact.PrimaryAddressState -- PKEY_Contact_PrimaryAddressState
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F1176DFE-7138-4640-8B4C-AE375DC70A6D, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressState, 0xF1176DFE, 0x7138, 0x4640, 0x8B, 0x4C, 0xAE, 0x37, 0x5D, 0xC7, 0x0A, 0x6D, 100);
// Name: System.Contact.PrimaryAddressStreet -- PKEY_Contact_PrimaryAddressStreet
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 63C25B20-96BE-488F-8788-C09C407AD812, 100
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryAddressStreet, 0x63C25B20, 0x96BE, 0x488F, 0x87, 0x88, 0xC0, 0x9C, 0x40, 0x7A, 0xD8, 0x12, 100);
// Name: System.Contact.PrimaryEmailAddress -- PKEY_Contact_PrimaryEmailAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 48
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryEmailAddress, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 48);
// Name: System.Contact.PrimaryTelephone -- PKEY_Contact_PrimaryTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 25
DEFINE_PROPERTYKEY(PKEY_Contact_PrimaryTelephone, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 25);
// Name: System.Contact.Profession -- PKEY_Contact_Profession
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7268AF55-1CE4-4F6E-A41F-B6E4EF10E4A9, 100
DEFINE_PROPERTYKEY(PKEY_Contact_Profession, 0x7268AF55, 0x1CE4, 0x4F6E, 0xA4, 0x1F, 0xB6, 0xE4, 0xEF, 0x10, 0xE4, 0xA9, 100);
// Name: System.Contact.SpouseName -- PKEY_Contact_SpouseName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 9D2408B6-3167-422B-82B0-F583B7A7CFE3, 100
DEFINE_PROPERTYKEY(PKEY_Contact_SpouseName, 0x9D2408B6, 0x3167, 0x422B, 0x82, 0xB0, 0xF5, 0x83, 0xB7, 0xA7, 0xCF, 0xE3, 100);
// Name: System.Contact.Suffix -- PKEY_Contact_Suffix
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 176DC63C-2688-4E89-8143-A347800F25E9, 73
DEFINE_PROPERTYKEY(PKEY_Contact_Suffix, 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 73);
// Name: System.Contact.TelexNumber -- PKEY_Contact_TelexNumber
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C554493C-C1F7-40C1-A76C-EF8C0614003E, 100
DEFINE_PROPERTYKEY(PKEY_Contact_TelexNumber, 0xC554493C, 0xC1F7, 0x40C1, 0xA7, 0x6C, 0xEF, 0x8C, 0x06, 0x14, 0x00, 0x3E, 100);
// Name: System.Contact.TTYTDDTelephone -- PKEY_Contact_TTYTDDTelephone
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: AAF16BAC-2B55-45E6-9F6D-415EB94910DF, 100
DEFINE_PROPERTYKEY(PKEY_Contact_TTYTDDTelephone, 0xAAF16BAC, 0x2B55, 0x45E6, 0x9F, 0x6D, 0x41, 0x5E, 0xB9, 0x49, 0x10, 0xDF, 100);
// Name: System.Contact.WebPage -- PKEY_Contact_WebPage
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 18
DEFINE_PROPERTYKEY(PKEY_Contact_WebPage, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 18);
//-----------------------------------------------------------------------------
// Core properties
// Name: System.AcquisitionID -- PKEY_AcquisitionID
// Type: Int32 -- VT_I4
// FormatID: 65A98875-3C80-40AB-ABBC-EFDAF77DBEE2, 100
//
// Hash to determine acquisition session.
DEFINE_PROPERTYKEY(PKEY_AcquisitionID, 0x65A98875, 0x3C80, 0x40AB, 0xAB, 0xBC, 0xEF, 0xDA, 0xF7, 0x7D, 0xBE, 0xE2, 100);
// Name: System.ApplicationName -- PKEY_ApplicationName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR) Legacy code may treat this as VT_LPSTR.
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 18 (PIDSI_APPNAME)
//
//
DEFINE_PROPERTYKEY(PKEY_ApplicationName, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 18);
// Name: System.Author -- PKEY_Author
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR) Legacy code may treat this as VT_LPSTR.
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 4 (PIDSI_AUTHOR)
//
//
DEFINE_PROPERTYKEY(PKEY_Author, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 4);
// Name: System.Capacity -- PKEY_Capacity
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 3 (PID_VOLUME_CAPACITY) (Filesystem Volume Properties)
//
// The amount of total space in bytes.
DEFINE_PROPERTYKEY(PKEY_Capacity, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 3);
// Name: System.Category -- PKEY_Category
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 2 (PIDDSI_CATEGORY)
//
// Legacy code treats this as VT_LPSTR.
DEFINE_PROPERTYKEY(PKEY_Category, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 2);
// Name: System.Comment -- PKEY_Comment
// Type: String -- VT_LPWSTR (For variants: VT_BSTR) Legacy code may treat this as VT_LPSTR.
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 6 (PIDSI_COMMENTS)
//
// Comments.
DEFINE_PROPERTYKEY(PKEY_Comment, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 6);
// Name: System.Company -- PKEY_Company
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 15 (PIDDSI_COMPANY)
//
// The company or publisher.
DEFINE_PROPERTYKEY(PKEY_Company, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 15);
// Name: System.ComputerName -- PKEY_ComputerName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 5 (PID_COMPUTERNAME)
//
//
DEFINE_PROPERTYKEY(PKEY_ComputerName, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 5);
// Name: System.ContainedItems -- PKEY_ContainedItems
// Type: Multivalue Guid -- VT_VECTOR | VT_CLSID (For variants: VT_ARRAY | VT_CLSID)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 29
//
// The list of type of items, this item contains. For example, this item contains urls, attachments etc.
// This is represented as a vector array of GUIDs where each GUID represents certain type.
DEFINE_PROPERTYKEY(PKEY_ContainedItems, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 29);
// Name: System.ContentStatus -- PKEY_ContentStatus
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 27
DEFINE_PROPERTYKEY(PKEY_ContentStatus, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 27);
// Name: System.ContentType -- PKEY_ContentType
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 26
DEFINE_PROPERTYKEY(PKEY_ContentType, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 26);
// Name: System.Copyright -- PKEY_Copyright
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 11 (PIDMSI_COPYRIGHT)
//
//
DEFINE_PROPERTYKEY(PKEY_Copyright, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 11);
// Name: System.DateAccessed -- PKEY_DateAccessed
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 16 (PID_STG_ACCESSTIME)
//
// The time of the last access to the item. The Indexing Service friendly name is 'access'.
DEFINE_PROPERTYKEY(PKEY_DateAccessed, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 16);
// Name: System.DateAcquired -- PKEY_DateAcquired
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 2CBAA8F5-D81F-47CA-B17A-F8D822300131, 100
//
// The time the file entered the system via acquisition. This is not the same as System.DateImported.
// Examples are when pictures are acquired from a camera, or when music is purchased online.
DEFINE_PROPERTYKEY(PKEY_DateAcquired, 0x2CBAA8F5, 0xD81F, 0x47CA, 0xB1, 0x7A, 0xF8, 0xD8, 0x22, 0x30, 0x01, 0x31, 100);
// Name: System.DateArchived -- PKEY_DateArchived
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 43F8D7B7-A444-4F87-9383-52271C9B915C, 100
DEFINE_PROPERTYKEY(PKEY_DateArchived, 0x43F8D7B7, 0xA444, 0x4F87, 0x93, 0x83, 0x52, 0x27, 0x1C, 0x9B, 0x91, 0x5C, 100);
// Name: System.DateCompleted -- PKEY_DateCompleted
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 72FAB781-ACDA-43E5-B155-B2434F85E678, 100
DEFINE_PROPERTYKEY(PKEY_DateCompleted, 0x72FAB781, 0xACDA, 0x43E5, 0xB1, 0x55, 0xB2, 0x43, 0x4F, 0x85, 0xE6, 0x78, 100);
// Name: System.DateCreated -- PKEY_DateCreated
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 15 (PID_STG_CREATETIME)
//
// The date and time the item was created. The Indexing Service friendly name is 'create'.
DEFINE_PROPERTYKEY(PKEY_DateCreated, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 15);
// Name: System.DateImported -- PKEY_DateImported
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 18258
//
// The time the file is imported into a separate database. This is not the same as System.DateAcquired. (Eg, 2003:05:22 13:55:04)
DEFINE_PROPERTYKEY(PKEY_DateImported, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 18258);
// Name: System.DateModified -- PKEY_DateModified
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 14 (PID_STG_WRITETIME)
//
// The date and time of the last write to the item. The Indexing Service friendly name is 'write'.
DEFINE_PROPERTYKEY(PKEY_DateModified, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 14);
// Name: System.DueDate -- PKEY_DueDate
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 3F8472B5-E0AF-4DB2-8071-C53FE76AE7CE, 100
DEFINE_PROPERTYKEY(PKEY_DueDate, 0x3F8472B5, 0xE0AF, 0x4DB2, 0x80, 0x71, 0xC5, 0x3F, 0xE7, 0x6A, 0xE7, 0xCE, 100);
// Name: System.EndDate -- PKEY_EndDate
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: C75FAA05-96FD-49E7-9CB4-9F601082D553, 100
DEFINE_PROPERTYKEY(PKEY_EndDate, 0xC75FAA05, 0x96FD, 0x49E7, 0x9C, 0xB4, 0x9F, 0x60, 0x10, 0x82, 0xD5, 0x53, 100);
// Name: System.FileAllocationSize -- PKEY_FileAllocationSize
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 18 (PID_STG_ALLOCSIZE)
//
//
DEFINE_PROPERTYKEY(PKEY_FileAllocationSize, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 18);
// Name: System.FileAttributes -- PKEY_FileAttributes
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 13 (PID_STG_ATTRIBUTES)
//
// This is the WIN32_FIND_DATA dwFileAttributes for the file-based item.
DEFINE_PROPERTYKEY(PKEY_FileAttributes, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 13);
// Name: System.FileCount -- PKEY_FileCount
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 12
//
//
DEFINE_PROPERTYKEY(PKEY_FileCount, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 12);
// Name: System.FileDescription -- PKEY_FileDescription
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSFMTID_VERSION) 0CEF7D53-FA64-11D1-A203-0000F81FEDEE, 3 (PIDVSI_FileDescription)
//
// This is a user-friendly description of the file.
DEFINE_PROPERTYKEY(PKEY_FileDescription, 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 3);
// Name: System.FileExtension -- PKEY_FileExtension
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E4F10A3C-49E6-405D-8288-A23BD4EEAA6C, 100
//
// This is the file extension of the file based item, including the leading period.
//
// If System.FileName is VT_EMPTY, then this property should be too. Otherwise, it should be derived
// appropriately by the data source from System.FileName. If System.FileName does not have a file
// extension, this value should be VT_EMPTY.
//
// To obtain the type of any item (including an item that is not a file), use System.ItemType.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" ".txt"
// "\\server\share\mydir\goodnews.doc" ".doc"
// "\\server\share\numbers.xls" ".xls"
// "\\server\share\folder" VT_EMPTY
// "c:\foo\MyFolder" VT_EMPTY
// [desktop] VT_EMPTY
DEFINE_PROPERTYKEY(PKEY_FileExtension, 0xE4F10A3C, 0x49E6, 0x405D, 0x82, 0x88, 0xA2, 0x3B, 0xD4, 0xEE, 0xAA, 0x6C, 100);
// Name: System.FileFRN -- PKEY_FileFRN
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 21 (PID_STG_FRN)
//
// This is the unique file ID, also known as the File Reference Number. For a given file, this is the same value
// as is found in the structure variable FILE_ID_BOTH_DIR_INFO.FileId, via GetFileInformationByHandleEx().
DEFINE_PROPERTYKEY(PKEY_FileFRN, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 21);
// Name: System.FileName -- PKEY_FileName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 41CF5AE0-F75A-4806-BD87-59C7D9248EB9, 100
//
// This is the file name (including extension) of the file.
//
// It is possible that the item might not exist on a filesystem (ie, it may not be opened
// using CreateFile). Nonetheless, if the item is represented as a file from the logical sense
// (and its name follows standard Win32 file-naming syntax), then the data source should emit this property.
//
// If an item is not a file, then the value for this property is VT_EMPTY. See
// System.ItemNameDisplay.
//
// This has the same value as System.ParsingName for items that are provided by the Shell's file folder.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "hello.txt"
// "\\server\share\mydir\goodnews.doc" "goodnews.doc"
// "\\server\share\numbers.xls" "numbers.xls"
// "c:\foo\MyFolder" "MyFolder"
// (email message) VT_EMPTY
// (song on portable device) "song.wma"
DEFINE_PROPERTYKEY(PKEY_FileName, 0x41CF5AE0, 0xF75A, 0x4806, 0xBD, 0x87, 0x59, 0xC7, 0xD9, 0x24, 0x8E, 0xB9, 100);
// Name: System.FileOwner -- PKEY_FileOwner
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Misc) 9B174B34-40FF-11D2-A27E-00C04FC30871, 4 (PID_MISC_OWNER)
//
// This is the owner of the file, according to the file system.
DEFINE_PROPERTYKEY(PKEY_FileOwner, 0x9B174B34, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 4);
// Name: System.FileVersion -- PKEY_FileVersion
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSFMTID_VERSION) 0CEF7D53-FA64-11D1-A203-0000F81FEDEE, 4 (PIDVSI_FileVersion)
//
//
DEFINE_PROPERTYKEY(PKEY_FileVersion, 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 4);
// Name: System.FindData -- PKEY_FindData
// Type: Buffer -- VT_VECTOR | VT_UI1 (For variants: VT_ARRAY | VT_UI1)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 0 (PID_FINDDATA)
//
// WIN32_FIND_DATAW in buffer of bytes.
DEFINE_PROPERTYKEY(PKEY_FindData, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 0);
// Name: System.FlagColor -- PKEY_FlagColor
// Type: UInt16 -- VT_UI2
// FormatID: 67DF94DE-0CA7-4D6F-B792-053A3E4F03CF, 100
//
//
DEFINE_PROPERTYKEY(PKEY_FlagColor, 0x67DF94DE, 0x0CA7, 0x4D6F, 0xB7, 0x92, 0x05, 0x3A, 0x3E, 0x4F, 0x03, 0xCF, 100);
// Possible discrete values for PKEY_FlagColor are:
#define FLAGCOLOR_PURPLE 1u
#define FLAGCOLOR_ORANGE 2u
#define FLAGCOLOR_GREEN 3u
#define FLAGCOLOR_YELLOW 4u
#define FLAGCOLOR_BLUE 5u
#define FLAGCOLOR_RED 6u
// Name: System.FlagColorText -- PKEY_FlagColorText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 45EAE747-8E2A-40AE-8CBF-CA52ABA6152A, 100
//
// This is the user-friendly form of System.FlagColor. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_FlagColorText, 0x45EAE747, 0x8E2A, 0x40AE, 0x8C, 0xBF, 0xCA, 0x52, 0xAB, 0xA6, 0x15, 0x2A, 100);
// Name: System.FlagStatus -- PKEY_FlagStatus
// Type: Int32 -- VT_I4
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 12
//
// Status of Flag. Values: (0=none 1=white 2=Red). cdoPR_FLAG_STATUS
DEFINE_PROPERTYKEY(PKEY_FlagStatus, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 12);
// Possible discrete values for PKEY_FlagStatus are:
#define FLAGSTATUS_NOTFLAGGED 0l
#define FLAGSTATUS_COMPLETED 1l
#define FLAGSTATUS_FOLLOWUP 2l
// Name: System.FlagStatusText -- PKEY_FlagStatusText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DC54FD2E-189D-4871-AA01-08C2F57A4ABC, 100
//
// This is the user-friendly form of System.FlagStatus. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_FlagStatusText, 0xDC54FD2E, 0x189D, 0x4871, 0xAA, 0x01, 0x08, 0xC2, 0xF5, 0x7A, 0x4A, 0xBC, 100);
// Name: System.FreeSpace -- PKEY_FreeSpace
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 2 (PID_VOLUME_FREE) (Filesystem Volume Properties)
//
// The amount of free space in bytes.
DEFINE_PROPERTYKEY(PKEY_FreeSpace, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 2);
// Name: System.Identity -- PKEY_Identity
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A26F4AFC-7346-4299-BE47-EB1AE613139F, 100
DEFINE_PROPERTYKEY(PKEY_Identity, 0xA26F4AFC, 0x7346, 0x4299, 0xBE, 0x47, 0xEB, 0x1A, 0xE6, 0x13, 0x13, 0x9F, 100);
// Name: System.Importance -- PKEY_Importance
// Type: Int32 -- VT_I4
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 11
DEFINE_PROPERTYKEY(PKEY_Importance, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 11);
// Possible range of values for PKEY_Importance are:
#define IMPORTANCE_LOW_MIN 0l
#define IMPORTANCE_LOW_SET 1l
#define IMPORTANCE_LOW_MAX 1l
#define IMPORTANCE_NORMAL_MIN 2l
#define IMPORTANCE_NORMAL_SET 3l
#define IMPORTANCE_NORMAL_MAX 4l
#define IMPORTANCE_HIGH_MIN 5l
#define IMPORTANCE_HIGH_SET 5l
#define IMPORTANCE_HIGH_MAX 5l
// Name: System.ImportanceText -- PKEY_ImportanceText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A3B29791-7713-4E1D-BB40-17DB85F01831, 100
//
// This is the user-friendly form of System.Importance. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_ImportanceText, 0xA3B29791, 0x7713, 0x4E1D, 0xBB, 0x40, 0x17, 0xDB, 0x85, 0xF0, 0x18, 0x31, 100);
// Name: System.IsAttachment -- PKEY_IsAttachment
// Type: Boolean -- VT_BOOL
// FormatID: F23F425C-71A1-4FA8-922F-678EA4A60408, 100
//
// Identifies if this item is an attachment.
DEFINE_PROPERTYKEY(PKEY_IsAttachment, 0xF23F425C, 0x71A1, 0x4FA8, 0x92, 0x2F, 0x67, 0x8E, 0xA4, 0xA6, 0x04, 0x08, 100);
// Name: System.IsDeleted -- PKEY_IsDeleted
// Type: Boolean -- VT_BOOL
// FormatID: 5CDA5FC8-33EE-4FF3-9094-AE7BD8868C4D, 100
DEFINE_PROPERTYKEY(PKEY_IsDeleted, 0x5CDA5FC8, 0x33EE, 0x4FF3, 0x90, 0x94, 0xAE, 0x7B, 0xD8, 0x86, 0x8C, 0x4D, 100);
// Name: System.IsFlagged -- PKEY_IsFlagged
// Type: Boolean -- VT_BOOL
// FormatID: 5DA84765-E3FF-4278-86B0-A27967FBDD03, 100
DEFINE_PROPERTYKEY(PKEY_IsFlagged, 0x5DA84765, 0xE3FF, 0x4278, 0x86, 0xB0, 0xA2, 0x79, 0x67, 0xFB, 0xDD, 0x03, 100);
// Name: System.IsFlaggedComplete -- PKEY_IsFlaggedComplete
// Type: Boolean -- VT_BOOL
// FormatID: A6F360D2-55F9-48DE-B909-620E090A647C, 100
DEFINE_PROPERTYKEY(PKEY_IsFlaggedComplete, 0xA6F360D2, 0x55F9, 0x48DE, 0xB9, 0x09, 0x62, 0x0E, 0x09, 0x0A, 0x64, 0x7C, 100);
// Name: System.IsIncomplete -- PKEY_IsIncomplete
// Type: Boolean -- VT_BOOL
// FormatID: 346C8BD1-2E6A-4C45-89A4-61B78E8E700F, 100
//
// Identifies if the message was not completely received for some error condition.
DEFINE_PROPERTYKEY(PKEY_IsIncomplete, 0x346C8BD1, 0x2E6A, 0x4C45, 0x89, 0xA4, 0x61, 0xB7, 0x8E, 0x8E, 0x70, 0x0F, 100);
// Name: System.IsRead -- PKEY_IsRead
// Type: Boolean -- VT_BOOL
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 10
//
// Has the item been read?
DEFINE_PROPERTYKEY(PKEY_IsRead, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 10);
// Name: System.IsSendToTarget -- PKEY_IsSendToTarget
// Type: Boolean -- VT_BOOL
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 33
//
// Provided by certain shell folders. Return TRUE if the folder is a valid Send To target.
DEFINE_PROPERTYKEY(PKEY_IsSendToTarget, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 33);
// Name: System.IsShared -- PKEY_IsShared
// Type: Boolean -- VT_BOOL
// FormatID: EF884C5B-2BFE-41BB-AAE5-76EEDF4F9902, 100
//
// Is this item shared?
DEFINE_PROPERTYKEY(PKEY_IsShared, 0xEF884C5B, 0x2BFE, 0x41BB, 0xAA, 0xE5, 0x76, 0xEE, 0xDF, 0x4F, 0x99, 0x02, 100);
// Name: System.ItemAuthors -- PKEY_ItemAuthors
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D0A04F0A-462A-48A4-BB2F-3706E88DBD7D, 100
//
// This is the generic list of authors associated with an item.
//
// For example, the artist name for a track is the item author.
DEFINE_PROPERTYKEY(PKEY_ItemAuthors, 0xD0A04F0A, 0x462A, 0x48A4, 0xBB, 0x2F, 0x37, 0x06, 0xE8, 0x8D, 0xBD, 0x7D, 100);
// Name: System.ItemDate -- PKEY_ItemDate
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: F7DB74B4-4287-4103-AFBA-F1B13DCD75CF, 100
//
// This is the main date for an item. The date of interest.
//
// For example, for photos this maps to System.Photo.DateTaken.
DEFINE_PROPERTYKEY(PKEY_ItemDate, 0xF7DB74B4, 0x4287, 0x4103, 0xAF, 0xBA, 0xF1, 0xB1, 0x3D, 0xCD, 0x75, 0xCF, 100);
// Name: System.ItemFolderNameDisplay -- PKEY_ItemFolderNameDisplay
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 2 (PID_STG_DIRECTORY)
//
// This is the user-friendly display name of the parent folder of an item.
//
// If System.ItemFolderPathDisplay is VT_EMPTY, then this property should be too. Otherwise, it
// should be derived appropriately by the data source from System.ItemFolderPathDisplay.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "bar"
// "\\server\share\mydir\goodnews.doc" "mydir"
// "\\server\share\numbers.xls" "share"
// "c:\foo\MyFolder" "foo"
// "/Mailbox Account/Inbox/'Re: Hello!'" "Inbox"
DEFINE_PROPERTYKEY(PKEY_ItemFolderNameDisplay, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 2);
// Name: System.ItemFolderPathDisplay -- PKEY_ItemFolderPathDisplay
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 6
//
// This is the user-friendly display path of the parent folder of an item.
//
// If System.ItemPathDisplay is VT_EMPTY, then this property should be too. Otherwise, it should
// be derived appropriately by the data source from System.ItemPathDisplay.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "c:\foo\bar"
// "\\server\share\mydir\goodnews.doc" "\\server\share\mydir"
// "\\server\share\numbers.xls" "\\server\share"
// "c:\foo\MyFolder" "c:\foo"
// "/Mailbox Account/Inbox/'Re: Hello!'" "/Mailbox Account/Inbox"
DEFINE_PROPERTYKEY(PKEY_ItemFolderPathDisplay, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 6);
// Name: System.ItemFolderPathDisplayNarrow -- PKEY_ItemFolderPathDisplayNarrow
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DABD30ED-0043-4789-A7F8-D013A4736622, 100
//
// This is the user-friendly display path of the parent folder of an item. The format of the string
// should be tailored such that the folder name comes first, to optimize for a narrow viewing column.
//
// If the folder is a file folder, the value includes localized names if they are present.
//
// If System.ItemFolderPathDisplay is VT_EMPTY, then this property should be too. Otherwise, it should
// be derived appropriately by the data source from System.ItemFolderPathDisplay.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "bar (c:\foo)"
// "\\server\share\mydir\goodnews.doc" "mydir (\\server\share)"
// "\\server\share\numbers.xls" "share (\\server)"
// "c:\foo\MyFolder" "foo (c:\)"
// "/Mailbox Account/Inbox/'Re: Hello!'" "Inbox (/Mailbox Account)"
DEFINE_PROPERTYKEY(PKEY_ItemFolderPathDisplayNarrow, 0xDABD30ED, 0x0043, 0x4789, 0xA7, 0xF8, 0xD0, 0x13, 0xA4, 0x73, 0x66, 0x22, 100);
// Name: System.ItemName -- PKEY_ItemName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6B8DA074-3B5C-43BC-886F-0A2CDCE00B6F, 100
//
// This is the base-name of the System.ItemNameDisplay.
//
// If the item is a file this property
// includes the extension in all cases, and will be localized if a localized name is available.
//
// If the item is a message, then the value of this property does not include the forwarding or
// reply prefixes (see System.ItemNamePrefix).
DEFINE_PROPERTYKEY(PKEY_ItemName, 0x6B8DA074, 0x3B5C, 0x43BC, 0x88, 0x6F, 0x0A, 0x2C, 0xDC, 0xE0, 0x0B, 0x6F, 100);
// Name: System.ItemNameDisplay -- PKEY_ItemNameDisplay
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 10 (PID_STG_NAME)
//
// This is the display name in "most complete" form. This is the best effort unique representation
// of the name of an item that makes sense for end users to read. It is the concatentation of
// System.ItemNamePrefix and System.ItemName.
//
// If the item is a file this property
// includes the extension in all cases, and will be localized if a localized name is available.
//
// There are acceptable cases when System.FileName is not VT_EMPTY, yet the value of this property
// is completely different. Email messages are a key example. If the item is an email message,
// the item name is likely the subject. In that case, the value must be the concatenation of the
// System.ItemNamePrefix and System.ItemName. Since the value of System.ItemNamePrefix excludes
// any trailing whitespace, the concatenation must include a whitespace when generating System.ItemNameDisplay.
//
// Note that this property is not guaranteed to be unique, but the idea is to promote the most likely
// candidate that can be unique and also makes sense for end users. For example, for documents, you
// might think about using System.Title as the System.ItemNameDisplay, but in practice the title of
// the documents may not be useful or unique enough to be of value as the sole System.ItemNameDisplay.
// Instead, providing the value of System.FileName as the value of System.ItemNameDisplay is a better
// candidate. In Windows Mail, the emails are stored in the file system as .eml files and the
// System.FileName for those files are not human-friendly as they contain GUIDs. In this example,
// promoting System.Subject as System.ItemNameDisplay makes more sense.
//
// Compatibility notes:
//
// Shell folder implementations on Vista: use PKEY_ItemNameDisplay for the name column when
// you want Explorer to call ISF::GetDisplayNameOf(SHGDN_NORMAL) to get the value of the name. Use
// another PKEY (like PKEY_ItemName) when you want Explorer to call either the folder's property store or
// ISF2::GetDetailsEx in order to get the value of the name.
//
// Shell folder implementations on XP: the first column needs to be the name column, and Explorer
// will call ISF::GetDisplayNameOf to get the value of the name. The PKEY/SCID does not matter.
//
// Example values:
//
// File: "hello.txt"
// Message: "Re: Let's talk about Tom's argyle socks!"
// Device folder: "song.wma"
// Folder: "Documents"
DEFINE_PROPERTYKEY(PKEY_ItemNameDisplay, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 10);
// Name: System.ItemNamePrefix -- PKEY_ItemNamePrefix
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D7313FF1-A77A-401C-8C99-3DBDD68ADD36, 100
//
// This is the prefix of an item, used for email messages.
// where the subject begins with "Re:" which is the prefix.
//
// If the item is a file, then the value of this property is VT_EMPTY.
//
// If the item is a message, then the value of this property is the forwarding or reply
// prefixes (including delimiting colon, but no whitespace), or VT_EMPTY if there is no prefix.
//
// Example values:
//
// System.ItemNamePrefix System.ItemName System.ItemNameDisplay
// --------------------- ------------------- ----------------------
// VT_EMPTY "Great day" "Great day"
// "Re:" "Great day" "Re: Great day"
// "Fwd: " "Monthly budget" "Fwd: Monthly budget"
// VT_EMPTY "accounts.xls" "accounts.xls"
DEFINE_PROPERTYKEY(PKEY_ItemNamePrefix, 0xD7313FF1, 0xA77A, 0x401C, 0x8C, 0x99, 0x3D, 0xBD, 0xD6, 0x8A, 0xDD, 0x36, 100);
// Name: System.ItemParticipants -- PKEY_ItemParticipants
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D4D0AA16-9948-41A4-AA85-D97FF9646993, 100
//
// This is the generic list of people associated with an item and who contributed
// to the item.
//
// For example, this is the combination of people in the To list, Cc list and
// sender of an email message.
DEFINE_PROPERTYKEY(PKEY_ItemParticipants, 0xD4D0AA16, 0x9948, 0x41A4, 0xAA, 0x85, 0xD9, 0x7F, 0xF9, 0x64, 0x69, 0x93, 100);
// Name: System.ItemPathDisplay -- PKEY_ItemPathDisplay
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 7
//
// This is the user-friendly display path to the item.
//
// If the item is a file or folder this property
// includes the extension in all cases, and will be localized if a localized name is available.
//
// For other items,this is the user-friendly equivalent, assuming the item exists in hierarchical storage.
//
// Unlike System.ItemUrl, this property value does not include the URL scheme.
//
// To parse an item path, use System.ItemUrl or System.ParsingPath. To reference shell
// namespace items using shell APIs, use System.ParsingPath.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "c:\foo\bar\hello.txt"
// "\\server\share\mydir\goodnews.doc" "\\server\share\mydir\goodnews.doc"
// "\\server\share\numbers.xls" "\\server\share\numbers.xls"
// "c:\foo\MyFolder" "c:\foo\MyFolder"
// "/Mailbox Account/Inbox/'Re: Hello!'" "/Mailbox Account/Inbox/'Re: Hello!'"
DEFINE_PROPERTYKEY(PKEY_ItemPathDisplay, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 7);
// Name: System.ItemPathDisplayNarrow -- PKEY_ItemPathDisplayNarrow
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 8
//
// This is the user-friendly display path to the item. The format of the string should be
// tailored such that the name comes first, to optimize for a narrow viewing column.
//
// If the item is a file, the value excludes the file extension, and includes localized names if they are present.
// If the item is a message, the value includes the System.ItemNamePrefix.
//
// To parse an item path, use System.ItemUrl or System.ParsingPath.
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "hello (c:\foo\bar)"
// "\\server\share\mydir\goodnews.doc" "goodnews (\\server\share\mydir)"
// "\\server\share\folder" "folder (\\server\share)"
// "c:\foo\MyFolder" "MyFolder (c:\foo)"
// "/Mailbox Account/Inbox/'Re: Hello!'" "Re: Hello! (/Mailbox Account/Inbox)"
DEFINE_PROPERTYKEY(PKEY_ItemPathDisplayNarrow, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 8);
// Name: System.ItemType -- PKEY_ItemType
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 11
//
// This is the canonical type of the item and is intended to be programmatically
// parsed.
//
// If there is no canonical type, the value is VT_EMPTY.
//
// If the item is a file (ie, System.FileName is not VT_EMPTY), the value is the same as
// System.FileExtension.
//
// Use System.ItemTypeText when you want to display the type to end users in a view. (If
// the item is a file, passing the System.ItemType value to PSFormatForDisplay will
// result in the same value as System.ItemTypeText.)
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" ".txt"
// "\\server\share\mydir\goodnews.doc" ".doc"
// "\\server\share\folder" "Directory"
// "c:\foo\MyFolder" "Directory"
// [desktop] "Folder"
// "/Mailbox Account/Inbox/'Re: Hello!'" "MAPI/IPM.Message"
DEFINE_PROPERTYKEY(PKEY_ItemType, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 11);
// Name: System.ItemTypeText -- PKEY_ItemTypeText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 4 (PID_STG_STORAGETYPE)
//
// This is the user friendly type name of the item. This is not intended to be
// programmatically parsed.
//
// If System.ItemType is VT_EMPTY, the value of this property is also VT_EMPTY.
//
// If the item is a file, the value of this property is the same as if you passed the
// file's System.ItemType value to PSFormatForDisplay.
//
// This property should not be confused with System.Kind, where System.Kind is a high-level
// user friendly kind name. For example, for a document, System.Kind = "Document" and
// System.Item.Type = ".doc" and System.Item.TypeText = "Microsoft Word Document"
//
// Example values:
//
// If the path is... The property value is...
// ----------------- ------------------------
// "c:\foo\bar\hello.txt" "Text File"
// "\\server\share\mydir\goodnews.doc" "Microsoft Word Document"
// "\\server\share\folder" "File Folder"
// "c:\foo\MyFolder" "File Folder"
// "/Mailbox Account/Inbox/'Re: Hello!'" "Outlook E-Mail Message"
DEFINE_PROPERTYKEY(PKEY_ItemTypeText, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 4);
// Name: System.ItemUrl -- PKEY_ItemUrl
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Query) 49691C90-7E17-101A-A91C-08002B2ECDA9, 9 (PROPID_QUERY_VIRTUALPATH)
//
// This always represents a well formed URL that points to the item.
//
// To reference shell namespace items using shell APIs, use System.ParsingPath.
//
// Example values:
//
// Files: "file:///c:/foo/bar/hello.txt"
// "csc://{GUID}/..."
// Messages: "mapi://..."
DEFINE_PROPERTYKEY(PKEY_ItemUrl, 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 9);
// Name: System.Keywords -- PKEY_Keywords
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR) Legacy code may treat this as VT_LPSTR.
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 5 (PIDSI_KEYWORDS)
//
// The keywords for the item. Also referred to as tags.
DEFINE_PROPERTYKEY(PKEY_Keywords, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 5);
// Name: System.Kind -- PKEY_Kind
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 1E3EE840-BC2B-476C-8237-2ACD1A839B22, 3
//
// System.Kind is used to map extensions to various .Search folders.
// Extensions are mapped to Kinds at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\KindMap
// The list of kinds is not extensible.
DEFINE_PROPERTYKEY(PKEY_Kind, 0x1E3EE840, 0xBC2B, 0x476C, 0x82, 0x37, 0x2A, 0xCD, 0x1A, 0x83, 0x9B, 0x22, 3);
// Possible discrete values for PKEY_Kind are:
#define KIND_CALENDAR L"calendar"
#define KIND_COMMUNICATION L"communication"
#define KIND_CONTACT L"contact"
#define KIND_DOCUMENT L"document"
#define KIND_EMAIL L"email"
#define KIND_FEED L"feed"
#define KIND_FOLDER L"folder"
#define KIND_GAME L"game"
#define KIND_INSTANTMESSAGE L"instantmessage"
#define KIND_JOURNAL L"journal"
#define KIND_LINK L"link"
#define KIND_MOVIE L"movie"
#define KIND_MUSIC L"music"
#define KIND_NOTE L"note"
#define KIND_PICTURE L"picture"
#define KIND_PROGRAM L"program"
#define KIND_RECORDEDTV L"recordedtv"
#define KIND_SEARCHFOLDER L"searchfolder"
#define KIND_TASK L"task"
#define KIND_VIDEO L"video"
#define KIND_WEBHISTORY L"webhistory"
// Name: System.KindText -- PKEY_KindText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F04BEF95-C585-4197-A2B7-DF46FDC9EE6D, 100
//
// This is the user-friendly form of System.Kind. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_KindText, 0xF04BEF95, 0xC585, 0x4197, 0xA2, 0xB7, 0xDF, 0x46, 0xFD, 0xC9, 0xEE, 0x6D, 100);
// Name: System.Language -- PKEY_Language
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 28
//
//
DEFINE_PROPERTYKEY(PKEY_Language, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 28);
// Name: System.MileageInformation -- PKEY_MileageInformation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: FDF84370-031A-4ADD-9E91-0D775F1C6605, 100
DEFINE_PROPERTYKEY(PKEY_MileageInformation, 0xFDF84370, 0x031A, 0x4ADD, 0x9E, 0x91, 0x0D, 0x77, 0x5F, 0x1C, 0x66, 0x05, 100);
// Name: System.MIMEType -- PKEY_MIMEType
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 0B63E350-9CCC-11D0-BCDB-00805FCCCE04, 5
//
// The MIME type. Eg, for EML files: 'message/rfc822'.
DEFINE_PROPERTYKEY(PKEY_MIMEType, 0x0B63E350, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 5);
// Name: System.Null -- PKEY_Null
// Type: Null -- VT_NULL
// FormatID: 00000000-0000-0000-0000-000000000000, 0
DEFINE_PROPERTYKEY(PKEY_Null, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0);
// Name: System.OfflineAvailability -- PKEY_OfflineAvailability
// Type: UInt32 -- VT_UI4
// FormatID: A94688B6-7D9F-4570-A648-E3DFC0AB2B3F, 100
DEFINE_PROPERTYKEY(PKEY_OfflineAvailability, 0xA94688B6, 0x7D9F, 0x4570, 0xA6, 0x48, 0xE3, 0xDF, 0xC0, 0xAB, 0x2B, 0x3F, 100);
// Possible discrete values for PKEY_OfflineAvailability are:
#define OFFLINEAVAILABILITY_NOT_AVAILABLE 0ul
#define OFFLINEAVAILABILITY_AVAILABLE 1ul
#define OFFLINEAVAILABILITY_ALWAYS_AVAILABLE 2ul
// Name: System.OfflineStatus -- PKEY_OfflineStatus
// Type: UInt32 -- VT_UI4
// FormatID: 6D24888F-4718-4BDA-AFED-EA0FB4386CD8, 100
DEFINE_PROPERTYKEY(PKEY_OfflineStatus, 0x6D24888F, 0x4718, 0x4BDA, 0xAF, 0xED, 0xEA, 0x0F, 0xB4, 0x38, 0x6C, 0xD8, 100);
// Possible discrete values for PKEY_OfflineStatus are:
#define OFFLINESTATUS_ONLINE 0ul
#define OFFLINESTATUS_OFFLINE 1ul
#define OFFLINESTATUS_OFFLINE_FORCED 2ul
#define OFFLINESTATUS_OFFLINE_SLOW 3ul
#define OFFLINESTATUS_OFFLINE_ERROR 4ul
#define OFFLINESTATUS_OFFLINE_ITEM_VERSION_CONFLICT 5ul
#define OFFLINESTATUS_OFFLINE_SUSPENDED 6ul
// Name: System.OriginalFileName -- PKEY_OriginalFileName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSFMTID_VERSION) 0CEF7D53-FA64-11D1-A203-0000F81FEDEE, 6
//
//
DEFINE_PROPERTYKEY(PKEY_OriginalFileName, 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 6);
// Name: System.ParentalRating -- PKEY_ParentalRating
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 21 (PIDMSI_PARENTAL_RATING)
//
//
DEFINE_PROPERTYKEY(PKEY_ParentalRating, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 21);
// Name: System.ParentalRatingReason -- PKEY_ParentalRatingReason
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 10984E0A-F9F2-4321-B7EF-BAF195AF4319, 100
DEFINE_PROPERTYKEY(PKEY_ParentalRatingReason, 0x10984E0A, 0xF9F2, 0x4321, 0xB7, 0xEF, 0xBA, 0xF1, 0x95, 0xAF, 0x43, 0x19, 100);
// Name: System.ParentalRatingsOrganization -- PKEY_ParentalRatingsOrganization
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A7FE0840-1344-46F0-8D37-52ED712A4BF9, 100
DEFINE_PROPERTYKEY(PKEY_ParentalRatingsOrganization, 0xA7FE0840, 0x1344, 0x46F0, 0x8D, 0x37, 0x52, 0xED, 0x71, 0x2A, 0x4B, 0xF9, 100);
// Name: System.ParsingBindContext -- PKEY_ParsingBindContext
// Type: Any -- VT_NULL Legacy code may treat this as VT_UNKNOWN.
// FormatID: DFB9A04D-362F-4CA3-B30B-0254B17B5B84, 100
//
// used to get the IBindCtx for an item for parsing
DEFINE_PROPERTYKEY(PKEY_ParsingBindContext, 0xDFB9A04D, 0x362F, 0x4CA3, 0xB3, 0x0B, 0x02, 0x54, 0xB1, 0x7B, 0x5B, 0x84, 100);
// Name: System.ParsingName -- PKEY_ParsingName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 24
//
// The shell namespace name of an item relative to a parent folder. This name may be passed to
// IShellFolder::ParseDisplayName() of the parent shell folder.
DEFINE_PROPERTYKEY(PKEY_ParsingName, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 24);
// Name: System.ParsingPath -- PKEY_ParsingPath
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 30
//
// This is the shell namespace path to the item. This path may be passed to
// SHParseDisplayName to parse the path to the correct shell folder.
//
// If the item is a file, the value is identical to System.ItemPathDisplay.
//
// If the item cannot be accessed through the shell namespace, this value is VT_EMPTY.
DEFINE_PROPERTYKEY(PKEY_ParsingPath, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 30);
// Name: System.PerceivedType -- PKEY_PerceivedType
// Type: Int32 -- VT_I4
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 9
//
// The perceived type of a shell item, based upon its canonical type.
DEFINE_PROPERTYKEY(PKEY_PerceivedType, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 9);
// For the enumerated values of PKEY_PerceivedType, see the PERCEIVED_TYPE_* values in shtypes.idl.
// Name: System.PercentFull -- PKEY_PercentFull
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 5 (Filesystem Volume Properties)
//
// The amount filled as a percentage, multiplied by 100 (ie, the valid range is 0 through 100).
DEFINE_PROPERTYKEY(PKEY_PercentFull, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 5);
// Name: System.Priority -- PKEY_Priority
// Type: UInt16 -- VT_UI2
// FormatID: 9C1FCF74-2D97-41BA-B4AE-CB2E3661A6E4, 5
//
//
DEFINE_PROPERTYKEY(PKEY_Priority, 0x9C1FCF74, 0x2D97, 0x41BA, 0xB4, 0xAE, 0xCB, 0x2E, 0x36, 0x61, 0xA6, 0xE4, 5);
// Possible discrete values for PKEY_Priority are:
#define PRIORITY_PROP_LOW 0u
#define PRIORITY_PROP_NORMAL 1u
#define PRIORITY_PROP_HIGH 2u
// Name: System.PriorityText -- PKEY_PriorityText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D98BE98B-B86B-4095-BF52-9D23B2E0A752, 100
//
// This is the user-friendly form of System.Priority. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_PriorityText, 0xD98BE98B, 0xB86B, 0x4095, 0xBF, 0x52, 0x9D, 0x23, 0xB2, 0xE0, 0xA7, 0x52, 100);
// Name: System.Project -- PKEY_Project
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 39A7F922-477C-48DE-8BC8-B28441E342E3, 100
DEFINE_PROPERTYKEY(PKEY_Project, 0x39A7F922, 0x477C, 0x48DE, 0x8B, 0xC8, 0xB2, 0x84, 0x41, 0xE3, 0x42, 0xE3, 100);
// Name: System.ProviderItemID -- PKEY_ProviderItemID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F21D9941-81F0-471A-ADEE-4E74B49217ED, 100
//
//
DEFINE_PROPERTYKEY(PKEY_ProviderItemID, 0xF21D9941, 0x81F0, 0x471A, 0xAD, 0xEE, 0x4E, 0x74, 0xB4, 0x92, 0x17, 0xED, 100);
// Name: System.Rating -- PKEY_Rating
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 9 (PIDMSI_RATING)
//
// Indicates the users preference rating of an item on a scale of 0-99 (0 = unrated, 1-12 = One Star,
// 13-37 = Two Stars, 38-62 = Three Stars, 63-87 = Four Stars, 88-99 = Five Stars).
DEFINE_PROPERTYKEY(PKEY_Rating, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9);
// Use the following constants to convert between visual stars and the ratings value:
#define RATING_UNRATED_MIN 0ul
#define RATING_UNRATED_SET 0ul
#define RATING_UNRATED_MAX 0ul
#define RATING_ONE_STAR_MIN 1ul
#define RATING_ONE_STAR_SET 1ul
#define RATING_ONE_STAR_MAX 12ul
#define RATING_TWO_STARS_MIN 13ul
#define RATING_TWO_STARS_SET 25ul
#define RATING_TWO_STARS_MAX 37ul
#define RATING_THREE_STARS_MIN 38ul
#define RATING_THREE_STARS_SET 50ul
#define RATING_THREE_STARS_MAX 62ul
#define RATING_FOUR_STARS_MIN 63ul
#define RATING_FOUR_STARS_SET 75ul
#define RATING_FOUR_STARS_MAX 87ul
#define RATING_FIVE_STARS_MIN 88ul
#define RATING_FIVE_STARS_SET 99ul
#define RATING_FIVE_STARS_MAX 99ul
// Name: System.RatingText -- PKEY_RatingText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 90197CA7-FD8F-4E8C-9DA3-B57E1E609295, 100
//
// This is the user-friendly form of System.Rating. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_RatingText, 0x90197CA7, 0xFD8F, 0x4E8C, 0x9D, 0xA3, 0xB5, 0x7E, 0x1E, 0x60, 0x92, 0x95, 100);
// Name: System.Sensitivity -- PKEY_Sensitivity
// Type: UInt16 -- VT_UI2
// FormatID: F8D3F6AC-4874-42CB-BE59-AB454B30716A, 100
//
//
DEFINE_PROPERTYKEY(PKEY_Sensitivity, 0xF8D3F6AC, 0x4874, 0x42CB, 0xBE, 0x59, 0xAB, 0x45, 0x4B, 0x30, 0x71, 0x6A, 100);
// Possible discrete values for PKEY_Sensitivity are:
#define SENSITIVITY_PROP_NORMAL 0u
#define SENSITIVITY_PROP_PERSONAL 1u
#define SENSITIVITY_PROP_PRIVATE 2u
#define SENSITIVITY_PROP_CONFIDENTIAL 3u
// Name: System.SensitivityText -- PKEY_SensitivityText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D0C7F054-3F72-4725-8527-129A577CB269, 100
//
// This is the user-friendly form of System.Sensitivity. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_SensitivityText, 0xD0C7F054, 0x3F72, 0x4725, 0x85, 0x27, 0x12, 0x9A, 0x57, 0x7C, 0xB2, 0x69, 100);
// Name: System.SFGAOFlags -- PKEY_SFGAOFlags
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 25
//
// IShellFolder::GetAttributesOf flags, with SFGAO_PKEYSFGAOMASK attributes masked out.
DEFINE_PROPERTYKEY(PKEY_SFGAOFlags, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 25);
// Name: System.SharedWith -- PKEY_SharedWith
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: EF884C5B-2BFE-41BB-AAE5-76EEDF4F9902, 200
//
// Who is the item shared with?
DEFINE_PROPERTYKEY(PKEY_SharedWith, 0xEF884C5B, 0x2BFE, 0x41BB, 0xAA, 0xE5, 0x76, 0xEE, 0xDF, 0x4F, 0x99, 0x02, 200);
// Name: System.ShareUserRating -- PKEY_ShareUserRating
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 12 (PIDMSI_SHARE_USER_RATING)
//
//
DEFINE_PROPERTYKEY(PKEY_ShareUserRating, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 12);
// Name: System.Shell.OmitFromView -- PKEY_Shell_OmitFromView
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DE35258C-C695-4CBC-B982-38B0AD24CED0, 2
//
// Set this to a string value of 'True' to omit this item from shell views
DEFINE_PROPERTYKEY(PKEY_Shell_OmitFromView, 0xDE35258C, 0xC695, 0x4CBC, 0xB9, 0x82, 0x38, 0xB0, 0xAD, 0x24, 0xCE, 0xD0, 2);
// Name: System.SimpleRating -- PKEY_SimpleRating
// Type: UInt32 -- VT_UI4
// FormatID: A09F084E-AD41-489F-8076-AA5BE3082BCA, 100
//
// Indicates the users preference rating of an item on a scale of 0-5 (0=unrated, 1=One Star, 2=Two Stars, 3=Three Stars,
// 4=Four Stars, 5=Five Stars)
DEFINE_PROPERTYKEY(PKEY_SimpleRating, 0xA09F084E, 0xAD41, 0x489F, 0x80, 0x76, 0xAA, 0x5B, 0xE3, 0x08, 0x2B, 0xCA, 100);
// Name: System.Size -- PKEY_Size
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 12 (PID_STG_SIZE)
//
//
DEFINE_PROPERTYKEY(PKEY_Size, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 12);
// Name: System.SoftwareUsed -- PKEY_SoftwareUsed
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 305
//
// PropertyTagSoftwareUsed
DEFINE_PROPERTYKEY(PKEY_SoftwareUsed, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 305);
// Name: System.SourceItem -- PKEY_SourceItem
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 668CDFA5-7A1B-4323-AE4B-E527393A1D81, 100
DEFINE_PROPERTYKEY(PKEY_SourceItem, 0x668CDFA5, 0x7A1B, 0x4323, 0xAE, 0x4B, 0xE5, 0x27, 0x39, 0x3A, 0x1D, 0x81, 100);
// Name: System.StartDate -- PKEY_StartDate
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 48FD6EC8-8A12-4CDF-A03E-4EC5A511EDDE, 100
DEFINE_PROPERTYKEY(PKEY_StartDate, 0x48FD6EC8, 0x8A12, 0x4CDF, 0xA0, 0x3E, 0x4E, 0xC5, 0xA5, 0x11, 0xED, 0xDE, 100);
// Name: System.Status -- PKEY_Status
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_IntSite) 000214A1-0000-0000-C000-000000000046, 9
DEFINE_PROPERTYKEY(PKEY_Status, 0x000214A1, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 9);
// Name: System.Subject -- PKEY_Subject
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 3 (PIDSI_SUBJECT)
//
//
DEFINE_PROPERTYKEY(PKEY_Subject, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 3);
// Name: System.Thumbnail -- PKEY_Thumbnail
// Type: Clipboard -- VT_CF
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 17 (PIDSI_THUMBNAIL)
//
// A data that represents the thumbnail in VT_CF format.
DEFINE_PROPERTYKEY(PKEY_Thumbnail, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 17);
// Name: System.ThumbnailCacheId -- PKEY_ThumbnailCacheId
// Type: UInt64 -- VT_UI8
// FormatID: 446D16B1-8DAD-4870-A748-402EA43D788C, 100
//
// Unique value that can be used as a key to cache thumbnails. The value changes when the name, volume, or data modified
// of an item changes.
DEFINE_PROPERTYKEY(PKEY_ThumbnailCacheId, 0x446D16B1, 0x8DAD, 0x4870, 0xA7, 0x48, 0x40, 0x2E, 0xA4, 0x3D, 0x78, 0x8C, 100);
// Name: System.ThumbnailStream -- PKEY_ThumbnailStream
// Type: Stream -- VT_STREAM
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 27
//
// Data that represents the thumbnail in VT_STREAM format that GDI+/WindowsCodecs supports (jpg, png, etc).
DEFINE_PROPERTYKEY(PKEY_ThumbnailStream, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 27);
// Name: System.Title -- PKEY_Title
// Type: String -- VT_LPWSTR (For variants: VT_BSTR) Legacy code may treat this as VT_LPSTR.
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 2 (PIDSI_TITLE)
//
// Title of item.
DEFINE_PROPERTYKEY(PKEY_Title, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 2);
// Name: System.TotalFileSize -- PKEY_TotalFileSize
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 14
//
//
DEFINE_PROPERTYKEY(PKEY_TotalFileSize, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 14);
// Name: System.Trademarks -- PKEY_Trademarks
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSFMTID_VERSION) 0CEF7D53-FA64-11D1-A203-0000F81FEDEE, 9 (PIDVSI_Trademarks)
//
//
DEFINE_PROPERTYKEY(PKEY_Trademarks, 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 9);
//-----------------------------------------------------------------------------
// Document properties
// Name: System.Document.ByteCount -- PKEY_Document_ByteCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 4 (PIDDSI_BYTECOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_ByteCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 4);
// Name: System.Document.CharacterCount -- PKEY_Document_CharacterCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 16 (PIDSI_CHARCOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_CharacterCount, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 16);
// Name: System.Document.ClientID -- PKEY_Document_ClientID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 276D7BB0-5B34-4FB0-AA4B-158ED12A1809, 100
DEFINE_PROPERTYKEY(PKEY_Document_ClientID, 0x276D7BB0, 0x5B34, 0x4FB0, 0xAA, 0x4B, 0x15, 0x8E, 0xD1, 0x2A, 0x18, 0x09, 100);
// Name: System.Document.Contributor -- PKEY_Document_Contributor
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: F334115E-DA1B-4509-9B3D-119504DC7ABB, 100
DEFINE_PROPERTYKEY(PKEY_Document_Contributor, 0xF334115E, 0xDA1B, 0x4509, 0x9B, 0x3D, 0x11, 0x95, 0x04, 0xDC, 0x7A, 0xBB, 100);
// Name: System.Document.DateCreated -- PKEY_Document_DateCreated
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 12 (PIDSI_CREATE_DTM)
//
// This property is stored in the document, not obtained from the file system.
DEFINE_PROPERTYKEY(PKEY_Document_DateCreated, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 12);
// Name: System.Document.DatePrinted -- PKEY_Document_DatePrinted
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 11 (PIDSI_LASTPRINTED)
//
// Legacy name: "DocLastPrinted".
DEFINE_PROPERTYKEY(PKEY_Document_DatePrinted, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 11);
// Name: System.Document.DateSaved -- PKEY_Document_DateSaved
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 13 (PIDSI_LASTSAVE_DTM)
//
// Legacy name: "DocLastSavedTm".
DEFINE_PROPERTYKEY(PKEY_Document_DateSaved, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 13);
// Name: System.Document.Division -- PKEY_Document_Division
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 1E005EE6-BF27-428B-B01C-79676ACD2870, 100
DEFINE_PROPERTYKEY(PKEY_Document_Division, 0x1E005EE6, 0xBF27, 0x428B, 0xB0, 0x1C, 0x79, 0x67, 0x6A, 0xCD, 0x28, 0x70, 100);
// Name: System.Document.DocumentID -- PKEY_Document_DocumentID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E08805C8-E395-40DF-80D2-54F0D6C43154, 100
DEFINE_PROPERTYKEY(PKEY_Document_DocumentID, 0xE08805C8, 0xE395, 0x40DF, 0x80, 0xD2, 0x54, 0xF0, 0xD6, 0xC4, 0x31, 0x54, 100);
// Name: System.Document.HiddenSlideCount -- PKEY_Document_HiddenSlideCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 9 (PIDDSI_HIDDENCOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_HiddenSlideCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 9);
// Name: System.Document.LastAuthor -- PKEY_Document_LastAuthor
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 8 (PIDSI_LASTAUTHOR)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_LastAuthor, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 8);
// Name: System.Document.LineCount -- PKEY_Document_LineCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 5 (PIDDSI_LINECOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_LineCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 5);
// Name: System.Document.Manager -- PKEY_Document_Manager
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 14 (PIDDSI_MANAGER)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_Manager, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 14);
// Name: System.Document.MultimediaClipCount -- PKEY_Document_MultimediaClipCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 10 (PIDDSI_MMCLIPCOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_MultimediaClipCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 10);
// Name: System.Document.NoteCount -- PKEY_Document_NoteCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 8 (PIDDSI_NOTECOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_NoteCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 8);
// Name: System.Document.PageCount -- PKEY_Document_PageCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 14 (PIDSI_PAGECOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_PageCount, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 14);
// Name: System.Document.ParagraphCount -- PKEY_Document_ParagraphCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 6 (PIDDSI_PARCOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_ParagraphCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 6);
// Name: System.Document.PresentationFormat -- PKEY_Document_PresentationFormat
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 3 (PIDDSI_PRESFORMAT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_PresentationFormat, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 3);
// Name: System.Document.RevisionNumber -- PKEY_Document_RevisionNumber
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 9 (PIDSI_REVNUMBER)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_RevisionNumber, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 9);
// Name: System.Document.Security -- PKEY_Document_Security
// Type: Int32 -- VT_I4
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 19
//
// Access control information, from SummaryInfo propset
DEFINE_PROPERTYKEY(PKEY_Document_Security, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 19);
// Name: System.Document.SlideCount -- PKEY_Document_SlideCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 7 (PIDDSI_SLIDECOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_SlideCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 7);
// Name: System.Document.Template -- PKEY_Document_Template
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 7 (PIDSI_TEMPLATE)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_Template, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 7);
// Name: System.Document.TotalEditingTime -- PKEY_Document_TotalEditingTime
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 10 (PIDSI_EDITTIME)
//
// 100ns units, not milliseconds. VT_FILETIME for IPropertySetStorage handlers (legacy)
DEFINE_PROPERTYKEY(PKEY_Document_TotalEditingTime, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 10);
// Name: System.Document.Version -- PKEY_Document_Version
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DocumentSummaryInformation) D5CDD502-2E9C-101B-9397-08002B2CF9AE, 29
DEFINE_PROPERTYKEY(PKEY_Document_Version, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 29);
// Name: System.Document.WordCount -- PKEY_Document_WordCount
// Type: Int32 -- VT_I4
// FormatID: (FMTID_SummaryInformation) F29F85E0-4FF9-1068-AB91-08002B27B3D9, 15 (PIDSI_WORDCOUNT)
//
//
DEFINE_PROPERTYKEY(PKEY_Document_WordCount, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 15);
//-----------------------------------------------------------------------------
// DRM properties
// Name: System.DRM.DatePlayExpires -- PKEY_DRM_DatePlayExpires
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_DRM) AEAC19E4-89AE-4508-B9B7-BB867ABEE2ED, 6 (PIDDRSI_PLAYEXPIRES)
//
// Indicates when play expires for digital rights management.
DEFINE_PROPERTYKEY(PKEY_DRM_DatePlayExpires, 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 6);
// Name: System.DRM.DatePlayStarts -- PKEY_DRM_DatePlayStarts
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_DRM) AEAC19E4-89AE-4508-B9B7-BB867ABEE2ED, 5 (PIDDRSI_PLAYSTARTS)
//
// Indicates when play starts for digital rights management.
DEFINE_PROPERTYKEY(PKEY_DRM_DatePlayStarts, 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 5);
// Name: System.DRM.Description -- PKEY_DRM_Description
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_DRM) AEAC19E4-89AE-4508-B9B7-BB867ABEE2ED, 3 (PIDDRSI_DESCRIPTION)
//
// Displays the description for digital rights management.
DEFINE_PROPERTYKEY(PKEY_DRM_Description, 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 3);
// Name: System.DRM.IsProtected -- PKEY_DRM_IsProtected
// Type: Boolean -- VT_BOOL
// FormatID: (FMTID_DRM) AEAC19E4-89AE-4508-B9B7-BB867ABEE2ED, 2 (PIDDRSI_PROTECTED)
//
//
DEFINE_PROPERTYKEY(PKEY_DRM_IsProtected, 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 2);
// Name: System.DRM.PlayCount -- PKEY_DRM_PlayCount
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_DRM) AEAC19E4-89AE-4508-B9B7-BB867ABEE2ED, 4 (PIDDRSI_PLAYCOUNT)
//
// Indicates the play count for digital rights management.
DEFINE_PROPERTYKEY(PKEY_DRM_PlayCount, 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 4);
//-----------------------------------------------------------------------------
// GPS properties
// Name: System.GPS.Altitude -- PKEY_GPS_Altitude
// Type: Double -- VT_R8
// FormatID: 827EDB4F-5B73-44A7-891D-FDFFABEA35CA, 100
//
// Indicates the altitude based on the reference in PKEY_GPS_AltitudeRef. Calculated from PKEY_GPS_AltitudeNumerator and
// PKEY_GPS_AltitudeDenominator
DEFINE_PROPERTYKEY(PKEY_GPS_Altitude, 0x827EDB4F, 0x5B73, 0x44A7, 0x89, 0x1D, 0xFD, 0xFF, 0xAB, 0xEA, 0x35, 0xCA, 100);
// Name: System.GPS.AltitudeDenominator -- PKEY_GPS_AltitudeDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 78342DCB-E358-4145-AE9A-6BFE4E0F9F51, 100
//
// Denominator of PKEY_GPS_Altitude
DEFINE_PROPERTYKEY(PKEY_GPS_AltitudeDenominator, 0x78342DCB, 0xE358, 0x4145, 0xAE, 0x9A, 0x6B, 0xFE, 0x4E, 0x0F, 0x9F, 0x51, 100);
// Name: System.GPS.AltitudeNumerator -- PKEY_GPS_AltitudeNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 2DAD1EB7-816D-40D3-9EC3-C9773BE2AADE, 100
//
// Numerator of PKEY_GPS_Altitude
DEFINE_PROPERTYKEY(PKEY_GPS_AltitudeNumerator, 0x2DAD1EB7, 0x816D, 0x40D3, 0x9E, 0xC3, 0xC9, 0x77, 0x3B, 0xE2, 0xAA, 0xDE, 100);
// Name: System.GPS.AltitudeRef -- PKEY_GPS_AltitudeRef
// Type: Byte -- VT_UI1
// FormatID: 46AC629D-75EA-4515-867F-6DC4321C5844, 100
//
// Indicates the reference for the altitude property. (eg: above sea level, below sea level, absolute value)
DEFINE_PROPERTYKEY(PKEY_GPS_AltitudeRef, 0x46AC629D, 0x75EA, 0x4515, 0x86, 0x7F, 0x6D, 0xC4, 0x32, 0x1C, 0x58, 0x44, 100);
// Name: System.GPS.AreaInformation -- PKEY_GPS_AreaInformation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 972E333E-AC7E-49F1-8ADF-A70D07A9BCAB, 100
//
// Represents the name of the GPS area
DEFINE_PROPERTYKEY(PKEY_GPS_AreaInformation, 0x972E333E, 0xAC7E, 0x49F1, 0x8A, 0xDF, 0xA7, 0x0D, 0x07, 0xA9, 0xBC, 0xAB, 100);
// Name: System.GPS.Date -- PKEY_GPS_Date
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 3602C812-0F3B-45F0-85AD-603468D69423, 100
//
// Date and time of the GPS record
DEFINE_PROPERTYKEY(PKEY_GPS_Date, 0x3602C812, 0x0F3B, 0x45F0, 0x85, 0xAD, 0x60, 0x34, 0x68, 0xD6, 0x94, 0x23, 100);
// Name: System.GPS.DestBearing -- PKEY_GPS_DestBearing
// Type: Double -- VT_R8
// FormatID: C66D4B3C-E888-47CC-B99F-9DCA3EE34DEA, 100
//
// Indicates the bearing to the destination point. Calculated from PKEY_GPS_DestBearingNumerator and
// PKEY_GPS_DestBearingDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_DestBearing, 0xC66D4B3C, 0xE888, 0x47CC, 0xB9, 0x9F, 0x9D, 0xCA, 0x3E, 0xE3, 0x4D, 0xEA, 100);
// Name: System.GPS.DestBearingDenominator -- PKEY_GPS_DestBearingDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 7ABCF4F8-7C3F-4988-AC91-8D2C2E97ECA5, 100
//
// Denominator of PKEY_GPS_DestBearing
DEFINE_PROPERTYKEY(PKEY_GPS_DestBearingDenominator, 0x7ABCF4F8, 0x7C3F, 0x4988, 0xAC, 0x91, 0x8D, 0x2C, 0x2E, 0x97, 0xEC, 0xA5, 100);
// Name: System.GPS.DestBearingNumerator -- PKEY_GPS_DestBearingNumerator
// Type: UInt32 -- VT_UI4
// FormatID: BA3B1DA9-86EE-4B5D-A2A4-A271A429F0CF, 100
//
// Numerator of PKEY_GPS_DestBearing
DEFINE_PROPERTYKEY(PKEY_GPS_DestBearingNumerator, 0xBA3B1DA9, 0x86EE, 0x4B5D, 0xA2, 0xA4, 0xA2, 0x71, 0xA4, 0x29, 0xF0, 0xCF, 100);
// Name: System.GPS.DestBearingRef -- PKEY_GPS_DestBearingRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 9AB84393-2A0F-4B75-BB22-7279786977CB, 100
//
// Indicates the reference used for the giving the bearing to the destination point. (eg: true direction, magnetic direction)
DEFINE_PROPERTYKEY(PKEY_GPS_DestBearingRef, 0x9AB84393, 0x2A0F, 0x4B75, 0xBB, 0x22, 0x72, 0x79, 0x78, 0x69, 0x77, 0xCB, 100);
// Name: System.GPS.DestDistance -- PKEY_GPS_DestDistance
// Type: Double -- VT_R8
// FormatID: A93EAE04-6804-4F24-AC81-09B266452118, 100
//
// Indicates the distance to the destination point. Calculated from PKEY_GPS_DestDistanceNumerator and
// PKEY_GPS_DestDistanceDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_DestDistance, 0xA93EAE04, 0x6804, 0x4F24, 0xAC, 0x81, 0x09, 0xB2, 0x66, 0x45, 0x21, 0x18, 100);
// Name: System.GPS.DestDistanceDenominator -- PKEY_GPS_DestDistanceDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 9BC2C99B-AC71-4127-9D1C-2596D0D7DCB7, 100
//
// Denominator of PKEY_GPS_DestDistance
DEFINE_PROPERTYKEY(PKEY_GPS_DestDistanceDenominator, 0x9BC2C99B, 0xAC71, 0x4127, 0x9D, 0x1C, 0x25, 0x96, 0xD0, 0xD7, 0xDC, 0xB7, 100);
// Name: System.GPS.DestDistanceNumerator -- PKEY_GPS_DestDistanceNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 2BDA47DA-08C6-4FE1-80BC-A72FC517C5D0, 100
//
// Numerator of PKEY_GPS_DestDistance
DEFINE_PROPERTYKEY(PKEY_GPS_DestDistanceNumerator, 0x2BDA47DA, 0x08C6, 0x4FE1, 0x80, 0xBC, 0xA7, 0x2F, 0xC5, 0x17, 0xC5, 0xD0, 100);
// Name: System.GPS.DestDistanceRef -- PKEY_GPS_DestDistanceRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: ED4DF2D3-8695-450B-856F-F5C1C53ACB66, 100
//
// Indicates the unit used to express the distance to the destination. (eg: kilometers, miles, knots)
DEFINE_PROPERTYKEY(PKEY_GPS_DestDistanceRef, 0xED4DF2D3, 0x8695, 0x450B, 0x85, 0x6F, 0xF5, 0xC1, 0xC5, 0x3A, 0xCB, 0x66, 100);
// Name: System.GPS.DestLatitude -- PKEY_GPS_DestLatitude
// Type: Multivalue Double -- VT_VECTOR | VT_R8 (For variants: VT_ARRAY | VT_R8)
// FormatID: 9D1D7CC5-5C39-451C-86B3-928E2D18CC47, 100
//
// Indicates the latitude of the destination point. This is an array of three values. Index 0 is the degrees, index 1
// is the minutes, index 2 is the seconds. Each is calculated from the values in PKEY_GPS_DestLatitudeNumerator and
// PKEY_GPS_DestLatitudeDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_DestLatitude, 0x9D1D7CC5, 0x5C39, 0x451C, 0x86, 0xB3, 0x92, 0x8E, 0x2D, 0x18, 0xCC, 0x47, 100);
// Name: System.GPS.DestLatitudeDenominator -- PKEY_GPS_DestLatitudeDenominator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: 3A372292-7FCA-49A7-99D5-E47BB2D4E7AB, 100
//
// Denominator of PKEY_GPS_DestLatitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLatitudeDenominator, 0x3A372292, 0x7FCA, 0x49A7, 0x99, 0xD5, 0xE4, 0x7B, 0xB2, 0xD4, 0xE7, 0xAB, 100);
// Name: System.GPS.DestLatitudeNumerator -- PKEY_GPS_DestLatitudeNumerator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: ECF4B6F6-D5A6-433C-BB92-4076650FC890, 100
//
// Numerator of PKEY_GPS_DestLatitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLatitudeNumerator, 0xECF4B6F6, 0xD5A6, 0x433C, 0xBB, 0x92, 0x40, 0x76, 0x65, 0x0F, 0xC8, 0x90, 100);
// Name: System.GPS.DestLatitudeRef -- PKEY_GPS_DestLatitudeRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CEA820B9-CE61-4885-A128-005D9087C192, 100
//
// Indicates whether the latitude destination point is north or south latitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLatitudeRef, 0xCEA820B9, 0xCE61, 0x4885, 0xA1, 0x28, 0x00, 0x5D, 0x90, 0x87, 0xC1, 0x92, 100);
// Name: System.GPS.DestLongitude -- PKEY_GPS_DestLongitude
// Type: Multivalue Double -- VT_VECTOR | VT_R8 (For variants: VT_ARRAY | VT_R8)
// FormatID: 47A96261-CB4C-4807-8AD3-40B9D9DBC6BC, 100
//
// Indicates the latitude of the destination point. This is an array of three values. Index 0 is the degrees, index 1
// is the minutes, index 2 is the seconds. Each is calculated from the values in PKEY_GPS_DestLongitudeNumerator and
// PKEY_GPS_DestLongitudeDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_DestLongitude, 0x47A96261, 0xCB4C, 0x4807, 0x8A, 0xD3, 0x40, 0xB9, 0xD9, 0xDB, 0xC6, 0xBC, 100);
// Name: System.GPS.DestLongitudeDenominator -- PKEY_GPS_DestLongitudeDenominator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: 425D69E5-48AD-4900-8D80-6EB6B8D0AC86, 100
//
// Denominator of PKEY_GPS_DestLongitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLongitudeDenominator, 0x425D69E5, 0x48AD, 0x4900, 0x8D, 0x80, 0x6E, 0xB6, 0xB8, 0xD0, 0xAC, 0x86, 100);
// Name: System.GPS.DestLongitudeNumerator -- PKEY_GPS_DestLongitudeNumerator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: A3250282-FB6D-48D5-9A89-DBCACE75CCCF, 100
//
// Numerator of PKEY_GPS_DestLongitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLongitudeNumerator, 0xA3250282, 0xFB6D, 0x48D5, 0x9A, 0x89, 0xDB, 0xCA, 0xCE, 0x75, 0xCC, 0xCF, 100);
// Name: System.GPS.DestLongitudeRef -- PKEY_GPS_DestLongitudeRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 182C1EA6-7C1C-4083-AB4B-AC6C9F4ED128, 100
//
// Indicates whether the longitude destination point is east or west longitude
DEFINE_PROPERTYKEY(PKEY_GPS_DestLongitudeRef, 0x182C1EA6, 0x7C1C, 0x4083, 0xAB, 0x4B, 0xAC, 0x6C, 0x9F, 0x4E, 0xD1, 0x28, 100);
// Name: System.GPS.Differential -- PKEY_GPS_Differential
// Type: UInt16 -- VT_UI2
// FormatID: AAF4EE25-BD3B-4DD7-BFC4-47F77BB00F6D, 100
//
// Indicates whether differential correction was applied to the GPS receiver
DEFINE_PROPERTYKEY(PKEY_GPS_Differential, 0xAAF4EE25, 0xBD3B, 0x4DD7, 0xBF, 0xC4, 0x47, 0xF7, 0x7B, 0xB0, 0x0F, 0x6D, 100);
// Name: System.GPS.DOP -- PKEY_GPS_DOP
// Type: Double -- VT_R8
// FormatID: 0CF8FB02-1837-42F1-A697-A7017AA289B9, 100
//
// Indicates the GPS DOP (data degree of precision). Calculated from PKEY_GPS_DOPNumerator and PKEY_GPS_DOPDenominator
DEFINE_PROPERTYKEY(PKEY_GPS_DOP, 0x0CF8FB02, 0x1837, 0x42F1, 0xA6, 0x97, 0xA7, 0x01, 0x7A, 0xA2, 0x89, 0xB9, 100);
// Name: System.GPS.DOPDenominator -- PKEY_GPS_DOPDenominator
// Type: UInt32 -- VT_UI4
// FormatID: A0BE94C5-50BA-487B-BD35-0654BE8881ED, 100
//
// Denominator of PKEY_GPS_DOP
DEFINE_PROPERTYKEY(PKEY_GPS_DOPDenominator, 0xA0BE94C5, 0x50BA, 0x487B, 0xBD, 0x35, 0x06, 0x54, 0xBE, 0x88, 0x81, 0xED, 100);
// Name: System.GPS.DOPNumerator -- PKEY_GPS_DOPNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 47166B16-364F-4AA0-9F31-E2AB3DF449C3, 100
//
// Numerator of PKEY_GPS_DOP
DEFINE_PROPERTYKEY(PKEY_GPS_DOPNumerator, 0x47166B16, 0x364F, 0x4AA0, 0x9F, 0x31, 0xE2, 0xAB, 0x3D, 0xF4, 0x49, 0xC3, 100);
// Name: System.GPS.ImgDirection -- PKEY_GPS_ImgDirection
// Type: Double -- VT_R8
// FormatID: 16473C91-D017-4ED9-BA4D-B6BAA55DBCF8, 100
//
// Indicates direction of the image when it was captured. Calculated from PKEY_GPS_ImgDirectionNumerator and
// PKEY_GPS_ImgDirectionDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_ImgDirection, 0x16473C91, 0xD017, 0x4ED9, 0xBA, 0x4D, 0xB6, 0xBA, 0xA5, 0x5D, 0xBC, 0xF8, 100);
// Name: System.GPS.ImgDirectionDenominator -- PKEY_GPS_ImgDirectionDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 10B24595-41A2-4E20-93C2-5761C1395F32, 100
//
// Denominator of PKEY_GPS_ImgDirection
DEFINE_PROPERTYKEY(PKEY_GPS_ImgDirectionDenominator, 0x10B24595, 0x41A2, 0x4E20, 0x93, 0xC2, 0x57, 0x61, 0xC1, 0x39, 0x5F, 0x32, 100);
// Name: System.GPS.ImgDirectionNumerator -- PKEY_GPS_ImgDirectionNumerator
// Type: UInt32 -- VT_UI4
// FormatID: DC5877C7-225F-45F7-BAC7-E81334B6130A, 100
//
// Numerator of PKEY_GPS_ImgDirection
DEFINE_PROPERTYKEY(PKEY_GPS_ImgDirectionNumerator, 0xDC5877C7, 0x225F, 0x45F7, 0xBA, 0xC7, 0xE8, 0x13, 0x34, 0xB6, 0x13, 0x0A, 100);
// Name: System.GPS.ImgDirectionRef -- PKEY_GPS_ImgDirectionRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A4AAA5B7-1AD0-445F-811A-0F8F6E67F6B5, 100
//
// Indicates reference for giving the direction of the image when it was captured. (eg: true direction, magnetic direction)
DEFINE_PROPERTYKEY(PKEY_GPS_ImgDirectionRef, 0xA4AAA5B7, 0x1AD0, 0x445F, 0x81, 0x1A, 0x0F, 0x8F, 0x6E, 0x67, 0xF6, 0xB5, 100);
// Name: System.GPS.Latitude -- PKEY_GPS_Latitude
// Type: Multivalue Double -- VT_VECTOR | VT_R8 (For variants: VT_ARRAY | VT_R8)
// FormatID: 8727CFFF-4868-4EC6-AD5B-81B98521D1AB, 100
//
// Indicates the latitude. This is an array of three values. Index 0 is the degrees, index 1 is the minutes, index 2
// is the seconds. Each is calculated from the values in PKEY_GPS_LatitudeNumerator and PKEY_GPS_LatitudeDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_Latitude, 0x8727CFFF, 0x4868, 0x4EC6, 0xAD, 0x5B, 0x81, 0xB9, 0x85, 0x21, 0xD1, 0xAB, 100);
// Name: System.GPS.LatitudeDenominator -- PKEY_GPS_LatitudeDenominator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: 16E634EE-2BFF-497B-BD8A-4341AD39EEB9, 100
//
// Denominator of PKEY_GPS_Latitude
DEFINE_PROPERTYKEY(PKEY_GPS_LatitudeDenominator, 0x16E634EE, 0x2BFF, 0x497B, 0xBD, 0x8A, 0x43, 0x41, 0xAD, 0x39, 0xEE, 0xB9, 100);
// Name: System.GPS.LatitudeNumerator -- PKEY_GPS_LatitudeNumerator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: 7DDAAAD1-CCC8-41AE-B750-B2CB8031AEA2, 100
//
// Numerator of PKEY_GPS_Latitude
DEFINE_PROPERTYKEY(PKEY_GPS_LatitudeNumerator, 0x7DDAAAD1, 0xCCC8, 0x41AE, 0xB7, 0x50, 0xB2, 0xCB, 0x80, 0x31, 0xAE, 0xA2, 100);
// Name: System.GPS.LatitudeRef -- PKEY_GPS_LatitudeRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 029C0252-5B86-46C7-ACA0-2769FFC8E3D4, 100
//
// Indicates whether latitude is north or south latitude
DEFINE_PROPERTYKEY(PKEY_GPS_LatitudeRef, 0x029C0252, 0x5B86, 0x46C7, 0xAC, 0xA0, 0x27, 0x69, 0xFF, 0xC8, 0xE3, 0xD4, 100);
// Name: System.GPS.Longitude -- PKEY_GPS_Longitude
// Type: Multivalue Double -- VT_VECTOR | VT_R8 (For variants: VT_ARRAY | VT_R8)
// FormatID: C4C4DBB2-B593-466B-BBDA-D03D27D5E43A, 100
//
// Indicates the longitude. This is an array of three values. Index 0 is the degrees, index 1 is the minutes, index 2
// is the seconds. Each is calculated from the values in PKEY_GPS_LongitudeNumerator and PKEY_GPS_LongitudeDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_Longitude, 0xC4C4DBB2, 0xB593, 0x466B, 0xBB, 0xDA, 0xD0, 0x3D, 0x27, 0xD5, 0xE4, 0x3A, 100);
// Name: System.GPS.LongitudeDenominator -- PKEY_GPS_LongitudeDenominator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: BE6E176C-4534-4D2C-ACE5-31DEDAC1606B, 100
//
// Denominator of PKEY_GPS_Longitude
DEFINE_PROPERTYKEY(PKEY_GPS_LongitudeDenominator, 0xBE6E176C, 0x4534, 0x4D2C, 0xAC, 0xE5, 0x31, 0xDE, 0xDA, 0xC1, 0x60, 0x6B, 100);
// Name: System.GPS.LongitudeNumerator -- PKEY_GPS_LongitudeNumerator
// Type: Multivalue UInt32 -- VT_VECTOR | VT_UI4 (For variants: VT_ARRAY | VT_UI4)
// FormatID: 02B0F689-A914-4E45-821D-1DDA452ED2C4, 100
//
// Numerator of PKEY_GPS_Longitude
DEFINE_PROPERTYKEY(PKEY_GPS_LongitudeNumerator, 0x02B0F689, 0xA914, 0x4E45, 0x82, 0x1D, 0x1D, 0xDA, 0x45, 0x2E, 0xD2, 0xC4, 100);
// Name: System.GPS.LongitudeRef -- PKEY_GPS_LongitudeRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 33DCF22B-28D5-464C-8035-1EE9EFD25278, 100
//
// Indicates whether longitude is east or west longitude
DEFINE_PROPERTYKEY(PKEY_GPS_LongitudeRef, 0x33DCF22B, 0x28D5, 0x464C, 0x80, 0x35, 0x1E, 0xE9, 0xEF, 0xD2, 0x52, 0x78, 100);
// Name: System.GPS.MapDatum -- PKEY_GPS_MapDatum
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 2CA2DAE6-EDDC-407D-BEF1-773942ABFA95, 100
//
// Indicates the geodetic survey data used by the GPS receiver
DEFINE_PROPERTYKEY(PKEY_GPS_MapDatum, 0x2CA2DAE6, 0xEDDC, 0x407D, 0xBE, 0xF1, 0x77, 0x39, 0x42, 0xAB, 0xFA, 0x95, 100);
// Name: System.GPS.MeasureMode -- PKEY_GPS_MeasureMode
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A015ED5D-AAEA-4D58-8A86-3C586920EA0B, 100
//
// Indicates the GPS measurement mode. (eg: 2-dimensional, 3-dimensional)
DEFINE_PROPERTYKEY(PKEY_GPS_MeasureMode, 0xA015ED5D, 0xAAEA, 0x4D58, 0x8A, 0x86, 0x3C, 0x58, 0x69, 0x20, 0xEA, 0x0B, 100);
// Name: System.GPS.ProcessingMethod -- PKEY_GPS_ProcessingMethod
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 59D49E61-840F-4AA9-A939-E2099B7F6399, 100
//
// Indicates the name of the method used for location finding
DEFINE_PROPERTYKEY(PKEY_GPS_ProcessingMethod, 0x59D49E61, 0x840F, 0x4AA9, 0xA9, 0x39, 0xE2, 0x09, 0x9B, 0x7F, 0x63, 0x99, 100);
// Name: System.GPS.Satellites -- PKEY_GPS_Satellites
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 467EE575-1F25-4557-AD4E-B8B58B0D9C15, 100
//
// Indicates the GPS satellites used for measurements
DEFINE_PROPERTYKEY(PKEY_GPS_Satellites, 0x467EE575, 0x1F25, 0x4557, 0xAD, 0x4E, 0xB8, 0xB5, 0x8B, 0x0D, 0x9C, 0x15, 100);
// Name: System.GPS.Speed -- PKEY_GPS_Speed
// Type: Double -- VT_R8
// FormatID: DA5D0862-6E76-4E1B-BABD-70021BD25494, 100
//
// Indicates the speed of the GPS receiver movement. Calculated from PKEY_GPS_SpeedNumerator and
// PKEY_GPS_SpeedDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_Speed, 0xDA5D0862, 0x6E76, 0x4E1B, 0xBA, 0xBD, 0x70, 0x02, 0x1B, 0xD2, 0x54, 0x94, 100);
// Name: System.GPS.SpeedDenominator -- PKEY_GPS_SpeedDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 7D122D5A-AE5E-4335-8841-D71E7CE72F53, 100
//
// Denominator of PKEY_GPS_Speed
DEFINE_PROPERTYKEY(PKEY_GPS_SpeedDenominator, 0x7D122D5A, 0xAE5E, 0x4335, 0x88, 0x41, 0xD7, 0x1E, 0x7C, 0xE7, 0x2F, 0x53, 100);
// Name: System.GPS.SpeedNumerator -- PKEY_GPS_SpeedNumerator
// Type: UInt32 -- VT_UI4
// FormatID: ACC9CE3D-C213-4942-8B48-6D0820F21C6D, 100
//
// Numerator of PKEY_GPS_Speed
DEFINE_PROPERTYKEY(PKEY_GPS_SpeedNumerator, 0xACC9CE3D, 0xC213, 0x4942, 0x8B, 0x48, 0x6D, 0x08, 0x20, 0xF2, 0x1C, 0x6D, 100);
// Name: System.GPS.SpeedRef -- PKEY_GPS_SpeedRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: ECF7F4C9-544F-4D6D-9D98-8AD79ADAF453, 100
//
// Indicates the unit used to express the speed of the GPS receiver movement. (eg: kilometers per hour,
// miles per hour, knots).
DEFINE_PROPERTYKEY(PKEY_GPS_SpeedRef, 0xECF7F4C9, 0x544F, 0x4D6D, 0x9D, 0x98, 0x8A, 0xD7, 0x9A, 0xDA, 0xF4, 0x53, 100);
// Name: System.GPS.Status -- PKEY_GPS_Status
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 125491F4-818F-46B2-91B5-D537753617B2, 100
//
// Indicates the status of the GPS receiver when the image was recorded. (eg: measurement in progress,
// measurement interoperability).
DEFINE_PROPERTYKEY(PKEY_GPS_Status, 0x125491F4, 0x818F, 0x46B2, 0x91, 0xB5, 0xD5, 0x37, 0x75, 0x36, 0x17, 0xB2, 100);
// Name: System.GPS.Track -- PKEY_GPS_Track
// Type: Double -- VT_R8
// FormatID: 76C09943-7C33-49E3-9E7E-CDBA872CFADA, 100
//
// Indicates the direction of the GPS receiver movement. Calculated from PKEY_GPS_TrackNumerator and
// PKEY_GPS_TrackDenominator.
DEFINE_PROPERTYKEY(PKEY_GPS_Track, 0x76C09943, 0x7C33, 0x49E3, 0x9E, 0x7E, 0xCD, 0xBA, 0x87, 0x2C, 0xFA, 0xDA, 100);
// Name: System.GPS.TrackDenominator -- PKEY_GPS_TrackDenominator
// Type: UInt32 -- VT_UI4
// FormatID: C8D1920C-01F6-40C0-AC86-2F3A4AD00770, 100
//
// Denominator of PKEY_GPS_Track
DEFINE_PROPERTYKEY(PKEY_GPS_TrackDenominator, 0xC8D1920C, 0x01F6, 0x40C0, 0xAC, 0x86, 0x2F, 0x3A, 0x4A, 0xD0, 0x07, 0x70, 100);
// Name: System.GPS.TrackNumerator -- PKEY_GPS_TrackNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 702926F4-44A6-43E1-AE71-45627116893B, 100
//
// Numerator of PKEY_GPS_Track
DEFINE_PROPERTYKEY(PKEY_GPS_TrackNumerator, 0x702926F4, 0x44A6, 0x43E1, 0xAE, 0x71, 0x45, 0x62, 0x71, 0x16, 0x89, 0x3B, 100);
// Name: System.GPS.TrackRef -- PKEY_GPS_TrackRef
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 35DBE6FE-44C3-4400-AAAE-D2C799C407E8, 100
//
// Indicates reference for the direction of the GPS receiver movement. (eg: true direction, magnetic direction)
DEFINE_PROPERTYKEY(PKEY_GPS_TrackRef, 0x35DBE6FE, 0x44C3, 0x4400, 0xAA, 0xAE, 0xD2, 0xC7, 0x99, 0xC4, 0x07, 0xE8, 100);
// Name: System.GPS.VersionID -- PKEY_GPS_VersionID
// Type: Buffer -- VT_VECTOR | VT_UI1 (For variants: VT_ARRAY | VT_UI1)
// FormatID: 22704DA4-C6B2-4A99-8E56-F16DF8C92599, 100
//
// Indicates the version of the GPS information
DEFINE_PROPERTYKEY(PKEY_GPS_VersionID, 0x22704DA4, 0xC6B2, 0x4A99, 0x8E, 0x56, 0xF1, 0x6D, 0xF8, 0xC9, 0x25, 0x99, 100);
//-----------------------------------------------------------------------------
// Image properties
// Name: System.Image.BitDepth -- PKEY_Image_BitDepth
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 7 (PIDISI_BITDEPTH)
//
//
DEFINE_PROPERTYKEY(PKEY_Image_BitDepth, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 7);
// Name: System.Image.ColorSpace -- PKEY_Image_ColorSpace
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 40961
//
// PropertyTagExifColorSpace
DEFINE_PROPERTYKEY(PKEY_Image_ColorSpace, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 40961);
// Possible discrete values for PKEY_Image_ColorSpace are:
#define IMAGE_COLORSPACE_SRGB 1u
#define IMAGE_COLORSPACE_UNCALIBRATED 0xFFFFu
// Name: System.Image.CompressedBitsPerPixel -- PKEY_Image_CompressedBitsPerPixel
// Type: Double -- VT_R8
// FormatID: 364B6FA9-37AB-482A-BE2B-AE02F60D4318, 100
//
// Calculated from PKEY_Image_CompressedBitsPerPixelNumerator and PKEY_Image_CompressedBitsPerPixelDenominator.
DEFINE_PROPERTYKEY(PKEY_Image_CompressedBitsPerPixel, 0x364B6FA9, 0x37AB, 0x482A, 0xBE, 0x2B, 0xAE, 0x02, 0xF6, 0x0D, 0x43, 0x18, 100);
// Name: System.Image.CompressedBitsPerPixelDenominator -- PKEY_Image_CompressedBitsPerPixelDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 1F8844E1-24AD-4508-9DFD-5326A415CE02, 100
//
// Denominator of PKEY_Image_CompressedBitsPerPixel.
DEFINE_PROPERTYKEY(PKEY_Image_CompressedBitsPerPixelDenominator, 0x1F8844E1, 0x24AD, 0x4508, 0x9D, 0xFD, 0x53, 0x26, 0xA4, 0x15, 0xCE, 0x02, 100);
// Name: System.Image.CompressedBitsPerPixelNumerator -- PKEY_Image_CompressedBitsPerPixelNumerator
// Type: UInt32 -- VT_UI4
// FormatID: D21A7148-D32C-4624-8900-277210F79C0F, 100
//
// Numerator of PKEY_Image_CompressedBitsPerPixel.
DEFINE_PROPERTYKEY(PKEY_Image_CompressedBitsPerPixelNumerator, 0xD21A7148, 0xD32C, 0x4624, 0x89, 0x00, 0x27, 0x72, 0x10, 0xF7, 0x9C, 0x0F, 100);
// Name: System.Image.Compression -- PKEY_Image_Compression
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 259
//
// Indicates the image compression level. PropertyTagCompression.
DEFINE_PROPERTYKEY(PKEY_Image_Compression, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 259);
// Possible discrete values for PKEY_Image_Compression are:
#define IMAGE_COMPRESSION_UNCOMPRESSED 1u
#define IMAGE_COMPRESSION_CCITT_T3 2u
#define IMAGE_COMPRESSION_CCITT_T4 3u
#define IMAGE_COMPRESSION_CCITT_T6 4u
#define IMAGE_COMPRESSION_LZW 5u
#define IMAGE_COMPRESSION_JPEG 6u
#define IMAGE_COMPRESSION_PACKBITS 32773u
// Name: System.Image.CompressionText -- PKEY_Image_CompressionText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 3F08E66F-2F44-4BB9-A682-AC35D2562322, 100
//
// This is the user-friendly form of System.Image.Compression. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Image_CompressionText, 0x3F08E66F, 0x2F44, 0x4BB9, 0xA6, 0x82, 0xAC, 0x35, 0xD2, 0x56, 0x23, 0x22, 100);
// Name: System.Image.Dimensions -- PKEY_Image_Dimensions
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 13 (PIDISI_DIMENSIONS)
//
// Indicates the dimensions of the image.
DEFINE_PROPERTYKEY(PKEY_Image_Dimensions, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 13);
// Name: System.Image.HorizontalResolution -- PKEY_Image_HorizontalResolution
// Type: Double -- VT_R8
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 5 (PIDISI_RESOLUTIONX)
//
//
DEFINE_PROPERTYKEY(PKEY_Image_HorizontalResolution, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 5);
// Name: System.Image.HorizontalSize -- PKEY_Image_HorizontalSize
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 3 (PIDISI_CX)
//
//
DEFINE_PROPERTYKEY(PKEY_Image_HorizontalSize, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3);
// Name: System.Image.ImageID -- PKEY_Image_ImageID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 10DABE05-32AA-4C29-BF1A-63E2D220587F, 100
DEFINE_PROPERTYKEY(PKEY_Image_ImageID, 0x10DABE05, 0x32AA, 0x4C29, 0xBF, 0x1A, 0x63, 0xE2, 0xD2, 0x20, 0x58, 0x7F, 100);
// Name: System.Image.ResolutionUnit -- PKEY_Image_ResolutionUnit
// Type: Int16 -- VT_I2
// FormatID: 19B51FA6-1F92-4A5C-AB48-7DF0ABD67444, 100
DEFINE_PROPERTYKEY(PKEY_Image_ResolutionUnit, 0x19B51FA6, 0x1F92, 0x4A5C, 0xAB, 0x48, 0x7D, 0xF0, 0xAB, 0xD6, 0x74, 0x44, 100);
// Name: System.Image.VerticalResolution -- PKEY_Image_VerticalResolution
// Type: Double -- VT_R8
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 6 (PIDISI_RESOLUTIONY)
//
//
DEFINE_PROPERTYKEY(PKEY_Image_VerticalResolution, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6);
// Name: System.Image.VerticalSize -- PKEY_Image_VerticalSize
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 4 (PIDISI_CY)
//
//
DEFINE_PROPERTYKEY(PKEY_Image_VerticalSize, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4);
//-----------------------------------------------------------------------------
// Journal properties
// Name: System.Journal.Contacts -- PKEY_Journal_Contacts
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: DEA7C82C-1D89-4A66-9427-A4E3DEBABCB1, 100
DEFINE_PROPERTYKEY(PKEY_Journal_Contacts, 0xDEA7C82C, 0x1D89, 0x4A66, 0x94, 0x27, 0xA4, 0xE3, 0xDE, 0xBA, 0xBC, 0xB1, 100);
// Name: System.Journal.EntryType -- PKEY_Journal_EntryType
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 95BEB1FC-326D-4644-B396-CD3ED90E6DDF, 100
DEFINE_PROPERTYKEY(PKEY_Journal_EntryType, 0x95BEB1FC, 0x326D, 0x4644, 0xB3, 0x96, 0xCD, 0x3E, 0xD9, 0x0E, 0x6D, 0xDF, 100);
//-----------------------------------------------------------------------------
// Link properties
// Name: System.Link.Comment -- PKEY_Link_Comment
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_LINK) B9B4B3FC-2B51-4A42-B5D8-324146AFCF25, 5
DEFINE_PROPERTYKEY(PKEY_Link_Comment, 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 5);
// Name: System.Link.DateVisited -- PKEY_Link_DateVisited
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 5CBF2787-48CF-4208-B90E-EE5E5D420294, 23 (PKEYs relating to URLs. Used by IE History.)
DEFINE_PROPERTYKEY(PKEY_Link_DateVisited, 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 23);
// Name: System.Link.Description -- PKEY_Link_Description
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 5CBF2787-48CF-4208-B90E-EE5E5D420294, 21 (PKEYs relating to URLs. Used by IE History.)
DEFINE_PROPERTYKEY(PKEY_Link_Description, 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 21);
// Name: System.Link.Status -- PKEY_Link_Status
// Type: Int32 -- VT_I4
// FormatID: (PSGUID_LINK) B9B4B3FC-2B51-4A42-B5D8-324146AFCF25, 3 (PID_LINK_TARGET_TYPE)
//
//
DEFINE_PROPERTYKEY(PKEY_Link_Status, 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 3);
// Possible discrete values for PKEY_Link_Status are:
#define LINK_STATUS_RESOLVED 1l
#define LINK_STATUS_BROKEN 2l
// Name: System.Link.TargetExtension -- PKEY_Link_TargetExtension
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: 7A7D76F4-B630-4BD7-95FF-37CC51A975C9, 2
//
// The file extension of the link target. See System.File.Extension
DEFINE_PROPERTYKEY(PKEY_Link_TargetExtension, 0x7A7D76F4, 0xB630, 0x4BD7, 0x95, 0xFF, 0x37, 0xCC, 0x51, 0xA9, 0x75, 0xC9, 2);
// Name: System.Link.TargetParsingPath -- PKEY_Link_TargetParsingPath
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_LINK) B9B4B3FC-2B51-4A42-B5D8-324146AFCF25, 2 (PID_LINK_TARGET)
//
// This is the shell namespace path to the target of the link item. This path may be passed to
// SHParseDisplayName to parse the path to the correct shell folder.
//
// If the target item is a file, the value is identical to System.ItemPathDisplay.
//
// If the target item cannot be accessed through the shell namespace, this value is VT_EMPTY.
DEFINE_PROPERTYKEY(PKEY_Link_TargetParsingPath, 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 2);
// Name: System.Link.TargetSFGAOFlags -- PKEY_Link_TargetSFGAOFlags
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_LINK) B9B4B3FC-2B51-4A42-B5D8-324146AFCF25, 8
//
// IShellFolder::GetAttributesOf flags for the target of a link, with SFGAO_PKEYSFGAOMASK
// attributes masked out.
DEFINE_PROPERTYKEY(PKEY_Link_TargetSFGAOFlags, 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 8);
//-----------------------------------------------------------------------------
// Media properties
// Name: System.Media.AuthorUrl -- PKEY_Media_AuthorUrl
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 32 (PIDMSI_AUTHOR_URL)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_AuthorUrl, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 32);
// Name: System.Media.AverageLevel -- PKEY_Media_AverageLevel
// Type: UInt32 -- VT_UI4
// FormatID: 09EDD5B6-B301-43C5-9990-D00302EFFD46, 100
DEFINE_PROPERTYKEY(PKEY_Media_AverageLevel, 0x09EDD5B6, 0xB301, 0x43C5, 0x99, 0x90, 0xD0, 0x03, 0x02, 0xEF, 0xFD, 0x46, 100);
// Name: System.Media.ClassPrimaryID -- PKEY_Media_ClassPrimaryID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 13 (PIDMSI_CLASS_PRIMARY_ID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_ClassPrimaryID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 13);
// Name: System.Media.ClassSecondaryID -- PKEY_Media_ClassSecondaryID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 14 (PIDMSI_CLASS_SECONDARY_ID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_ClassSecondaryID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 14);
// Name: System.Media.CollectionGroupID -- PKEY_Media_CollectionGroupID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 24 (PIDMSI_COLLECTION_GROUP_ID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_CollectionGroupID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 24);
// Name: System.Media.CollectionID -- PKEY_Media_CollectionID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 25 (PIDMSI_COLLECTION_ID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_CollectionID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 25);
// Name: System.Media.ContentDistributor -- PKEY_Media_ContentDistributor
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 18 (PIDMSI_CONTENTDISTRIBUTOR)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_ContentDistributor, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 18);
// Name: System.Media.ContentID -- PKEY_Media_ContentID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 26 (PIDMSI_CONTENT_ID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_ContentID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 26);
// Name: System.Media.CreatorApplication -- PKEY_Media_CreatorApplication
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 27 (PIDMSI_TOOL_NAME)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_CreatorApplication, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 27);
// Name: System.Media.CreatorApplicationVersion -- PKEY_Media_CreatorApplicationVersion
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 28 (PIDMSI_TOOL_VERSION)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_CreatorApplicationVersion, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 28);
// Name: System.Media.DateEncoded -- PKEY_Media_DateEncoded
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 2E4B640D-5019-46D8-8881-55414CC5CAA0, 100
//
// DateTime is in UTC (in the doc, not file system).
DEFINE_PROPERTYKEY(PKEY_Media_DateEncoded, 0x2E4B640D, 0x5019, 0x46D8, 0x88, 0x81, 0x55, 0x41, 0x4C, 0xC5, 0xCA, 0xA0, 100);
// Name: System.Media.DateReleased -- PKEY_Media_DateReleased
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DE41CC29-6971-4290-B472-F59F2E2F31E2, 100
DEFINE_PROPERTYKEY(PKEY_Media_DateReleased, 0xDE41CC29, 0x6971, 0x4290, 0xB4, 0x72, 0xF5, 0x9F, 0x2E, 0x2F, 0x31, 0xE2, 100);
// Name: System.Media.Duration -- PKEY_Media_Duration
// Type: UInt64 -- VT_UI8
// FormatID: (FMTID_AudioSummaryInformation) 64440490-4C8B-11D1-8B70-080036B11A03, 3 (PIDASI_TIMELENGTH)
//
// 100ns units, not milliseconds
DEFINE_PROPERTYKEY(PKEY_Media_Duration, 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3);
// Name: System.Media.DVDID -- PKEY_Media_DVDID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 15 (PIDMSI_DVDID)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_DVDID, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 15);
// Name: System.Media.EncodedBy -- PKEY_Media_EncodedBy
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 36 (PIDMSI_ENCODED_BY)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_EncodedBy, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 36);
// Name: System.Media.EncodingSettings -- PKEY_Media_EncodingSettings
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 37 (PIDMSI_ENCODING_SETTINGS)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_EncodingSettings, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 37);
// Name: System.Media.FrameCount -- PKEY_Media_FrameCount
// Type: UInt32 -- VT_UI4
// FormatID: (PSGUID_IMAGESUMMARYINFORMATION) 6444048F-4C8B-11D1-8B70-080036B11A03, 12 (PIDISI_FRAMECOUNT)
//
// Indicates the frame count for the image.
DEFINE_PROPERTYKEY(PKEY_Media_FrameCount, 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 12);
// Name: System.Media.MCDI -- PKEY_Media_MCDI
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 16 (PIDMSI_MCDI)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_MCDI, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 16);
// Name: System.Media.MetadataContentProvider -- PKEY_Media_MetadataContentProvider
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 17 (PIDMSI_PROVIDER)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_MetadataContentProvider, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 17);
// Name: System.Media.Producer -- PKEY_Media_Producer
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 22 (PIDMSI_PRODUCER)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_Producer, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 22);
// Name: System.Media.PromotionUrl -- PKEY_Media_PromotionUrl
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 33 (PIDMSI_PROMOTION_URL)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_PromotionUrl, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 33);
// Name: System.Media.ProtectionType -- PKEY_Media_ProtectionType
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 38
//
// If media is protected, how is it protected?
DEFINE_PROPERTYKEY(PKEY_Media_ProtectionType, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 38);
// Name: System.Media.ProviderRating -- PKEY_Media_ProviderRating
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 39
//
// Rating (0 - 99) supplied by metadata provider
DEFINE_PROPERTYKEY(PKEY_Media_ProviderRating, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 39);
// Name: System.Media.ProviderStyle -- PKEY_Media_ProviderStyle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 40
//
// Style of music or video, supplied by metadata provider
DEFINE_PROPERTYKEY(PKEY_Media_ProviderStyle, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 40);
// Name: System.Media.Publisher -- PKEY_Media_Publisher
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 30 (PIDMSI_PUBLISHER)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_Publisher, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 30);
// Name: System.Media.SubscriptionContentId -- PKEY_Media_SubscriptionContentId
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 9AEBAE7A-9644-487D-A92C-657585ED751A, 100
DEFINE_PROPERTYKEY(PKEY_Media_SubscriptionContentId, 0x9AEBAE7A, 0x9644, 0x487D, 0xA9, 0x2C, 0x65, 0x75, 0x85, 0xED, 0x75, 0x1A, 100);
// Name: System.Media.SubTitle -- PKEY_Media_SubTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 38 (PIDSI_MUSIC_SUB_TITLE)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_SubTitle, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 38);
// Name: System.Media.UniqueFileIdentifier -- PKEY_Media_UniqueFileIdentifier
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 35 (PIDMSI_UNIQUE_FILE_IDENTIFIER)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_UniqueFileIdentifier, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 35);
// Name: System.Media.UserNoAutoInfo -- PKEY_Media_UserNoAutoInfo
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 41
//
// If true, do NOT alter this file's metadata. Set by user.
DEFINE_PROPERTYKEY(PKEY_Media_UserNoAutoInfo, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 41);
// Name: System.Media.UserWebUrl -- PKEY_Media_UserWebUrl
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 34 (PIDMSI_USER_WEB_URL)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_UserWebUrl, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 34);
// Name: System.Media.Writer -- PKEY_Media_Writer
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 23 (PIDMSI_WRITER)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_Writer, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 23);
// Name: System.Media.Year -- PKEY_Media_Year
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 5 (PIDSI_MUSIC_YEAR)
//
//
DEFINE_PROPERTYKEY(PKEY_Media_Year, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 5);
//-----------------------------------------------------------------------------
// Message properties
// Name: System.Message.AttachmentContents -- PKEY_Message_AttachmentContents
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 3143BF7C-80A8-4854-8880-E2E40189BDD0, 100
DEFINE_PROPERTYKEY(PKEY_Message_AttachmentContents, 0x3143BF7C, 0x80A8, 0x4854, 0x88, 0x80, 0xE2, 0xE4, 0x01, 0x89, 0xBD, 0xD0, 100);
// Name: System.Message.AttachmentNames -- PKEY_Message_AttachmentNames
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 21
//
// The names of the attachments in a message
DEFINE_PROPERTYKEY(PKEY_Message_AttachmentNames, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 21);
// Name: System.Message.BccAddress -- PKEY_Message_BccAddress
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 2
//
// Addresses in Bcc: field
DEFINE_PROPERTYKEY(PKEY_Message_BccAddress, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 2);
// Name: System.Message.BccName -- PKEY_Message_BccName
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 3
//
// person names in Bcc: field
DEFINE_PROPERTYKEY(PKEY_Message_BccName, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 3);
// Name: System.Message.CcAddress -- PKEY_Message_CcAddress
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 4
//
// Addresses in Cc: field
DEFINE_PROPERTYKEY(PKEY_Message_CcAddress, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 4);
// Name: System.Message.CcName -- PKEY_Message_CcName
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 5
//
// person names in Cc: field
DEFINE_PROPERTYKEY(PKEY_Message_CcName, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 5);
// Name: System.Message.ConversationID -- PKEY_Message_ConversationID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: DC8F80BD-AF1E-4289-85B6-3DFC1B493992, 100
DEFINE_PROPERTYKEY(PKEY_Message_ConversationID, 0xDC8F80BD, 0xAF1E, 0x4289, 0x85, 0xB6, 0x3D, 0xFC, 0x1B, 0x49, 0x39, 0x92, 100);
// Name: System.Message.ConversationIndex -- PKEY_Message_ConversationIndex
// Type: Buffer -- VT_VECTOR | VT_UI1 (For variants: VT_ARRAY | VT_UI1)
// FormatID: DC8F80BD-AF1E-4289-85B6-3DFC1B493992, 101
//
//
DEFINE_PROPERTYKEY(PKEY_Message_ConversationIndex, 0xDC8F80BD, 0xAF1E, 0x4289, 0x85, 0xB6, 0x3D, 0xFC, 0x1B, 0x49, 0x39, 0x92, 101);
// Name: System.Message.DateReceived -- PKEY_Message_DateReceived
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 20
//
// Date and Time communication was received
DEFINE_PROPERTYKEY(PKEY_Message_DateReceived, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 20);
// Name: System.Message.DateSent -- PKEY_Message_DateSent
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 19
//
// Date and Time communication was sent
DEFINE_PROPERTYKEY(PKEY_Message_DateSent, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 19);
// Name: System.Message.FromAddress -- PKEY_Message_FromAddress
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 13
DEFINE_PROPERTYKEY(PKEY_Message_FromAddress, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 13);
// Name: System.Message.FromName -- PKEY_Message_FromName
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 14
//
// Address in from field as person name
DEFINE_PROPERTYKEY(PKEY_Message_FromName, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 14);
// Name: System.Message.HasAttachments -- PKEY_Message_HasAttachments
// Type: Boolean -- VT_BOOL
// FormatID: 9C1FCF74-2D97-41BA-B4AE-CB2E3661A6E4, 8
//
//
DEFINE_PROPERTYKEY(PKEY_Message_HasAttachments, 0x9C1FCF74, 0x2D97, 0x41BA, 0xB4, 0xAE, 0xCB, 0x2E, 0x36, 0x61, 0xA6, 0xE4, 8);
// Name: System.Message.IsFwdOrReply -- PKEY_Message_IsFwdOrReply
// Type: Int32 -- VT_I4
// FormatID: 9A9BC088-4F6D-469E-9919-E705412040F9, 100
DEFINE_PROPERTYKEY(PKEY_Message_IsFwdOrReply, 0x9A9BC088, 0x4F6D, 0x469E, 0x99, 0x19, 0xE7, 0x05, 0x41, 0x20, 0x40, 0xF9, 100);
// Name: System.Message.MessageClass -- PKEY_Message_MessageClass
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CD9ED458-08CE-418F-A70E-F912C7BB9C5C, 103
//
// What type of outlook msg this is (meeting, task, mail, etc.)
DEFINE_PROPERTYKEY(PKEY_Message_MessageClass, 0xCD9ED458, 0x08CE, 0x418F, 0xA7, 0x0E, 0xF9, 0x12, 0xC7, 0xBB, 0x9C, 0x5C, 103);
// Name: System.Message.SenderAddress -- PKEY_Message_SenderAddress
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 0BE1C8E7-1981-4676-AE14-FDD78F05A6E7, 100
DEFINE_PROPERTYKEY(PKEY_Message_SenderAddress, 0x0BE1C8E7, 0x1981, 0x4676, 0xAE, 0x14, 0xFD, 0xD7, 0x8F, 0x05, 0xA6, 0xE7, 100);
// Name: System.Message.SenderName -- PKEY_Message_SenderName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 0DA41CFA-D224-4A18-AE2F-596158DB4B3A, 100
DEFINE_PROPERTYKEY(PKEY_Message_SenderName, 0x0DA41CFA, 0xD224, 0x4A18, 0xAE, 0x2F, 0x59, 0x61, 0x58, 0xDB, 0x4B, 0x3A, 100);
// Name: System.Message.Store -- PKEY_Message_Store
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 15
//
// The store (aka protocol handler) FILE, MAIL, OUTLOOKEXPRESS
DEFINE_PROPERTYKEY(PKEY_Message_Store, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 15);
// Name: System.Message.ToAddress -- PKEY_Message_ToAddress
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 16
//
// Addresses in To: field
DEFINE_PROPERTYKEY(PKEY_Message_ToAddress, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 16);
// Name: System.Message.ToDoTitle -- PKEY_Message_ToDoTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: BCCC8A3C-8CEF-42E5-9B1C-C69079398BC7, 100
DEFINE_PROPERTYKEY(PKEY_Message_ToDoTitle, 0xBCCC8A3C, 0x8CEF, 0x42E5, 0x9B, 0x1C, 0xC6, 0x90, 0x79, 0x39, 0x8B, 0xC7, 100);
// Name: System.Message.ToName -- PKEY_Message_ToName
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: E3E0584C-B788-4A5A-BB20-7F5A44C9ACDD, 17
//
// Person names in To: field
DEFINE_PROPERTYKEY(PKEY_Message_ToName, 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 17);
//-----------------------------------------------------------------------------
// Music properties
// Name: System.Music.AlbumArtist -- PKEY_Music_AlbumArtist
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 13 (PIDSI_MUSIC_ALBUM_ARTIST)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_AlbumArtist, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 13);
// Name: System.Music.AlbumTitle -- PKEY_Music_AlbumTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 4 (PIDSI_MUSIC_ALBUM)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_AlbumTitle, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 4);
// Name: System.Music.Artist -- PKEY_Music_Artist
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 2 (PIDSI_MUSIC_ARTIST)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Artist, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 2);
// Name: System.Music.BeatsPerMinute -- PKEY_Music_BeatsPerMinute
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 35 (PIDSI_MUSIC_BEATS_PER_MINUTE)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_BeatsPerMinute, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 35);
// Name: System.Music.Composer -- PKEY_Music_Composer
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 19 (PIDMSI_COMPOSER)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Composer, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 19);
// Name: System.Music.Conductor -- PKEY_Music_Conductor
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 36 (PIDSI_MUSIC_CONDUCTOR)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Conductor, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 36);
// Name: System.Music.ContentGroupDescription -- PKEY_Music_ContentGroupDescription
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 33 (PIDSI_MUSIC_CONTENT_GROUP_DESCRIPTION)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_ContentGroupDescription, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 33);
// Name: System.Music.Genre -- PKEY_Music_Genre
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 11 (PIDSI_MUSIC_GENRE)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Genre, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 11);
// Name: System.Music.InitialKey -- PKEY_Music_InitialKey
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 34 (PIDSI_MUSIC_INITIAL_KEY)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_InitialKey, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 34);
// Name: System.Music.Lyrics -- PKEY_Music_Lyrics
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 12 (PIDSI_MUSIC_LYRICS)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Lyrics, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 12);
// Name: System.Music.Mood -- PKEY_Music_Mood
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 39 (PIDSI_MUSIC_MOOD)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Mood, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 39);
// Name: System.Music.PartOfSet -- PKEY_Music_PartOfSet
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 37 (PIDSI_MUSIC_PART_OF_SET)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_PartOfSet, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 37);
// Name: System.Music.Period -- PKEY_Music_Period
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 31 (PIDMSI_PERIOD)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_Period, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 31);
// Name: System.Music.SynchronizedLyrics -- PKEY_Music_SynchronizedLyrics
// Type: Blob -- VT_BLOB
// FormatID: 6B223B6A-162E-4AA9-B39F-05D678FC6D77, 100
DEFINE_PROPERTYKEY(PKEY_Music_SynchronizedLyrics, 0x6B223B6A, 0x162E, 0x4AA9, 0xB3, 0x9F, 0x05, 0xD6, 0x78, 0xFC, 0x6D, 0x77, 100);
// Name: System.Music.TrackNumber -- PKEY_Music_TrackNumber
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_MUSIC) 56A3372E-CE9C-11D2-9F0E-006097C686F6, 7 (PIDSI_MUSIC_TRACK)
//
//
DEFINE_PROPERTYKEY(PKEY_Music_TrackNumber, 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 7);
//-----------------------------------------------------------------------------
// Note properties
// Name: System.Note.Color -- PKEY_Note_Color
// Type: UInt16 -- VT_UI2
// FormatID: 4776CAFA-BCE4-4CB1-A23E-265E76D8EB11, 100
DEFINE_PROPERTYKEY(PKEY_Note_Color, 0x4776CAFA, 0xBCE4, 0x4CB1, 0xA2, 0x3E, 0x26, 0x5E, 0x76, 0xD8, 0xEB, 0x11, 100);
// Possible discrete values for PKEY_Note_Color are:
#define NOTE_COLOR_BLUE 0u
#define NOTE_COLOR_GREEN 1u
#define NOTE_COLOR_PINK 2u
#define NOTE_COLOR_YELLOW 3u
#define NOTE_COLOR_WHITE 4u
#define NOTE_COLOR_LIGHTGREEN 5u
// Name: System.Note.ColorText -- PKEY_Note_ColorText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 46B4E8DE-CDB2-440D-885C-1658EB65B914, 100
//
// This is the user-friendly form of System.Note.Color. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Note_ColorText, 0x46B4E8DE, 0xCDB2, 0x440D, 0x88, 0x5C, 0x16, 0x58, 0xEB, 0x65, 0xB9, 0x14, 100);
//-----------------------------------------------------------------------------
// Photo properties
// Name: System.Photo.Aperture -- PKEY_Photo_Aperture
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37378
//
// PropertyTagExifAperture. Calculated from PKEY_Photo_ApertureNumerator and PKEY_Photo_ApertureDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_Aperture, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37378);
// Name: System.Photo.ApertureDenominator -- PKEY_Photo_ApertureDenominator
// Type: UInt32 -- VT_UI4
// FormatID: E1A9A38B-6685-46BD-875E-570DC7AD7320, 100
//
// Denominator of PKEY_Photo_Aperture
DEFINE_PROPERTYKEY(PKEY_Photo_ApertureDenominator, 0xE1A9A38B, 0x6685, 0x46BD, 0x87, 0x5E, 0x57, 0x0D, 0xC7, 0xAD, 0x73, 0x20, 100);
// Name: System.Photo.ApertureNumerator -- PKEY_Photo_ApertureNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 0337ECEC-39FB-4581-A0BD-4C4CC51E9914, 100
//
// Numerator of PKEY_Photo_Aperture
DEFINE_PROPERTYKEY(PKEY_Photo_ApertureNumerator, 0x0337ECEC, 0x39FB, 0x4581, 0xA0, 0xBD, 0x4C, 0x4C, 0xC5, 0x1E, 0x99, 0x14, 100);
// Name: System.Photo.Brightness -- PKEY_Photo_Brightness
// Type: Double -- VT_R8
// FormatID: 1A701BF6-478C-4361-83AB-3701BB053C58, 100 (PropertyTagExifBrightness)
//
// This is the brightness of the photo.
//
// Calculated from PKEY_Photo_BrightnessNumerator and PKEY_Photo_BrightnessDenominator.
//
// The units are "APEX", normally in the range of -99.99 to 99.99. If the numerator of
// the recorded value is FFFFFFFF.H, "Unknown" should be indicated.
DEFINE_PROPERTYKEY(PKEY_Photo_Brightness, 0x1A701BF6, 0x478C, 0x4361, 0x83, 0xAB, 0x37, 0x01, 0xBB, 0x05, 0x3C, 0x58, 100);
// Name: System.Photo.BrightnessDenominator -- PKEY_Photo_BrightnessDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 6EBE6946-2321-440A-90F0-C043EFD32476, 100
//
// Denominator of PKEY_Photo_Brightness
DEFINE_PROPERTYKEY(PKEY_Photo_BrightnessDenominator, 0x6EBE6946, 0x2321, 0x440A, 0x90, 0xF0, 0xC0, 0x43, 0xEF, 0xD3, 0x24, 0x76, 100);
// Name: System.Photo.BrightnessNumerator -- PKEY_Photo_BrightnessNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 9E7D118F-B314-45A0-8CFB-D654B917C9E9, 100
//
// Numerator of PKEY_Photo_Brightness
DEFINE_PROPERTYKEY(PKEY_Photo_BrightnessNumerator, 0x9E7D118F, 0xB314, 0x45A0, 0x8C, 0xFB, 0xD6, 0x54, 0xB9, 0x17, 0xC9, 0xE9, 100);
// Name: System.Photo.CameraManufacturer -- PKEY_Photo_CameraManufacturer
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 271 (PropertyTagEquipMake)
//
//
DEFINE_PROPERTYKEY(PKEY_Photo_CameraManufacturer, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 271);
// Name: System.Photo.CameraModel -- PKEY_Photo_CameraModel
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 272 (PropertyTagEquipModel)
//
//
DEFINE_PROPERTYKEY(PKEY_Photo_CameraModel, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 272);
// Name: System.Photo.CameraSerialNumber -- PKEY_Photo_CameraSerialNumber
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 273
//
// Serial number of camera that produced this photo
DEFINE_PROPERTYKEY(PKEY_Photo_CameraSerialNumber, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 273);
// Name: System.Photo.Contrast -- PKEY_Photo_Contrast
// Type: UInt32 -- VT_UI4
// FormatID: 2A785BA9-8D23-4DED-82E6-60A350C86A10, 100
//
// This indicates the direction of contrast processing applied by the camera
// when the image was shot.
DEFINE_PROPERTYKEY(PKEY_Photo_Contrast, 0x2A785BA9, 0x8D23, 0x4DED, 0x82, 0xE6, 0x60, 0xA3, 0x50, 0xC8, 0x6A, 0x10, 100);
// Possible discrete values for PKEY_Photo_Contrast are:
#define PHOTO_CONTRAST_NORMAL 0ul
#define PHOTO_CONTRAST_SOFT 1ul
#define PHOTO_CONTRAST_HARD 2ul
// Name: System.Photo.ContrastText -- PKEY_Photo_ContrastText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 59DDE9F2-5253-40EA-9A8B-479E96C6249A, 100
//
// This is the user-friendly form of System.Photo.Contrast. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_ContrastText, 0x59DDE9F2, 0x5253, 0x40EA, 0x9A, 0x8B, 0x47, 0x9E, 0x96, 0xC6, 0x24, 0x9A, 100);
// Name: System.Photo.DateTaken -- PKEY_Photo_DateTaken
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 36867
//
// PropertyTagExifDTOrig
DEFINE_PROPERTYKEY(PKEY_Photo_DateTaken, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 36867);
// Name: System.Photo.DigitalZoom -- PKEY_Photo_DigitalZoom
// Type: Double -- VT_R8
// FormatID: F85BF840-A925-4BC2-B0C4-8E36B598679E, 100
//
// PropertyTagExifDigitalZoom. Calculated from PKEY_Photo_DigitalZoomNumerator and PKEY_Photo_DigitalZoomDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_DigitalZoom, 0xF85BF840, 0xA925, 0x4BC2, 0xB0, 0xC4, 0x8E, 0x36, 0xB5, 0x98, 0x67, 0x9E, 100);
// Name: System.Photo.DigitalZoomDenominator -- PKEY_Photo_DigitalZoomDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 745BAF0E-E5C1-4CFB-8A1B-D031A0A52393, 100
//
// Denominator of PKEY_Photo_DigitalZoom
DEFINE_PROPERTYKEY(PKEY_Photo_DigitalZoomDenominator, 0x745BAF0E, 0xE5C1, 0x4CFB, 0x8A, 0x1B, 0xD0, 0x31, 0xA0, 0xA5, 0x23, 0x93, 100);
// Name: System.Photo.DigitalZoomNumerator -- PKEY_Photo_DigitalZoomNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 16CBB924-6500-473B-A5BE-F1599BCBE413, 100
//
// Numerator of PKEY_Photo_DigitalZoom
DEFINE_PROPERTYKEY(PKEY_Photo_DigitalZoomNumerator, 0x16CBB924, 0x6500, 0x473B, 0xA5, 0xBE, 0xF1, 0x59, 0x9B, 0xCB, 0xE4, 0x13, 100);
// Name: System.Photo.Event -- PKEY_Photo_Event
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 18248
//
// The event at which the photo was taken
DEFINE_PROPERTYKEY(PKEY_Photo_Event, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 18248);
// Name: System.Photo.EXIFVersion -- PKEY_Photo_EXIFVersion
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D35F743A-EB2E-47F2-A286-844132CB1427, 100
//
// The EXIF version.
DEFINE_PROPERTYKEY(PKEY_Photo_EXIFVersion, 0xD35F743A, 0xEB2E, 0x47F2, 0xA2, 0x86, 0x84, 0x41, 0x32, 0xCB, 0x14, 0x27, 100);
// Name: System.Photo.ExposureBias -- PKEY_Photo_ExposureBias
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37380
//
// PropertyTagExifExposureBias. Calculated from PKEY_Photo_ExposureBiasNumerator and PKEY_Photo_ExposureBiasDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureBias, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37380);
// Name: System.Photo.ExposureBiasDenominator -- PKEY_Photo_ExposureBiasDenominator
// Type: Int32 -- VT_I4
// FormatID: AB205E50-04B7-461C-A18C-2F233836E627, 100
//
// Denominator of PKEY_Photo_ExposureBias
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureBiasDenominator, 0xAB205E50, 0x04B7, 0x461C, 0xA1, 0x8C, 0x2F, 0x23, 0x38, 0x36, 0xE6, 0x27, 100);
// Name: System.Photo.ExposureBiasNumerator -- PKEY_Photo_ExposureBiasNumerator
// Type: Int32 -- VT_I4
// FormatID: 738BF284-1D87-420B-92CF-5834BF6EF9ED, 100
//
// Numerator of PKEY_Photo_ExposureBias
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureBiasNumerator, 0x738BF284, 0x1D87, 0x420B, 0x92, 0xCF, 0x58, 0x34, 0xBF, 0x6E, 0xF9, 0xED, 100);
// Name: System.Photo.ExposureIndex -- PKEY_Photo_ExposureIndex
// Type: Double -- VT_R8
// FormatID: 967B5AF8-995A-46ED-9E11-35B3C5B9782D, 100
//
// PropertyTagExifExposureIndex. Calculated from PKEY_Photo_ExposureIndexNumerator and PKEY_Photo_ExposureIndexDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureIndex, 0x967B5AF8, 0x995A, 0x46ED, 0x9E, 0x11, 0x35, 0xB3, 0xC5, 0xB9, 0x78, 0x2D, 100);
// Name: System.Photo.ExposureIndexDenominator -- PKEY_Photo_ExposureIndexDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 93112F89-C28B-492F-8A9D-4BE2062CEE8A, 100
//
// Denominator of PKEY_Photo_ExposureIndex
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureIndexDenominator, 0x93112F89, 0xC28B, 0x492F, 0x8A, 0x9D, 0x4B, 0xE2, 0x06, 0x2C, 0xEE, 0x8A, 100);
// Name: System.Photo.ExposureIndexNumerator -- PKEY_Photo_ExposureIndexNumerator
// Type: UInt32 -- VT_UI4
// FormatID: CDEDCF30-8919-44DF-8F4C-4EB2FFDB8D89, 100
//
// Numerator of PKEY_Photo_ExposureIndex
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureIndexNumerator, 0xCDEDCF30, 0x8919, 0x44DF, 0x8F, 0x4C, 0x4E, 0xB2, 0xFF, 0xDB, 0x8D, 0x89, 100);
// Name: System.Photo.ExposureProgram -- PKEY_Photo_ExposureProgram
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 34850 (PropertyTagExifExposureProg)
//
//
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureProgram, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 34850);
// Possible discrete values for PKEY_Photo_ExposureProgram are:
#define PHOTO_EXPOSUREPROGRAM_UNKNOWN 0ul
#define PHOTO_EXPOSUREPROGRAM_MANUAL 1ul
#define PHOTO_EXPOSUREPROGRAM_NORMAL 2ul
#define PHOTO_EXPOSUREPROGRAM_APERTURE 3ul
#define PHOTO_EXPOSUREPROGRAM_SHUTTER 4ul
#define PHOTO_EXPOSUREPROGRAM_CREATIVE 5ul
#define PHOTO_EXPOSUREPROGRAM_ACTION 6ul
#define PHOTO_EXPOSUREPROGRAM_PORTRAIT 7ul
#define PHOTO_EXPOSUREPROGRAM_LANDSCAPE 8ul
// Name: System.Photo.ExposureProgramText -- PKEY_Photo_ExposureProgramText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: FEC690B7-5F30-4646-AE47-4CAAFBA884A3, 100
//
// This is the user-friendly form of System.Photo.ExposureProgram. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureProgramText, 0xFEC690B7, 0x5F30, 0x4646, 0xAE, 0x47, 0x4C, 0xAA, 0xFB, 0xA8, 0x84, 0xA3, 100);
// Name: System.Photo.ExposureTime -- PKEY_Photo_ExposureTime
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 33434
//
// PropertyTagExifExposureTime. Calculated from PKEY_Photo_ExposureTimeNumerator and PKEY_Photo_ExposureTimeDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureTime, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 33434);
// Name: System.Photo.ExposureTimeDenominator -- PKEY_Photo_ExposureTimeDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 55E98597-AD16-42E0-B624-21599A199838, 100
//
// Denominator of PKEY_Photo_ExposureTime
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureTimeDenominator, 0x55E98597, 0xAD16, 0x42E0, 0xB6, 0x24, 0x21, 0x59, 0x9A, 0x19, 0x98, 0x38, 100);
// Name: System.Photo.ExposureTimeNumerator -- PKEY_Photo_ExposureTimeNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 257E44E2-9031-4323-AC38-85C552871B2E, 100
//
// Numerator of PKEY_Photo_ExposureTime
DEFINE_PROPERTYKEY(PKEY_Photo_ExposureTimeNumerator, 0x257E44E2, 0x9031, 0x4323, 0xAC, 0x38, 0x85, 0xC5, 0x52, 0x87, 0x1B, 0x2E, 100);
// Name: System.Photo.Flash -- PKEY_Photo_Flash
// Type: Byte -- VT_UI1
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37385
//
// PropertyTagExifFlash
DEFINE_PROPERTYKEY(PKEY_Photo_Flash, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37385);
// Possible discrete values for PKEY_Photo_Flash are:
#define PHOTO_FLASH_NONE 0
#define PHOTO_FLASH_FLASH 1
#define PHOTO_FLASH_WITHOUTSTROBE 5
#define PHOTO_FLASH_WITHSTROBE 7
// Name: System.Photo.FlashEnergy -- PKEY_Photo_FlashEnergy
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 41483
//
// PropertyTagExifFlashEnergy. Calculated from PKEY_Photo_FlashEnergyNumerator and PKEY_Photo_FlashEnergyDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_FlashEnergy, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 41483);
// Name: System.Photo.FlashEnergyDenominator -- PKEY_Photo_FlashEnergyDenominator
// Type: UInt32 -- VT_UI4
// FormatID: D7B61C70-6323-49CD-A5FC-C84277162C97, 100
//
// Denominator of PKEY_Photo_FlashEnergy
DEFINE_PROPERTYKEY(PKEY_Photo_FlashEnergyDenominator, 0xD7B61C70, 0x6323, 0x49CD, 0xA5, 0xFC, 0xC8, 0x42, 0x77, 0x16, 0x2C, 0x97, 100);
// Name: System.Photo.FlashEnergyNumerator -- PKEY_Photo_FlashEnergyNumerator
// Type: UInt32 -- VT_UI4
// FormatID: FCAD3D3D-0858-400F-AAA3-2F66CCE2A6BC, 100
//
// Numerator of PKEY_Photo_FlashEnergy
DEFINE_PROPERTYKEY(PKEY_Photo_FlashEnergyNumerator, 0xFCAD3D3D, 0x0858, 0x400F, 0xAA, 0xA3, 0x2F, 0x66, 0xCC, 0xE2, 0xA6, 0xBC, 100);
// Name: System.Photo.FlashManufacturer -- PKEY_Photo_FlashManufacturer
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: AABAF6C9-E0C5-4719-8585-57B103E584FE, 100
DEFINE_PROPERTYKEY(PKEY_Photo_FlashManufacturer, 0xAABAF6C9, 0xE0C5, 0x4719, 0x85, 0x85, 0x57, 0xB1, 0x03, 0xE5, 0x84, 0xFE, 100);
// Name: System.Photo.FlashModel -- PKEY_Photo_FlashModel
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: FE83BB35-4D1A-42E2-916B-06F3E1AF719E, 100
DEFINE_PROPERTYKEY(PKEY_Photo_FlashModel, 0xFE83BB35, 0x4D1A, 0x42E2, 0x91, 0x6B, 0x06, 0xF3, 0xE1, 0xAF, 0x71, 0x9E, 100);
// Name: System.Photo.FlashText -- PKEY_Photo_FlashText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6B8B68F6-200B-47EA-8D25-D8050F57339F, 100
//
// This is the user-friendly form of System.Photo.Flash. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_FlashText, 0x6B8B68F6, 0x200B, 0x47EA, 0x8D, 0x25, 0xD8, 0x05, 0x0F, 0x57, 0x33, 0x9F, 100);
// Name: System.Photo.FNumber -- PKEY_Photo_FNumber
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 33437
//
// PropertyTagExifFNumber. Calculated from PKEY_Photo_FNumberNumerator and PKEY_Photo_FNumberDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_FNumber, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 33437);
// Name: System.Photo.FNumberDenominator -- PKEY_Photo_FNumberDenominator
// Type: UInt32 -- VT_UI4
// FormatID: E92A2496-223B-4463-A4E3-30EABBA79D80, 100
//
// Denominator of PKEY_Photo_FNumber
DEFINE_PROPERTYKEY(PKEY_Photo_FNumberDenominator, 0xE92A2496, 0x223B, 0x4463, 0xA4, 0xE3, 0x30, 0xEA, 0xBB, 0xA7, 0x9D, 0x80, 100);
// Name: System.Photo.FNumberNumerator -- PKEY_Photo_FNumberNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 1B97738A-FDFC-462F-9D93-1957E08BE90C, 100
//
// Numerator of PKEY_Photo_FNumber
DEFINE_PROPERTYKEY(PKEY_Photo_FNumberNumerator, 0x1B97738A, 0xFDFC, 0x462F, 0x9D, 0x93, 0x19, 0x57, 0xE0, 0x8B, 0xE9, 0x0C, 100);
// Name: System.Photo.FocalLength -- PKEY_Photo_FocalLength
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37386
//
// PropertyTagExifFocalLength. Calculated from PKEY_Photo_FocalLengthNumerator and PKEY_Photo_FocalLengthDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_FocalLength, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37386);
// Name: System.Photo.FocalLengthDenominator -- PKEY_Photo_FocalLengthDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 305BC615-DCA1-44A5-9FD4-10C0BA79412E, 100
//
// Denominator of PKEY_Photo_FocalLength
DEFINE_PROPERTYKEY(PKEY_Photo_FocalLengthDenominator, 0x305BC615, 0xDCA1, 0x44A5, 0x9F, 0xD4, 0x10, 0xC0, 0xBA, 0x79, 0x41, 0x2E, 100);
// Name: System.Photo.FocalLengthInFilm -- PKEY_Photo_FocalLengthInFilm
// Type: UInt16 -- VT_UI2
// FormatID: A0E74609-B84D-4F49-B860-462BD9971F98, 100
DEFINE_PROPERTYKEY(PKEY_Photo_FocalLengthInFilm, 0xA0E74609, 0xB84D, 0x4F49, 0xB8, 0x60, 0x46, 0x2B, 0xD9, 0x97, 0x1F, 0x98, 100);
// Name: System.Photo.FocalLengthNumerator -- PKEY_Photo_FocalLengthNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 776B6B3B-1E3D-4B0C-9A0E-8FBAF2A8492A, 100
//
// Numerator of PKEY_Photo_FocalLength
DEFINE_PROPERTYKEY(PKEY_Photo_FocalLengthNumerator, 0x776B6B3B, 0x1E3D, 0x4B0C, 0x9A, 0x0E, 0x8F, 0xBA, 0xF2, 0xA8, 0x49, 0x2A, 100);
// Name: System.Photo.FocalPlaneXResolution -- PKEY_Photo_FocalPlaneXResolution
// Type: Double -- VT_R8
// FormatID: CFC08D97-C6F7-4484-89DD-EBEF4356FE76, 100
//
// PropertyTagExifFocalXRes. Calculated from PKEY_Photo_FocalPlaneXResolutionNumerator and
// PKEY_Photo_FocalPlaneXResolutionDenominator.
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneXResolution, 0xCFC08D97, 0xC6F7, 0x4484, 0x89, 0xDD, 0xEB, 0xEF, 0x43, 0x56, 0xFE, 0x76, 100);
// Name: System.Photo.FocalPlaneXResolutionDenominator -- PKEY_Photo_FocalPlaneXResolutionDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 0933F3F5-4786-4F46-A8E8-D64DD37FA521, 100
//
// Denominator of PKEY_Photo_FocalPlaneXResolution
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneXResolutionDenominator, 0x0933F3F5, 0x4786, 0x4F46, 0xA8, 0xE8, 0xD6, 0x4D, 0xD3, 0x7F, 0xA5, 0x21, 100);
// Name: System.Photo.FocalPlaneXResolutionNumerator -- PKEY_Photo_FocalPlaneXResolutionNumerator
// Type: UInt32 -- VT_UI4
// FormatID: DCCB10AF-B4E2-4B88-95F9-031B4D5AB490, 100
//
// Numerator of PKEY_Photo_FocalPlaneXResolution
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneXResolutionNumerator, 0xDCCB10AF, 0xB4E2, 0x4B88, 0x95, 0xF9, 0x03, 0x1B, 0x4D, 0x5A, 0xB4, 0x90, 100);
// Name: System.Photo.FocalPlaneYResolution -- PKEY_Photo_FocalPlaneYResolution
// Type: Double -- VT_R8
// FormatID: 4FFFE4D0-914F-4AC4-8D6F-C9C61DE169B1, 100
//
// PropertyTagExifFocalYRes. Calculated from PKEY_Photo_FocalPlaneYResolutionNumerator and
// PKEY_Photo_FocalPlaneYResolutionDenominator.
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneYResolution, 0x4FFFE4D0, 0x914F, 0x4AC4, 0x8D, 0x6F, 0xC9, 0xC6, 0x1D, 0xE1, 0x69, 0xB1, 100);
// Name: System.Photo.FocalPlaneYResolutionDenominator -- PKEY_Photo_FocalPlaneYResolutionDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 1D6179A6-A876-4031-B013-3347B2B64DC8, 100
//
// Denominator of PKEY_Photo_FocalPlaneYResolution
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneYResolutionDenominator, 0x1D6179A6, 0xA876, 0x4031, 0xB0, 0x13, 0x33, 0x47, 0xB2, 0xB6, 0x4D, 0xC8, 100);
// Name: System.Photo.FocalPlaneYResolutionNumerator -- PKEY_Photo_FocalPlaneYResolutionNumerator
// Type: UInt32 -- VT_UI4
// FormatID: A2E541C5-4440-4BA8-867E-75CFC06828CD, 100
//
// Numerator of PKEY_Photo_FocalPlaneYResolution
DEFINE_PROPERTYKEY(PKEY_Photo_FocalPlaneYResolutionNumerator, 0xA2E541C5, 0x4440, 0x4BA8, 0x86, 0x7E, 0x75, 0xCF, 0xC0, 0x68, 0x28, 0xCD, 100);
// Name: System.Photo.GainControl -- PKEY_Photo_GainControl
// Type: Double -- VT_R8
// FormatID: FA304789-00C7-4D80-904A-1E4DCC7265AA, 100 (PropertyTagExifGainControl)
//
// This indicates the degree of overall image gain adjustment.
//
// Calculated from PKEY_Photo_GainControlNumerator and PKEY_Photo_GainControlDenominator.
DEFINE_PROPERTYKEY(PKEY_Photo_GainControl, 0xFA304789, 0x00C7, 0x4D80, 0x90, 0x4A, 0x1E, 0x4D, 0xCC, 0x72, 0x65, 0xAA, 100);
// Possible discrete values for PKEY_Photo_GainControl are:
#define PHOTO_GAINCONTROL_NONE 0.0
#define PHOTO_GAINCONTROL_LOWGAINUP 1.0
#define PHOTO_GAINCONTROL_HIGHGAINUP 2.0
#define PHOTO_GAINCONTROL_LOWGAINDOWN 3.0
#define PHOTO_GAINCONTROL_HIGHGAINDOWN 4.0
// Name: System.Photo.GainControlDenominator -- PKEY_Photo_GainControlDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 42864DFD-9DA4-4F77-BDED-4AAD7B256735, 100
//
// Denominator of PKEY_Photo_GainControl
DEFINE_PROPERTYKEY(PKEY_Photo_GainControlDenominator, 0x42864DFD, 0x9DA4, 0x4F77, 0xBD, 0xED, 0x4A, 0xAD, 0x7B, 0x25, 0x67, 0x35, 100);
// Name: System.Photo.GainControlNumerator -- PKEY_Photo_GainControlNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 8E8ECF7C-B7B8-4EB8-A63F-0EE715C96F9E, 100
//
// Numerator of PKEY_Photo_GainControl
DEFINE_PROPERTYKEY(PKEY_Photo_GainControlNumerator, 0x8E8ECF7C, 0xB7B8, 0x4EB8, 0xA6, 0x3F, 0x0E, 0xE7, 0x15, 0xC9, 0x6F, 0x9E, 100);
// Name: System.Photo.GainControlText -- PKEY_Photo_GainControlText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C06238B2-0BF9-4279-A723-25856715CB9D, 100
//
// This is the user-friendly form of System.Photo.GainControl. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_GainControlText, 0xC06238B2, 0x0BF9, 0x4279, 0xA7, 0x23, 0x25, 0x85, 0x67, 0x15, 0xCB, 0x9D, 100);
// Name: System.Photo.ISOSpeed -- PKEY_Photo_ISOSpeed
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 34855
//
// PropertyTagExifISOSpeed
DEFINE_PROPERTYKEY(PKEY_Photo_ISOSpeed, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 34855);
// Name: System.Photo.LensManufacturer -- PKEY_Photo_LensManufacturer
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E6DDCAF7-29C5-4F0A-9A68-D19412EC7090, 100
DEFINE_PROPERTYKEY(PKEY_Photo_LensManufacturer, 0xE6DDCAF7, 0x29C5, 0x4F0A, 0x9A, 0x68, 0xD1, 0x94, 0x12, 0xEC, 0x70, 0x90, 100);
// Name: System.Photo.LensModel -- PKEY_Photo_LensModel
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: E1277516-2B5F-4869-89B1-2E585BD38B7A, 100
DEFINE_PROPERTYKEY(PKEY_Photo_LensModel, 0xE1277516, 0x2B5F, 0x4869, 0x89, 0xB1, 0x2E, 0x58, 0x5B, 0xD3, 0x8B, 0x7A, 100);
// Name: System.Photo.LightSource -- PKEY_Photo_LightSource
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37384
//
// PropertyTagExifLightSource
DEFINE_PROPERTYKEY(PKEY_Photo_LightSource, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37384);
// Possible discrete values for PKEY_Photo_LightSource are:
#define PHOTO_LIGHTSOURCE_UNKNOWN 0ul
#define PHOTO_LIGHTSOURCE_DAYLIGHT 1ul
#define PHOTO_LIGHTSOURCE_FLUORESCENT 2ul
#define PHOTO_LIGHTSOURCE_TUNGSTEN 3ul
#define PHOTO_LIGHTSOURCE_STANDARD_A 17ul
#define PHOTO_LIGHTSOURCE_STANDARD_B 18ul
#define PHOTO_LIGHTSOURCE_STANDARD_C 19ul
#define PHOTO_LIGHTSOURCE_D55 20ul
#define PHOTO_LIGHTSOURCE_D65 21ul
#define PHOTO_LIGHTSOURCE_D75 22ul
// Name: System.Photo.MakerNote -- PKEY_Photo_MakerNote
// Type: Buffer -- VT_VECTOR | VT_UI1 (For variants: VT_ARRAY | VT_UI1)
// FormatID: FA303353-B659-4052-85E9-BCAC79549B84, 100
DEFINE_PROPERTYKEY(PKEY_Photo_MakerNote, 0xFA303353, 0xB659, 0x4052, 0x85, 0xE9, 0xBC, 0xAC, 0x79, 0x54, 0x9B, 0x84, 100);
// Name: System.Photo.MakerNoteOffset -- PKEY_Photo_MakerNoteOffset
// Type: UInt64 -- VT_UI8
// FormatID: 813F4124-34E6-4D17-AB3E-6B1F3C2247A1, 100
DEFINE_PROPERTYKEY(PKEY_Photo_MakerNoteOffset, 0x813F4124, 0x34E6, 0x4D17, 0xAB, 0x3E, 0x6B, 0x1F, 0x3C, 0x22, 0x47, 0xA1, 100);
// Name: System.Photo.MaxAperture -- PKEY_Photo_MaxAperture
// Type: Double -- VT_R8
// FormatID: 08F6D7C2-E3F2-44FC-AF1E-5AA5C81A2D3E, 100
//
// Calculated from PKEY_Photo_MaxApertureNumerator and PKEY_Photo_MaxApertureDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_MaxAperture, 0x08F6D7C2, 0xE3F2, 0x44FC, 0xAF, 0x1E, 0x5A, 0xA5, 0xC8, 0x1A, 0x2D, 0x3E, 100);
// Name: System.Photo.MaxApertureDenominator -- PKEY_Photo_MaxApertureDenominator
// Type: UInt32 -- VT_UI4
// FormatID: C77724D4-601F-46C5-9B89-C53F93BCEB77, 100
//
// Denominator of PKEY_Photo_MaxAperture
DEFINE_PROPERTYKEY(PKEY_Photo_MaxApertureDenominator, 0xC77724D4, 0x601F, 0x46C5, 0x9B, 0x89, 0xC5, 0x3F, 0x93, 0xBC, 0xEB, 0x77, 100);
// Name: System.Photo.MaxApertureNumerator -- PKEY_Photo_MaxApertureNumerator
// Type: UInt32 -- VT_UI4
// FormatID: C107E191-A459-44C5-9AE6-B952AD4B906D, 100
//
// Numerator of PKEY_Photo_MaxAperture
DEFINE_PROPERTYKEY(PKEY_Photo_MaxApertureNumerator, 0xC107E191, 0xA459, 0x44C5, 0x9A, 0xE6, 0xB9, 0x52, 0xAD, 0x4B, 0x90, 0x6D, 100);
// Name: System.Photo.MeteringMode -- PKEY_Photo_MeteringMode
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37383
//
// PropertyTagExifMeteringMode
DEFINE_PROPERTYKEY(PKEY_Photo_MeteringMode, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37383);
// Possible discrete values for PKEY_Photo_MeteringMode are:
#define PHOTO_METERINGMODE_UNKNOWN 0u
#define PHOTO_METERINGMODE_AVERAGE 1u
#define PHOTO_METERINGMODE_CENTER 2u
#define PHOTO_METERINGMODE_SPOT 3u
#define PHOTO_METERINGMODE_MULTISPOT 4u
#define PHOTO_METERINGMODE_PATTERN 5u
#define PHOTO_METERINGMODE_PARTIAL 6u
// Name: System.Photo.MeteringModeText -- PKEY_Photo_MeteringModeText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: F628FD8C-7BA8-465A-A65B-C5AA79263A9E, 100
//
// This is the user-friendly form of System.Photo.MeteringMode. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_MeteringModeText, 0xF628FD8C, 0x7BA8, 0x465A, 0xA6, 0x5B, 0xC5, 0xAA, 0x79, 0x26, 0x3A, 0x9E, 100);
// Name: System.Photo.Orientation -- PKEY_Photo_Orientation
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 274 (PropertyTagOrientation)
//
// This is the image orientation viewed in terms of rows and columns.
DEFINE_PROPERTYKEY(PKEY_Photo_Orientation, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 274);
// Possible discrete values for PKEY_Photo_Orientation are:
#define PHOTO_ORIENTATION_NORMAL 1u
#define PHOTO_ORIENTATION_FLIPHORIZONTAL 2u
#define PHOTO_ORIENTATION_ROTATE180 3u
#define PHOTO_ORIENTATION_FLIPVERTICAL 4u
#define PHOTO_ORIENTATION_TRANSPOSE 5u
#define PHOTO_ORIENTATION_ROTATE270 6u
#define PHOTO_ORIENTATION_TRANSVERSE 7u
#define PHOTO_ORIENTATION_ROTATE90 8u
// Name: System.Photo.OrientationText -- PKEY_Photo_OrientationText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A9EA193C-C511-498A-A06B-58E2776DCC28, 100
//
// This is the user-friendly form of System.Photo.Orientation. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_OrientationText, 0xA9EA193C, 0xC511, 0x498A, 0xA0, 0x6B, 0x58, 0xE2, 0x77, 0x6D, 0xCC, 0x28, 100);
// Name: System.Photo.PhotometricInterpretation -- PKEY_Photo_PhotometricInterpretation
// Type: UInt16 -- VT_UI2
// FormatID: 341796F1-1DF9-4B1C-A564-91BDEFA43877, 100
//
// This is the pixel composition. In JPEG compressed data, a JPEG marker is used
// instead of this property.
DEFINE_PROPERTYKEY(PKEY_Photo_PhotometricInterpretation, 0x341796F1, 0x1DF9, 0x4B1C, 0xA5, 0x64, 0x91, 0xBD, 0xEF, 0xA4, 0x38, 0x77, 100);
// Possible discrete values for PKEY_Photo_PhotometricInterpretation are:
#define PHOTO_PHOTOMETRIC_RGB 2u
#define PHOTO_PHOTOMETRIC_YCBCR 6u
// Name: System.Photo.PhotometricInterpretationText -- PKEY_Photo_PhotometricInterpretationText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 821437D6-9EAB-4765-A589-3B1CBBD22A61, 100
//
// This is the user-friendly form of System.Photo.PhotometricInterpretation. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_PhotometricInterpretationText, 0x821437D6, 0x9EAB, 0x4765, 0xA5, 0x89, 0x3B, 0x1C, 0xBB, 0xD2, 0x2A, 0x61, 100);
// Name: System.Photo.ProgramMode -- PKEY_Photo_ProgramMode
// Type: UInt32 -- VT_UI4
// FormatID: 6D217F6D-3F6A-4825-B470-5F03CA2FBE9B, 100
//
// This is the class of the program used by the camera to set exposure when the
// picture is taken.
DEFINE_PROPERTYKEY(PKEY_Photo_ProgramMode, 0x6D217F6D, 0x3F6A, 0x4825, 0xB4, 0x70, 0x5F, 0x03, 0xCA, 0x2F, 0xBE, 0x9B, 100);
// Possible discrete values for PKEY_Photo_ProgramMode are:
#define PHOTO_PROGRAMMODE_NOTDEFINED 0ul
#define PHOTO_PROGRAMMODE_MANUAL 1ul
#define PHOTO_PROGRAMMODE_NORMAL 2ul
#define PHOTO_PROGRAMMODE_APERTURE 3ul
#define PHOTO_PROGRAMMODE_SHUTTER 4ul
#define PHOTO_PROGRAMMODE_CREATIVE 5ul
#define PHOTO_PROGRAMMODE_ACTION 6ul
#define PHOTO_PROGRAMMODE_PORTRAIT 7ul
#define PHOTO_PROGRAMMODE_LANDSCAPE 8ul
// Name: System.Photo.ProgramModeText -- PKEY_Photo_ProgramModeText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7FE3AA27-2648-42F3-89B0-454E5CB150C3, 100
//
// This is the user-friendly form of System.Photo.ProgramMode. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_ProgramModeText, 0x7FE3AA27, 0x2648, 0x42F3, 0x89, 0xB0, 0x45, 0x4E, 0x5C, 0xB1, 0x50, 0xC3, 100);
// Name: System.Photo.RelatedSoundFile -- PKEY_Photo_RelatedSoundFile
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 318A6B45-087F-4DC2-B8CC-05359551FC9E, 100
DEFINE_PROPERTYKEY(PKEY_Photo_RelatedSoundFile, 0x318A6B45, 0x087F, 0x4DC2, 0xB8, 0xCC, 0x05, 0x35, 0x95, 0x51, 0xFC, 0x9E, 100);
// Name: System.Photo.Saturation -- PKEY_Photo_Saturation
// Type: UInt32 -- VT_UI4
// FormatID: 49237325-A95A-4F67-B211-816B2D45D2E0, 100
//
// This indicates the direction of saturation processing applied by the camera when
// the image was shot.
DEFINE_PROPERTYKEY(PKEY_Photo_Saturation, 0x49237325, 0xA95A, 0x4F67, 0xB2, 0x11, 0x81, 0x6B, 0x2D, 0x45, 0xD2, 0xE0, 100);
// Possible discrete values for PKEY_Photo_Saturation are:
#define PHOTO_SATURATION_NORMAL 0ul
#define PHOTO_SATURATION_LOW 1ul
#define PHOTO_SATURATION_HIGH 2ul
// Name: System.Photo.SaturationText -- PKEY_Photo_SaturationText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 61478C08-B600-4A84-BBE4-E99C45F0A072, 100
//
// This is the user-friendly form of System.Photo.Saturation. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_SaturationText, 0x61478C08, 0xB600, 0x4A84, 0xBB, 0xE4, 0xE9, 0x9C, 0x45, 0xF0, 0xA0, 0x72, 100);
// Name: System.Photo.Sharpness -- PKEY_Photo_Sharpness
// Type: UInt32 -- VT_UI4
// FormatID: FC6976DB-8349-4970-AE97-B3C5316A08F0, 100
//
// This indicates the direction of sharpness processing applied by the camera when
// the image was shot.
DEFINE_PROPERTYKEY(PKEY_Photo_Sharpness, 0xFC6976DB, 0x8349, 0x4970, 0xAE, 0x97, 0xB3, 0xC5, 0x31, 0x6A, 0x08, 0xF0, 100);
// Possible discrete values for PKEY_Photo_Sharpness are:
#define PHOTO_SHARPNESS_NORMAL 0ul
#define PHOTO_SHARPNESS_SOFT 1ul
#define PHOTO_SHARPNESS_HARD 2ul
// Name: System.Photo.SharpnessText -- PKEY_Photo_SharpnessText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 51EC3F47-DD50-421D-8769-334F50424B1E, 100
//
// This is the user-friendly form of System.Photo.Sharpness. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_SharpnessText, 0x51EC3F47, 0xDD50, 0x421D, 0x87, 0x69, 0x33, 0x4F, 0x50, 0x42, 0x4B, 0x1E, 100);
// Name: System.Photo.ShutterSpeed -- PKEY_Photo_ShutterSpeed
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37377
//
// PropertyTagExifShutterSpeed. Calculated from PKEY_Photo_ShutterSpeedNumerator and PKEY_Photo_ShutterSpeedDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_ShutterSpeed, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37377);
// Name: System.Photo.ShutterSpeedDenominator -- PKEY_Photo_ShutterSpeedDenominator
// Type: Int32 -- VT_I4
// FormatID: E13D8975-81C7-4948-AE3F-37CAE11E8FF7, 100
//
// Denominator of PKEY_Photo_ShutterSpeed
DEFINE_PROPERTYKEY(PKEY_Photo_ShutterSpeedDenominator, 0xE13D8975, 0x81C7, 0x4948, 0xAE, 0x3F, 0x37, 0xCA, 0xE1, 0x1E, 0x8F, 0xF7, 100);
// Name: System.Photo.ShutterSpeedNumerator -- PKEY_Photo_ShutterSpeedNumerator
// Type: Int32 -- VT_I4
// FormatID: 16EA4042-D6F4-4BCA-8349-7C78D30FB333, 100
//
// Numerator of PKEY_Photo_ShutterSpeed
DEFINE_PROPERTYKEY(PKEY_Photo_ShutterSpeedNumerator, 0x16EA4042, 0xD6F4, 0x4BCA, 0x83, 0x49, 0x7C, 0x78, 0xD3, 0x0F, 0xB3, 0x33, 100);
// Name: System.Photo.SubjectDistance -- PKEY_Photo_SubjectDistance
// Type: Double -- VT_R8
// FormatID: (FMTID_ImageProperties) 14B81DA1-0135-4D31-96D9-6CBFC9671A99, 37382
//
// PropertyTagExifSubjectDist. Calculated from PKEY_Photo_SubjectDistanceNumerator and PKEY_Photo_SubjectDistanceDenominator
DEFINE_PROPERTYKEY(PKEY_Photo_SubjectDistance, 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37382);
// Name: System.Photo.SubjectDistanceDenominator -- PKEY_Photo_SubjectDistanceDenominator
// Type: UInt32 -- VT_UI4
// FormatID: 0C840A88-B043-466D-9766-D4B26DA3FA77, 100
//
// Denominator of PKEY_Photo_SubjectDistance
DEFINE_PROPERTYKEY(PKEY_Photo_SubjectDistanceDenominator, 0x0C840A88, 0xB043, 0x466D, 0x97, 0x66, 0xD4, 0xB2, 0x6D, 0xA3, 0xFA, 0x77, 100);
// Name: System.Photo.SubjectDistanceNumerator -- PKEY_Photo_SubjectDistanceNumerator
// Type: UInt32 -- VT_UI4
// FormatID: 8AF4961C-F526-43E5-AA81-DB768219178D, 100
//
// Numerator of PKEY_Photo_SubjectDistance
DEFINE_PROPERTYKEY(PKEY_Photo_SubjectDistanceNumerator, 0x8AF4961C, 0xF526, 0x43E5, 0xAA, 0x81, 0xDB, 0x76, 0x82, 0x19, 0x17, 0x8D, 100);
// Name: System.Photo.TranscodedForSync -- PKEY_Photo_TranscodedForSync
// Type: Boolean -- VT_BOOL
// FormatID: 9A8EBB75-6458-4E82-BACB-35C0095B03BB, 100
DEFINE_PROPERTYKEY(PKEY_Photo_TranscodedForSync, 0x9A8EBB75, 0x6458, 0x4E82, 0xBA, 0xCB, 0x35, 0xC0, 0x09, 0x5B, 0x03, 0xBB, 100);
// Name: System.Photo.WhiteBalance -- PKEY_Photo_WhiteBalance
// Type: UInt32 -- VT_UI4
// FormatID: EE3D3D8A-5381-4CFA-B13B-AAF66B5F4EC9, 100
//
// This indicates the white balance mode set when the image was shot.
DEFINE_PROPERTYKEY(PKEY_Photo_WhiteBalance, 0xEE3D3D8A, 0x5381, 0x4CFA, 0xB1, 0x3B, 0xAA, 0xF6, 0x6B, 0x5F, 0x4E, 0xC9, 100);
// Possible discrete values for PKEY_Photo_WhiteBalance are:
#define PHOTO_WHITEBALANCE_AUTO 0ul
#define PHOTO_WHITEBALANCE_MANUAL 1ul
// Name: System.Photo.WhiteBalanceText -- PKEY_Photo_WhiteBalanceText
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6336B95E-C7A7-426D-86FD-7AE3D39C84B4, 100
//
// This is the user-friendly form of System.Photo.WhiteBalance. Not intended to be parsed
// programmatically.
DEFINE_PROPERTYKEY(PKEY_Photo_WhiteBalanceText, 0x6336B95E, 0xC7A7, 0x426D, 0x86, 0xFD, 0x7A, 0xE3, 0xD3, 0x9C, 0x84, 0xB4, 100);
//-----------------------------------------------------------------------------
// PropGroup properties
// Name: System.PropGroup.Advanced -- PKEY_PropGroup_Advanced
// Type: Null -- VT_NULL
// FormatID: 900A403B-097B-4B95-8AE2-071FDAEEB118, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Advanced, 0x900A403B, 0x097B, 0x4B95, 0x8A, 0xE2, 0x07, 0x1F, 0xDA, 0xEE, 0xB1, 0x18, 100);
// Name: System.PropGroup.Audio -- PKEY_PropGroup_Audio
// Type: Null -- VT_NULL
// FormatID: 2804D469-788F-48AA-8570-71B9C187E138, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Audio, 0x2804D469, 0x788F, 0x48AA, 0x85, 0x70, 0x71, 0xB9, 0xC1, 0x87, 0xE1, 0x38, 100);
// Name: System.PropGroup.Calendar -- PKEY_PropGroup_Calendar
// Type: Null -- VT_NULL
// FormatID: 9973D2B5-BFD8-438A-BA94-5349B293181A, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Calendar, 0x9973D2B5, 0xBFD8, 0x438A, 0xBA, 0x94, 0x53, 0x49, 0xB2, 0x93, 0x18, 0x1A, 100);
// Name: System.PropGroup.Camera -- PKEY_PropGroup_Camera
// Type: Null -- VT_NULL
// FormatID: DE00DE32-547E-4981-AD4B-542F2E9007D8, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Camera, 0xDE00DE32, 0x547E, 0x4981, 0xAD, 0x4B, 0x54, 0x2F, 0x2E, 0x90, 0x07, 0xD8, 100);
// Name: System.PropGroup.Contact -- PKEY_PropGroup_Contact
// Type: Null -- VT_NULL
// FormatID: DF975FD3-250A-4004-858F-34E29A3E37AA, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Contact, 0xDF975FD3, 0x250A, 0x4004, 0x85, 0x8F, 0x34, 0xE2, 0x9A, 0x3E, 0x37, 0xAA, 100);
// Name: System.PropGroup.Content -- PKEY_PropGroup_Content
// Type: Null -- VT_NULL
// FormatID: D0DAB0BA-368A-4050-A882-6C010FD19A4F, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Content, 0xD0DAB0BA, 0x368A, 0x4050, 0xA8, 0x82, 0x6C, 0x01, 0x0F, 0xD1, 0x9A, 0x4F, 100);
// Name: System.PropGroup.Description -- PKEY_PropGroup_Description
// Type: Null -- VT_NULL
// FormatID: 8969B275-9475-4E00-A887-FF93B8B41E44, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Description, 0x8969B275, 0x9475, 0x4E00, 0xA8, 0x87, 0xFF, 0x93, 0xB8, 0xB4, 0x1E, 0x44, 100);
// Name: System.PropGroup.FileSystem -- PKEY_PropGroup_FileSystem
// Type: Null -- VT_NULL
// FormatID: E3A7D2C1-80FC-4B40-8F34-30EA111BDC2E, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_FileSystem, 0xE3A7D2C1, 0x80FC, 0x4B40, 0x8F, 0x34, 0x30, 0xEA, 0x11, 0x1B, 0xDC, 0x2E, 100);
// Name: System.PropGroup.General -- PKEY_PropGroup_General
// Type: Null -- VT_NULL
// FormatID: CC301630-B192-4C22-B372-9F4C6D338E07, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_General, 0xCC301630, 0xB192, 0x4C22, 0xB3, 0x72, 0x9F, 0x4C, 0x6D, 0x33, 0x8E, 0x07, 100);
// Name: System.PropGroup.GPS -- PKEY_PropGroup_GPS
// Type: Null -- VT_NULL
// FormatID: F3713ADA-90E3-4E11-AAE5-FDC17685B9BE, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_GPS, 0xF3713ADA, 0x90E3, 0x4E11, 0xAA, 0xE5, 0xFD, 0xC1, 0x76, 0x85, 0xB9, 0xBE, 100);
// Name: System.PropGroup.Image -- PKEY_PropGroup_Image
// Type: Null -- VT_NULL
// FormatID: E3690A87-0FA8-4A2A-9A9F-FCE8827055AC, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Image, 0xE3690A87, 0x0FA8, 0x4A2A, 0x9A, 0x9F, 0xFC, 0xE8, 0x82, 0x70, 0x55, 0xAC, 100);
// Name: System.PropGroup.Media -- PKEY_PropGroup_Media
// Type: Null -- VT_NULL
// FormatID: 61872CF7-6B5E-4B4B-AC2D-59DA84459248, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Media, 0x61872CF7, 0x6B5E, 0x4B4B, 0xAC, 0x2D, 0x59, 0xDA, 0x84, 0x45, 0x92, 0x48, 100);
// Name: System.PropGroup.MediaAdvanced -- PKEY_PropGroup_MediaAdvanced
// Type: Null -- VT_NULL
// FormatID: 8859A284-DE7E-4642-99BA-D431D044B1EC, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_MediaAdvanced, 0x8859A284, 0xDE7E, 0x4642, 0x99, 0xBA, 0xD4, 0x31, 0xD0, 0x44, 0xB1, 0xEC, 100);
// Name: System.PropGroup.Message -- PKEY_PropGroup_Message
// Type: Null -- VT_NULL
// FormatID: 7FD7259D-16B4-4135-9F97-7C96ECD2FA9E, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Message, 0x7FD7259D, 0x16B4, 0x4135, 0x9F, 0x97, 0x7C, 0x96, 0xEC, 0xD2, 0xFA, 0x9E, 100);
// Name: System.PropGroup.Music -- PKEY_PropGroup_Music
// Type: Null -- VT_NULL
// FormatID: 68DD6094-7216-40F1-A029-43FE7127043F, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Music, 0x68DD6094, 0x7216, 0x40F1, 0xA0, 0x29, 0x43, 0xFE, 0x71, 0x27, 0x04, 0x3F, 100);
// Name: System.PropGroup.Origin -- PKEY_PropGroup_Origin
// Type: Null -- VT_NULL
// FormatID: 2598D2FB-5569-4367-95DF-5CD3A177E1A5, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Origin, 0x2598D2FB, 0x5569, 0x4367, 0x95, 0xDF, 0x5C, 0xD3, 0xA1, 0x77, 0xE1, 0xA5, 100);
// Name: System.PropGroup.PhotoAdvanced -- PKEY_PropGroup_PhotoAdvanced
// Type: Null -- VT_NULL
// FormatID: 0CB2BF5A-9EE7-4A86-8222-F01E07FDADAF, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_PhotoAdvanced, 0x0CB2BF5A, 0x9EE7, 0x4A86, 0x82, 0x22, 0xF0, 0x1E, 0x07, 0xFD, 0xAD, 0xAF, 100);
// Name: System.PropGroup.RecordedTV -- PKEY_PropGroup_RecordedTV
// Type: Null -- VT_NULL
// FormatID: E7B33238-6584-4170-A5C0-AC25EFD9DA56, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_RecordedTV, 0xE7B33238, 0x6584, 0x4170, 0xA5, 0xC0, 0xAC, 0x25, 0xEF, 0xD9, 0xDA, 0x56, 100);
// Name: System.PropGroup.Video -- PKEY_PropGroup_Video
// Type: Null -- VT_NULL
// FormatID: BEBE0920-7671-4C54-A3EB-49FDDFC191EE, 100
DEFINE_PROPERTYKEY(PKEY_PropGroup_Video, 0xBEBE0920, 0x7671, 0x4C54, 0xA3, 0xEB, 0x49, 0xFD, 0xDF, 0xC1, 0x91, 0xEE, 100);
//-----------------------------------------------------------------------------
// PropList properties
// Name: System.PropList.ConflictPrompt -- PKEY_PropList_ConflictPrompt
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 11
//
// The list of properties to show in the file operation conflict resolution dialog. Properties with empty
// values will not be displayed. Register under the regvalue of "ConflictPrompt".
DEFINE_PROPERTYKEY(PKEY_PropList_ConflictPrompt, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 11);
// Name: System.PropList.ExtendedTileInfo -- PKEY_PropList_ExtendedTileInfo
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 9
//
// The list of properties to show in the listview on extended tiles. Register under the regvalue of
// "ExtendedTileInfo".
DEFINE_PROPERTYKEY(PKEY_PropList_ExtendedTileInfo, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 9);
// Name: System.PropList.FileOperationPrompt -- PKEY_PropList_FileOperationPrompt
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 10
//
// The list of properties to show in the file operation confirmation dialog. Properties with empty values
// will not be displayed. If this list is not specified, then the InfoTip property list is used instead.
// Register under the regvalue of "FileOperationPrompt".
DEFINE_PROPERTYKEY(PKEY_PropList_FileOperationPrompt, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 10);
// Name: System.PropList.FullDetails -- PKEY_PropList_FullDetails
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 2
//
// The list of all the properties to show in the details page. Property groups can be included in this list
// in order to more easily organize the UI. Register under the regvalue of "FullDetails".
DEFINE_PROPERTYKEY(PKEY_PropList_FullDetails, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 2);
// Name: System.PropList.InfoTip -- PKEY_PropList_InfoTip
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 4 (PID_PROPLIST_INFOTIP)
//
// The list of properties to show in the infotip. Properties with empty values will not be displayed. Register
// under the regvalue of "InfoTip".
DEFINE_PROPERTYKEY(PKEY_PropList_InfoTip, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 4);
// Name: System.PropList.NonPersonal -- PKEY_PropList_NonPersonal
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 49D1091F-082E-493F-B23F-D2308AA9668C, 100
//
// The list of properties that are considered 'non-personal'. When told to remove all non-personal properties
// from a given file, the system will leave these particular properties untouched. Register under the regvalue
// of "NonPersonal".
DEFINE_PROPERTYKEY(PKEY_PropList_NonPersonal, 0x49D1091F, 0x082E, 0x493F, 0xB2, 0x3F, 0xD2, 0x30, 0x8A, 0xA9, 0x66, 0x8C, 100);
// Name: System.PropList.PreviewDetails -- PKEY_PropList_PreviewDetails
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 8
//
// The list of properties to display in the preview pane. Register under the regvalue of "PreviewDetails".
DEFINE_PROPERTYKEY(PKEY_PropList_PreviewDetails, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 8);
// Name: System.PropList.PreviewTitle -- PKEY_PropList_PreviewTitle
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 6
//
// The one or two properties to display in the preview pane title section. The optional second property is
// displayed as a subtitle. Register under the regvalue of "PreviewTitle".
DEFINE_PROPERTYKEY(PKEY_PropList_PreviewTitle, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 6);
// Name: System.PropList.QuickTip -- PKEY_PropList_QuickTip
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 5 (PID_PROPLIST_QUICKTIP)
//
// The list of properties to show in the infotip when the item is on a slow network. Properties with empty
// values will not be displayed. Register under the regvalue of "QuickTip".
DEFINE_PROPERTYKEY(PKEY_PropList_QuickTip, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 5);
// Name: System.PropList.TileInfo -- PKEY_PropList_TileInfo
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: C9944A21-A406-48FE-8225-AEC7E24C211B, 3 (PID_PROPLIST_TILEINFO)
//
// The list of properties to show in the listview on tiles. Register under the regvalue of "TileInfo".
DEFINE_PROPERTYKEY(PKEY_PropList_TileInfo, 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 3);
// Name: System.PropList.XPDetailsPanel -- PKEY_PropList_XPDetailsPanel
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_WebView) F2275480-F782-4291-BD94-F13693513AEC, 0 (PID_DISPLAY_PROPERTIES)
//
// The list of properties to display in the XP webview details panel. Obsolete.
DEFINE_PROPERTYKEY(PKEY_PropList_XPDetailsPanel, 0xF2275480, 0xF782, 0x4291, 0xBD, 0x94, 0xF1, 0x36, 0x93, 0x51, 0x3A, 0xEC, 0);
//-----------------------------------------------------------------------------
// RecordedTV properties
// Name: System.RecordedTV.ChannelNumber -- PKEY_RecordedTV_ChannelNumber
// Type: UInt32 -- VT_UI4
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 7
//
// Example: 42
DEFINE_PROPERTYKEY(PKEY_RecordedTV_ChannelNumber, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 7);
// Name: System.RecordedTV.Credits -- PKEY_RecordedTV_Credits
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 4
//
// Example: "<NAME>/<NAME>/<NAME>/<NAME>/<NAME>;;;"
DEFINE_PROPERTYKEY(PKEY_RecordedTV_Credits, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 4);
// Name: System.RecordedTV.DateContentExpires -- PKEY_RecordedTV_DateContentExpires
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 15
DEFINE_PROPERTYKEY(PKEY_RecordedTV_DateContentExpires, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 15);
// Name: System.RecordedTV.EpisodeName -- PKEY_RecordedTV_EpisodeName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 2
//
// Example: "Nowhere to Hyde"
DEFINE_PROPERTYKEY(PKEY_RecordedTV_EpisodeName, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 2);
// Name: System.RecordedTV.IsATSCContent -- PKEY_RecordedTV_IsATSCContent
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 16
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsATSCContent, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 16);
// Name: System.RecordedTV.IsClosedCaptioningAvailable -- PKEY_RecordedTV_IsClosedCaptioningAvailable
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 12
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsClosedCaptioningAvailable, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 12);
// Name: System.RecordedTV.IsDTVContent -- PKEY_RecordedTV_IsDTVContent
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 17
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsDTVContent, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 17);
// Name: System.RecordedTV.IsHDContent -- PKEY_RecordedTV_IsHDContent
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 18
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsHDContent, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 18);
// Name: System.RecordedTV.IsRepeatBroadcast -- PKEY_RecordedTV_IsRepeatBroadcast
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 13
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsRepeatBroadcast, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 13);
// Name: System.RecordedTV.IsSAP -- PKEY_RecordedTV_IsSAP
// Type: Boolean -- VT_BOOL
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 14
DEFINE_PROPERTYKEY(PKEY_RecordedTV_IsSAP, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 14);
// Name: System.RecordedTV.NetworkAffiliation -- PKEY_RecordedTV_NetworkAffiliation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 2C53C813-FB63-4E22-A1AB-0B331CA1E273, 100
DEFINE_PROPERTYKEY(PKEY_RecordedTV_NetworkAffiliation, 0x2C53C813, 0xFB63, 0x4E22, 0xA1, 0xAB, 0x0B, 0x33, 0x1C, 0xA1, 0xE2, 0x73, 100);
// Name: System.RecordedTV.OriginalBroadcastDate -- PKEY_RecordedTV_OriginalBroadcastDate
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 4684FE97-8765-4842-9C13-F006447B178C, 100
DEFINE_PROPERTYKEY(PKEY_RecordedTV_OriginalBroadcastDate, 0x4684FE97, 0x8765, 0x4842, 0x9C, 0x13, 0xF0, 0x06, 0x44, 0x7B, 0x17, 0x8C, 100);
// Name: System.RecordedTV.ProgramDescription -- PKEY_RecordedTV_ProgramDescription
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 3
DEFINE_PROPERTYKEY(PKEY_RecordedTV_ProgramDescription, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 3);
// Name: System.RecordedTV.RecordingTime -- PKEY_RecordedTV_RecordingTime
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: A5477F61-7A82-4ECA-9DDE-98B69B2479B3, 100
DEFINE_PROPERTYKEY(PKEY_RecordedTV_RecordingTime, 0xA5477F61, 0x7A82, 0x4ECA, 0x9D, 0xDE, 0x98, 0xB6, 0x9B, 0x24, 0x79, 0xB3, 100);
// Name: System.RecordedTV.StationCallSign -- PKEY_RecordedTV_StationCallSign
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 6D748DE2-8D38-4CC3-AC60-F009B057C557, 5
//
// Example: "TOONP"
DEFINE_PROPERTYKEY(PKEY_RecordedTV_StationCallSign, 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 5);
// Name: System.RecordedTV.StationName -- PKEY_RecordedTV_StationName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 1B5439E7-EBA1-4AF8-BDD7-7AF1D4549493, 100
DEFINE_PROPERTYKEY(PKEY_RecordedTV_StationName, 0x1B5439E7, 0xEBA1, 0x4AF8, 0xBD, 0xD7, 0x7A, 0xF1, 0xD4, 0x54, 0x94, 0x93, 100);
//-----------------------------------------------------------------------------
// Search properties
// Name: System.Search.AutoSummary -- PKEY_Search_AutoSummary
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 560C36C0-503A-11CF-BAA1-00004C752A9A, 2
//
// General Summary of the document.
DEFINE_PROPERTYKEY(PKEY_Search_AutoSummary, 0x560C36C0, 0x503A, 0x11CF, 0xBA, 0xA1, 0x00, 0x00, 0x4C, 0x75, 0x2A, 0x9A, 2);
// Name: System.Search.ContainerHash -- PKEY_Search_ContainerHash
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: BCEEE283-35DF-4D53-826A-F36A3EEFC6BE, 100
//
// Hash code used to identify attachments to be deleted based on a common container url
DEFINE_PROPERTYKEY(PKEY_Search_ContainerHash, 0xBCEEE283, 0x35DF, 0x4D53, 0x82, 0x6A, 0xF3, 0x6A, 0x3E, 0xEF, 0xC6, 0xBE, 100);
// Name: System.Search.Contents -- PKEY_Search_Contents
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Storage) B725F130-47EF-101A-A5F1-02608C9EEBAC, 19 (PID_STG_CONTENTS)
//
// The contents of the item. This property is for query restrictions only; it cannot be retrieved in a
// query result. The Indexing Service friendly name is 'contents'.
DEFINE_PROPERTYKEY(PKEY_Search_Contents, 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 19);
// Name: System.Search.EntryID -- PKEY_Search_EntryID
// Type: Int32 -- VT_I4
// FormatID: (FMTID_Query) 49691C90-7E17-101A-A91C-08002B2ECDA9, 5 (PROPID_QUERY_WORKID)
//
// The entry ID for an item within a given catalog in the Windows Search Index.
// This value may be recycled, and therefore is not considered unique over time.
DEFINE_PROPERTYKEY(PKEY_Search_EntryID, 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 5);
// Name: System.Search.GatherTime -- PKEY_Search_GatherTime
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 0B63E350-9CCC-11D0-BCDB-00805FCCCE04, 8
//
// The Datetime that the Windows Search Gatherer process last pushed properties of this document to the Windows Search Gatherer Plugins.
DEFINE_PROPERTYKEY(PKEY_Search_GatherTime, 0x0B63E350, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 8);
// Name: System.Search.IsClosedDirectory -- PKEY_Search_IsClosedDirectory
// Type: Boolean -- VT_BOOL
// FormatID: 0B63E343-9CCC-11D0-BCDB-00805FCCCE04, 23
//
// If this property is emitted with a value of TRUE, then it indicates that this URL's last modified time applies to all of it's children, and if this URL is deleted then all of it's children are deleted as well. For example, this would be emitted as TRUE when emitting the URL of an email so that all attachments are tied to the last modified time of that email.
DEFINE_PROPERTYKEY(PKEY_Search_IsClosedDirectory, 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 23);
// Name: System.Search.IsFullyContained -- PKEY_Search_IsFullyContained
// Type: Boolean -- VT_BOOL
// FormatID: 0B63E343-9CCC-11D0-BCDB-00805FCCCE04, 24
//
// Any child URL of a URL which has System.Search.IsClosedDirectory=TRUE must emit System.Search.IsFullyContained=TRUE. This ensures that the URL is not deleted at the end of a crawl because it hasn't been visited (which is the normal mechanism for detecting deletes). For example an email attachment would emit this property
DEFINE_PROPERTYKEY(PKEY_Search_IsFullyContained, 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 24);
// Name: System.Search.QueryFocusedSummary -- PKEY_Search_QueryFocusedSummary
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 560C36C0-503A-11CF-BAA1-00004C752A9A, 3
//
// Query Focused Summary of the document.
DEFINE_PROPERTYKEY(PKEY_Search_QueryFocusedSummary, 0x560C36C0, 0x503A, 0x11CF, 0xBA, 0xA1, 0x00, 0x00, 0x4C, 0x75, 0x2A, 0x9A, 3);
// Name: System.Search.Rank -- PKEY_Search_Rank
// Type: Int32 -- VT_I4
// FormatID: (FMTID_Query) 49691C90-7E17-101A-A91C-08002B2ECDA9, 3 (PROPID_QUERY_RANK)
//
// Relevance rank of row. Ranges from 0-1000. Larger numbers = better matches. Query-time only, not
// defined in Search schema, retrievable but not searchable.
DEFINE_PROPERTYKEY(PKEY_Search_Rank, 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 3);
// Name: System.Search.Store -- PKEY_Search_Store
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: A06992B3-8CAF-4ED7-A547-B259E32AC9FC, 100
//
// The identifier for the protocol handler that produced this item. (E.g. MAPI, CSC, FILE etc.)
DEFINE_PROPERTYKEY(PKEY_Search_Store, 0xA06992B3, 0x8CAF, 0x4ED7, 0xA5, 0x47, 0xB2, 0x59, 0xE3, 0x2A, 0xC9, 0xFC, 100);
// Name: System.Search.UrlToIndex -- PKEY_Search_UrlToIndex
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 0B63E343-9CCC-11D0-BCDB-00805FCCCE04, 2
//
// This property should be emitted by a container IFilter for each child URL within the container. The children will eventually be crawled by the indexer if they are within scope.
DEFINE_PROPERTYKEY(PKEY_Search_UrlToIndex, 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 2);
// Name: System.Search.UrlToIndexWithModificationTime -- PKEY_Search_UrlToIndexWithModificationTime
// Type: Multivalue Any -- VT_VECTOR | VT_NULL (For variants: VT_ARRAY | VT_NULL)
// FormatID: 0B63E343-9CCC-11D0-BCDB-00805FCCCE04, 12
//
// This property is the same as System.Search.UrlToIndex except that it includes the time the URL was last modified. This is an optimization for the indexer as it doesn't have to call back into the protocol handler to ask for this information to determine if the content needs to be indexed again. The property is a vector with two elements, a VT_LPWSTR with the URL and a VT_FILETIME for the last modified time.
DEFINE_PROPERTYKEY(PKEY_Search_UrlToIndexWithModificationTime, 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 12);
//-----------------------------------------------------------------------------
// Shell properties
// Name: System.DescriptionID -- PKEY_DescriptionID
// Type: Buffer -- VT_VECTOR | VT_UI1 (For variants: VT_ARRAY | VT_UI1)
// FormatID: (FMTID_ShellDetails) 28636AA6-953D-11D2-B5D6-00C04FD918D0, 2 (PID_DESCRIPTIONID)
//
// The contents of a SHDESCRIPTIONID structure as a buffer of bytes.
DEFINE_PROPERTYKEY(PKEY_DescriptionID, 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 2);
// Name: System.Link.TargetSFGAOFlagsStrings -- PKEY_Link_TargetSFGAOFlagsStrings
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D6942081-D53B-443D-AD47-5E059D9CD27A, 3
//
// Expresses the SFGAO flags of a link as string values and is used as a query optimization. See
// PKEY_Shell_SFGAOFlagsStrings for possible values of this.
DEFINE_PROPERTYKEY(PKEY_Link_TargetSFGAOFlagsStrings, 0xD6942081, 0xD53B, 0x443D, 0xAD, 0x47, 0x5E, 0x05, 0x9D, 0x9C, 0xD2, 0x7A, 3);
// Name: System.Link.TargetUrl -- PKEY_Link_TargetUrl
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 5CBF2787-48CF-4208-B90E-EE5E5D420294, 2 (PKEYs relating to URLs. Used by IE History.)
DEFINE_PROPERTYKEY(PKEY_Link_TargetUrl, 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 2);
// Name: System.Shell.SFGAOFlagsStrings -- PKEY_Shell_SFGAOFlagsStrings
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: D6942081-D53B-443D-AD47-5E059D9CD27A, 2
//
// Expresses the SFGAO flags as string values and is used as a query optimization.
DEFINE_PROPERTYKEY(PKEY_Shell_SFGAOFlagsStrings, 0xD6942081, 0xD53B, 0x443D, 0xAD, 0x47, 0x5E, 0x05, 0x9D, 0x9C, 0xD2, 0x7A, 2);
// Possible discrete values for PKEY_Shell_SFGAOFlagsStrings are:
#define SFGAOSTR_FILESYS L"filesys" // SFGAO_FILESYSTEM
#define SFGAOSTR_FILEANC L"fileanc" // SFGAO_FILESYSANCESTOR
#define SFGAOSTR_STORAGEANC L"storageanc" // SFGAO_STORAGEANCESTOR
#define SFGAOSTR_STREAM L"stream" // SFGAO_STREAM
#define SFGAOSTR_LINK L"link" // SFGAO_LINK
#define SFGAOSTR_HIDDEN L"hidden" // SFGAO_HIDDEN
#define SFGAOSTR_FOLDER L"folder" // SFGAO_FOLDER
#define SFGAOSTR_NONENUM L"nonenum" // SFGAO_NONENUMERATED
#define SFGAOSTR_BROWSABLE L"browsable" // SFGAO_BROWSABLE
//-----------------------------------------------------------------------------
// Software properties
// Name: System.Software.DateLastUsed -- PKEY_Software_DateLastUsed
// Type: DateTime -- VT_FILETIME (For variants: VT_DATE)
// FormatID: 841E4F90-FF59-4D16-8947-E81BBFFAB36D, 16
//
//
DEFINE_PROPERTYKEY(PKEY_Software_DateLastUsed, 0x841E4F90, 0xFF59, 0x4D16, 0x89, 0x47, 0xE8, 0x1B, 0xBF, 0xFA, 0xB3, 0x6D, 16);
// Name: System.Software.ProductName -- PKEY_Software_ProductName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (PSFMTID_VERSION) 0CEF7D53-FA64-11D1-A203-0000F81FEDEE, 7
//
//
DEFINE_PROPERTYKEY(PKEY_Software_ProductName, 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 7);
//-----------------------------------------------------------------------------
// Sync properties
// Name: System.Sync.Comments -- PKEY_Sync_Comments
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 13
DEFINE_PROPERTYKEY(PKEY_Sync_Comments, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 13);
// Name: System.Sync.ConflictDescription -- PKEY_Sync_ConflictDescription
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CE50C159-2FB8-41FD-BE68-D3E042E274BC, 4
DEFINE_PROPERTYKEY(PKEY_Sync_ConflictDescription, 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 4);
// Name: System.Sync.ConflictFirstLocation -- PKEY_Sync_ConflictFirstLocation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CE50C159-2FB8-41FD-BE68-D3E042E274BC, 6
DEFINE_PROPERTYKEY(PKEY_Sync_ConflictFirstLocation, 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 6);
// Name: System.Sync.ConflictSecondLocation -- PKEY_Sync_ConflictSecondLocation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CE50C159-2FB8-41FD-BE68-D3E042E274BC, 7
DEFINE_PROPERTYKEY(PKEY_Sync_ConflictSecondLocation, 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 7);
// Name: System.Sync.HandlerCollectionID -- PKEY_Sync_HandlerCollectionID
// Type: Guid -- VT_CLSID
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 2
DEFINE_PROPERTYKEY(PKEY_Sync_HandlerCollectionID, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 2);
// Name: System.Sync.HandlerID -- PKEY_Sync_HandlerID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 3
DEFINE_PROPERTYKEY(PKEY_Sync_HandlerID, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 3);
// Name: System.Sync.HandlerName -- PKEY_Sync_HandlerName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CE50C159-2FB8-41FD-BE68-D3E042E274BC, 2
DEFINE_PROPERTYKEY(PKEY_Sync_HandlerName, 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 2);
// Name: System.Sync.HandlerType -- PKEY_Sync_HandlerType
// Type: UInt32 -- VT_UI4
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 8
//
//
DEFINE_PROPERTYKEY(PKEY_Sync_HandlerType, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 8);
// Possible discrete values for PKEY_Sync_HandlerType are:
#define SYNC_HANDLERTYPE_OTHER 0ul
#define SYNC_HANDLERTYPE_PROGRAMS 1ul
#define SYNC_HANDLERTYPE_DEVICES 2ul
#define SYNC_HANDLERTYPE_FOLDERS 3ul
#define SYNC_HANDLERTYPE_WEBSERVICES 4ul
#define SYNC_HANDLERTYPE_COMPUTERS 5ul
// Name: System.Sync.HandlerTypeLabel -- PKEY_Sync_HandlerTypeLabel
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 9
//
//
DEFINE_PROPERTYKEY(PKEY_Sync_HandlerTypeLabel, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 9);
// Name: System.Sync.ItemID -- PKEY_Sync_ItemID
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 7BD5533E-AF15-44DB-B8C8-BD6624E1D032, 6
DEFINE_PROPERTYKEY(PKEY_Sync_ItemID, 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 6);
// Name: System.Sync.ItemName -- PKEY_Sync_ItemName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: CE50C159-2FB8-41FD-BE68-D3E042E274BC, 3
DEFINE_PROPERTYKEY(PKEY_Sync_ItemName, 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 3);
//-----------------------------------------------------------------------------
// Task properties
// Name: System.Task.BillingInformation -- PKEY_Task_BillingInformation
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: D37D52C6-261C-4303-82B3-08B926AC6F12, 100
DEFINE_PROPERTYKEY(PKEY_Task_BillingInformation, 0xD37D52C6, 0x261C, 0x4303, 0x82, 0xB3, 0x08, 0xB9, 0x26, 0xAC, 0x6F, 0x12, 100);
// Name: System.Task.CompletionStatus -- PKEY_Task_CompletionStatus
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 084D8A0A-E6D5-40DE-BF1F-C8820E7C877C, 100
DEFINE_PROPERTYKEY(PKEY_Task_CompletionStatus, 0x084D8A0A, 0xE6D5, 0x40DE, 0xBF, 0x1F, 0xC8, 0x82, 0x0E, 0x7C, 0x87, 0x7C, 100);
// Name: System.Task.Owner -- PKEY_Task_Owner
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: 08C7CC5F-60F2-4494-AD75-55E3E0B5ADD0, 100
DEFINE_PROPERTYKEY(PKEY_Task_Owner, 0x08C7CC5F, 0x60F2, 0x4494, 0xAD, 0x75, 0x55, 0xE3, 0xE0, 0xB5, 0xAD, 0xD0, 100);
//-----------------------------------------------------------------------------
// Video properties
// Name: System.Video.Compression -- PKEY_Video_Compression
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 10 (PIDVSI_COMPRESSION)
//
// Indicates the level of compression for the video stream. "Compression".
DEFINE_PROPERTYKEY(PKEY_Video_Compression, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 10);
// Name: System.Video.Director -- PKEY_Video_Director
// Type: Multivalue String -- VT_VECTOR | VT_LPWSTR (For variants: VT_ARRAY | VT_BSTR)
// FormatID: (PSGUID_MEDIAFILESUMMARYINFORMATION) 64440492-4C8B-11D1-8B70-080036B11A03, 20 (PIDMSI_DIRECTOR)
//
//
DEFINE_PROPERTYKEY(PKEY_Video_Director, 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 20);
// Name: System.Video.EncodingBitrate -- PKEY_Video_EncodingBitrate
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 8 (PIDVSI_DATA_RATE)
//
// Indicates the data rate in "bits per second" for the video stream. "DataRate".
DEFINE_PROPERTYKEY(PKEY_Video_EncodingBitrate, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 8);
// Name: System.Video.FourCC -- PKEY_Video_FourCC
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 44
//
// Indicates the 4CC for the video stream.
DEFINE_PROPERTYKEY(PKEY_Video_FourCC, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 44);
// Name: System.Video.FrameHeight -- PKEY_Video_FrameHeight
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 4
//
// Indicates the frame height for the video stream.
DEFINE_PROPERTYKEY(PKEY_Video_FrameHeight, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4);
// Name: System.Video.FrameRate -- PKEY_Video_FrameRate
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 6 (PIDVSI_FRAME_RATE)
//
// Indicates the frame rate in "frames per millisecond" for the video stream. "FrameRate".
DEFINE_PROPERTYKEY(PKEY_Video_FrameRate, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6);
// Name: System.Video.FrameWidth -- PKEY_Video_FrameWidth
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 3
//
// Indicates the frame width for the video stream.
DEFINE_PROPERTYKEY(PKEY_Video_FrameWidth, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3);
// Name: System.Video.HorizontalAspectRatio -- PKEY_Video_HorizontalAspectRatio
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 42
//
// Indicates the horizontal portion of the aspect ratio. The X portion of XX:YY,
// like 16:9.
DEFINE_PROPERTYKEY(PKEY_Video_HorizontalAspectRatio, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 42);
// Name: System.Video.SampleSize -- PKEY_Video_SampleSize
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 9 (PIDVSI_SAMPLE_SIZE)
//
// Indicates the sample size in bits for the video stream. "SampleSize".
DEFINE_PROPERTYKEY(PKEY_Video_SampleSize, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9);
// Name: System.Video.StreamName -- PKEY_Video_StreamName
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 2 (PIDVSI_STREAM_NAME)
//
// Indicates the name for the video stream. "StreamName".
DEFINE_PROPERTYKEY(PKEY_Video_StreamName, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 2);
// Name: System.Video.StreamNumber -- PKEY_Video_StreamNumber
// Type: UInt16 -- VT_UI2
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 11 (PIDVSI_STREAM_NUMBER)
//
// "Stream Number".
DEFINE_PROPERTYKEY(PKEY_Video_StreamNumber, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 11);
// Name: System.Video.TotalBitrate -- PKEY_Video_TotalBitrate
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 43 (PIDVSI_TOTAL_BITRATE)
//
// Indicates the total data rate in "bits per second" for all video and audio streams.
DEFINE_PROPERTYKEY(PKEY_Video_TotalBitrate, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 43);
// Name: System.Video.VerticalAspectRatio -- PKEY_Video_VerticalAspectRatio
// Type: UInt32 -- VT_UI4
// FormatID: (FMTID_VideoSummaryInformation) 64440491-4C8B-11D1-8B70-080036B11A03, 45
//
// Indicates the vertical portion of the aspect ratio. The Y portion of
// XX:YY, like 16:9.
DEFINE_PROPERTYKEY(PKEY_Video_VerticalAspectRatio, 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 45);
//-----------------------------------------------------------------------------
// Volume properties
// Name: System.Volume.FileSystem -- PKEY_Volume_FileSystem
// Type: String -- VT_LPWSTR (For variants: VT_BSTR)
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 4 (PID_VOLUME_FILESYSTEM) (Filesystem Volume Properties)
//
// Indicates the filesystem of the volume.
DEFINE_PROPERTYKEY(PKEY_Volume_FileSystem, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 4);
// Name: System.Volume.IsMappedDrive -- PKEY_Volume_IsMappedDrive
// Type: Boolean -- VT_BOOL
// FormatID: 149C0B69-2C2D-48FC-808F-D318D78C4636, 2
DEFINE_PROPERTYKEY(PKEY_Volume_IsMappedDrive, 0x149C0B69, 0x2C2D, 0x48FC, 0x80, 0x8F, 0xD3, 0x18, 0xD7, 0x8C, 0x46, 0x36, 2);
// Name: System.Volume.IsRoot -- PKEY_Volume_IsRoot
// Type: Boolean -- VT_BOOL
// FormatID: (FMTID_Volume) 9B174B35-40FF-11D2-A27E-00C04FC30871, 10 (Filesystem Volume Properties)
//
//
DEFINE_PROPERTYKEY(PKEY_Volume_IsRoot, 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 10);
#endif /* _INC_PROPKEY */
| 114,657 |
5,823 | <reponame>onix39/engine
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package dev.flutter;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.test.runner.AndroidJUnitRunner;
import dev.flutter.scenariosui.ScreenshotUtil;
public class TestRunner extends AndroidJUnitRunner {
@Override
public void onCreate(@Nullable Bundle arguments) {
ScreenshotUtil.onCreate(this, arguments);
super.onCreate(arguments);
}
@Override
public void finish(int resultCode, @Nullable Bundle results) {
ScreenshotUtil.onDestroy();
super.finish(resultCode, results);
}
}
| 224 |
5,169 | {
"name": "SGExtension",
"version": "1.0.1",
"platforms": {
"ios": "8.0"
},
"license": "MIT",
"homepage": "https://github.com/iOSSinger",
"authors": {
"iOSSinger": "<EMAIL>"
},
"summary": "常用工具的小合集",
"source": {
"git": "https://github.com/iOSSinger/SGExtension.git",
"tag": "1.0.1"
},
"source_files": "SGExtension/SGExtension.h",
"resources": "SGExtension/source.bundle",
"frameworks": "UIKit",
"libraries": "z",
"requires_arc": true,
"subspecs": [
{
"name": "Category",
"source_files": "SGExtension/Category/{*.h,*.m}",
"libraries": "z"
},
{
"name": "Tools",
"source_files": "SGExtension/Tools/{*.h,*.m}"
}
]
}
| 351 |
619 | /*
* Authors: <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* Copyright (c) 2014 - 2016 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
#include <iostream>
#include <string>
#include <stdexcept>
#include "relay.hpp"
using namespace upm;
Relay::Relay(unsigned int pin)
{
if ( !(m_gpio = mraa_gpio_init(pin)) ) {
throw std::invalid_argument(std::string(__FUNCTION__) +
": mraa_gpio_init() failed, invalid pin?");
return;
}
mraa_gpio_dir(m_gpio, MRAA_GPIO_OUT);
}
Relay::~Relay()
{
mraa_gpio_close(m_gpio);
}
mraa_result_t Relay::on()
{
return mraa_gpio_write(m_gpio, 1);
}
mraa_result_t Relay::off()
{
return mraa_gpio_write(m_gpio, 0);
}
bool Relay::isOn()
{
return mraa_gpio_read(m_gpio) == 1;
}
bool Relay::isOff()
{
return mraa_gpio_read(m_gpio) == 0;
}
| 499 |
1,255 | ''' Language parser for Python '''
from .code_reader import CodeReader, CodeStateMachine
from .script_language import ScriptLanguageMixIn
def count_spaces(token):
return len(token.replace('\t', ' ' * 8))
class PythonIndents: # pylint: disable=R0902
def __init__(self, context):
self.indents = [0]
self.context = context
def set_nesting(self, spaces, token = ""):
while self.indents[-1] > spaces and (not token.startswith(")")):
self.indents.pop()
self.context.pop_nesting()
if self.indents[-1] < spaces:
self.indents.append(spaces)
self.context.add_bare_nesting()
def reset(self):
self.set_nesting(0)
class PythonReader(CodeReader, ScriptLanguageMixIn):
ext = ['py']
language_names = ['python']
_conditions = set(['if', 'for', 'while', 'and', 'or',
'elif', 'except', 'finally'])
def __init__(self, context):
super(PythonReader, self).__init__(context)
self.parallel_states = [PythonStates(context, self)]
@staticmethod
def generate_tokens(source_code, addition='', token_class=None):
return ScriptLanguageMixIn.generate_common_tokens(
source_code,
r"|\'\'\'.*?\'\'\'" + r'|\"\"\".*?\"\"\"', token_class)
def preprocess(self, tokens):
indents = PythonIndents(self.context)
current_leading_spaces = 0
reading_leading_space = True
for token in tokens:
if token != '\n':
if reading_leading_space:
if token.isspace():
current_leading_spaces += count_spaces(token)
else:
if not token.startswith('#'):
indents.set_nesting(current_leading_spaces, token)
reading_leading_space = False
else:
reading_leading_space = True
current_leading_spaces = 0
if not token.isspace() or token == '\n':
yield token
indents.reset()
class PythonStates(CodeStateMachine): # pylint: disable=R0903
def __init__(self, context, reader):
super(PythonStates, self).__init__(context)
self.reader = reader
def _state_global(self, token):
if token == 'def':
self._state = self._function
def _function(self, token):
if token != '(':
self.context.restart_new_function(token)
self.context.add_to_long_function_name("(")
else:
self._state = self._dec
def _dec(self, token):
if token == ')':
self._state = self._state_colon
else:
self.context.parameter(token)
return
self.context.add_to_long_function_name(" " + token)
def _state_colon(self, token):
if token == ':':
self.next(self._state_first_line)
else:
self.next(self._state_global)
def _state_first_line(self, token):
self._state = self._state_global
if token.startswith('"""') or token.startswith("'''"):
self.context.add_nloc(-token.count('\n') - 1)
self._state_global(token)
| 1,540 |
642 | <reponame>remaininlight/axiom
#include "MidiControl.h"
using namespace AxiomModel;
MidiControl::MidiControl(const QUuid &uuid, const QUuid &parentUuid, QPoint pos, QSize size, bool selected,
QString name, bool showName, const QUuid &exposerUuid, const QUuid &exposingUuid,
AxiomModel::ModelRoot *root)
: Control(ControlType::MIDI_SCALAR, ConnectionWire::WireType::MIDI, QSize(1, 1), uuid, parentUuid, pos, size,
selected, std::move(name), showName, exposerUuid, exposingUuid, root) {}
std::unique_ptr<MidiControl> MidiControl::create(const QUuid &uuid, const QUuid &parentUuid, QPoint pos, QSize size,
bool selected, QString name, bool showName, const QUuid &exposerUuid,
const QUuid &exposingUuid, AxiomModel::ModelRoot *root) {
return std::make_unique<MidiControl>(uuid, parentUuid, pos, size, selected, std::move(name), showName, exposerUuid,
exposingUuid, root);
}
QString MidiControl::debugName() {
return "MidiControl '" + name() + "'";
}
| 537 |
533 | <gh_stars>100-1000
/* Copyright (c) 2018 Anakin Authors, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "saber/funcs/impl/amd/include/saber_conv.h"
#include "saber/funcs/impl/amd/include/saber_conv_depthwise.h"
namespace anakin {
namespace saber {
template <DataType OpDtype>
SaberStatus SaberDepthWiseConv<OpDtype>::init(
const std::vector<Tensor<AMD>*>& inputs,
std::vector<Tensor<AMD>*>& outputs,
ConvParam<AMD>& param,
Context<AMD>& ctx) {
this->_ctx = &ctx;
return create(inputs, outputs, param, ctx);
}
template <DataType OpDtype>
SaberStatus SaberDepthWiseConv<OpDtype>::create(
const std::vector<Tensor<AMD> *>& inputs,
std::vector<Tensor<AMD> *>& outputs,
ConvParam<AMD>& param, Context<AMD>& ctx) {
this->_ctx = &ctx;
KernelInfo kernelInfo;
bool isBias = false;
if (param.bias()->valid_size() > 0) {
isBias = true;
}
if ((param.group == inputs[0]->channel()) && (param.group == outputs[0]->channel())) {
LOG(INFO) << "Group conv's kernel_type " << kernelInfo.kernel_type;
int isActiveRelu = 0;
if (param.activation_param.has_active) {
if (param.activation_param.active == Active_relu) {
isActiveRelu = 1;
}
}
kernelInfo.comp_options += std::string(" -DMLO_CONV_BIAS=") + std::to_string(isBias) +
std::string(" -DMLO_CONV_ACTIVE_RELU=") + std::to_string(isActiveRelu);
kernelInfo.wk_dim = 1;
kernelInfo.l_wk = {256};
kernelInfo.g_wk = {(inputs[0]->num() * inputs[0]->channel() * outputs[0]->height()
* outputs[0]->width()
+ 256 - 1)
/ 256 * 256
};
kernelInfo.kernel_file = "Depthwiseconv.cl";
kernelInfo.kernel_name = "Depthwiseconv";
kernelInfo.kernel_type = SABER;
AMDKernelPtr kptr = CreateKernel(inputs[0]->device_id(), &kernelInfo);
if (!kptr.get()->isInit()) {
LOG(ERROR) << "Failed to load program";
return SaberInvalidValue;
}
_kernels_ptr.push_back(kptr);
} else {
LOG(ERROR) << "Not implementation !!!";
}
return SaberSuccess;
}
template <DataType OpDtype>
SaberStatus SaberDepthWiseConv<OpDtype>::dispatch(
const std::vector<Tensor<AMD> *>& inputs,
std::vector<Tensor<AMD> *>& outputs,
ConvParam<AMD>& param) {
CHECK_EQ(inputs[0]->get_dtype(), AK_FLOAT);
CHECK_EQ(outputs[0]->get_dtype(), AK_FLOAT);
int err;
amd_kernel_list list;
bool isBias = param.bias()->size() > 0 ? true : false;
// To get the commpute command queue
AMD_API::stream_t cm = this->_ctx->get_compute_stream();
if (_kernels_ptr[0] == NULL || _kernels_ptr[0].get() == NULL) {
LOG(ERROR) << "Kernel is not exist";
return SaberInvalidValue;
}
for (int i = 0; i < _kernels_ptr.size(); i++) {
LOG_IF_S(INFO, ENABLE_AMD_DEBUG_LOG) << "kernel size:" << _kernels_ptr.size() << " name:" <<
_kernels_ptr[i].get()->GetName();
if (_kernels_ptr[i].get()->GetName() == "Depthwiseconv") {
if (isBias) {
err = _kernels_ptr[i].get()->SetKernelArgs(
(PtrDtype)inputs[0]->data(),
(int)inputs[0]->num(),
(int)inputs[0]->channel(),
(int)inputs[0]->height(),
(int)inputs[0]->width(),
(int)outputs[0]->height(),
(int)outputs[0]->width(),
(int)param.weight()->height(),
(int)param.weight()->width(),
(int)param.stride_h,
(int)param.stride_w,
(int)param.pad_h,
(int)param.pad_w,
(PtrDtype)outputs[0]->mutable_data(),
(PtrDtype)param.weight()->data(),
(PtrDtype)param.bias()->data());
} else {
err = _kernels_ptr[i].get()->SetKernelArgs(
(PtrDtype)inputs[0]->data(),
(int)inputs[0]->num(),
(int)inputs[0]->channel(),
(int)inputs[0]->height(),
(int)inputs[0]->width(),
(int)outputs[0]->height(),
(int)outputs[0]->width(),
(int)param.weight()->height(),
(int)param.weight()->width(),
(int)param.stride_h,
(int)param.stride_w,
(int)param.pad_h,
(int)param.pad_w,
(PtrDtype)outputs[0]->mutable_data(),
(PtrDtype)param.weight()->data());
}
if (!err) {
LOG(ERROR) << "Fail to set kernel args :" << err;
return SaberInvalidValue;
}
list.push_back(_kernels_ptr[i]);
} else {
LOG(ERROR) << "Not implementation!!";
}
}
if (list.size() > 0) {
err = LaunchKernel(cm, list);
if (!err) {
LOG(ERROR) << "Fail to set execution :" << err;
return SaberInvalidValue;
}
}
LOG_IF_S(INFO, ENABLE_AMD_DEBUG_LOG) << "COMPLETE EXECUTION";
return SaberSuccess;
}
template class SaberDepthWiseConv<AK_FLOAT>;
template class SaberDepthWiseConv<AK_HALF>;
template class SaberDepthWiseConv<AK_INT8>;
}
}
| 3,297 |
2,338 | // RUN: not %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
// RUN: not %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
// RUN: not %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
// RUN: not %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
// RUN: not %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
// RUN: not %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
// RUN: not %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
// RUN: not %clang -std=c++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Y %s
// RUN: not %clang -std=gnu++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Y %s
// RUN: not %clang -std=c++1z %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Z %s
// RUN: not %clang -std=gnu++1z %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Z %s
// RUN: not %clang -std=c++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2A %s
// RUN: not %clang -std=gnu++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2A %s
// RUN: not %clang -std=c++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2B %s
// RUN: not %clang -std=gnu++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2B %s
void f(int n) {
typeof(n)();
decltype(n)();
}
// CXX98: undeclared identifier 'typeof'
// CXX98: undeclared identifier 'decltype'
// GNUXX98-NOT: undeclared identifier 'typeof'
// GNUXX98: undeclared identifier 'decltype'
// CXX11: undeclared identifier 'typeof'
// CXX11-NOT: undeclared identifier 'decltype'
// GNUXX11-NOT: undeclared identifier 'typeof'
// GNUXX11-NOT: undeclared identifier 'decltype'
// CXX1Y: undeclared identifier 'typeof'
// CXX1Y-NOT: undeclared identifier 'decltype'
// GNUXX1Y-NOT: undeclared identifier 'typeof'
// GNUXX1Y-NOT: undeclared identifier 'decltype'
// CXX1Z: undeclared identifier 'typeof'
// CXX1Z-NOT: undeclared identifier 'decltype'
// GNUXX1Z-NOT: undeclared identifier 'typeof'
// GNUXX1Z-NOT: undeclared identifier 'decltype'
// CXX2A: undeclared identifier 'typeof'
// CXX2A-NOT: undeclared identifier 'decltype'
// GNUXX2A-NOT: undeclared identifier 'typeof'
// GNUXX2A-NOT: undeclared identifier 'decltype'
// CXX2B: undeclared identifier 'typeof'
// CXX2B-NOT: undeclared identifier 'decltype'
// GNUXX2B-NOT: undeclared identifier 'typeof'
// GNUXX2B-NOT: undeclared identifier 'decltype'
| 1,066 |
2,151 | <gh_stars>1000+
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is the list of data reduction proxy bypass actions and their values.
// These actions are specified in the Chrome-Proxy header. For the enum values,
// include the file
// "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h".
//
// Here we define the values using a macro BYPASS_ACTION_TYPE, so it can be
// expanded differently in some places (for example, to automatically
// map a bypass type value to its symbolic name). As such, new values must be
// appended and cannot be inserted in the middle as there are instances where
// we will load data between different builds.
// No action type specified.
BYPASS_ACTION_TYPE(NONE, 0)
// Attempt to retry the current request while bypassing all Data Reduction
// Proxies; it does not cause other requests to be bypassed.
BYPASS_ACTION_TYPE(BLOCK_ONCE, 1)
// Bypass all Data Reduction Proxies for a specified period of time.
BYPASS_ACTION_TYPE(BLOCK, 2)
// Bypass the current Data Reduction Proxy for a specified period of time.
BYPASS_ACTION_TYPE(BYPASS, 3)
// This must always be last.
BYPASS_ACTION_TYPE(MAX, 4)
| 350 |
5,169 | {
"name": "Juliet",
"version": "0.0.2",
"summary": "A lightweight, extendable logging framework in Swift.",
"description": "A Simple lightweight, extendable logging framework",
"homepage": "https://github.com/corey-roguebit/juliet",
"license": "MIT",
"authors": {
"<NAME>": "<EMAIL>"
},
"social_media_url": "http://twitter.com/Corey_Schaf",
"platforms": {
"ios": "8.0",
"osx": "10.10"
},
"source": {
"git": "https://github.com/corey-roguebit/juliet.git",
"tag": "0.0.2"
},
"source_files": "Juliet/*.swift",
"exclude_files": "Juliet/Exclude",
"pushed_with_swift_version": "3.0"
}
| 264 |
453 | #include "timer.h"
#include <limits.h>
#include <std/memory.h>
#include <std/common.h>
#include <kernel/drivers/pit/pit.h>
#include <kernel/drivers/rtc/clock.h>
#include <kernel/syscall/sysfuncs.h>
#include <kernel/interrupts/int_notifier.h>
static int callback_num = 0;
static timer_callback_t callback_table[MAX_CALLBACKS] = {0};
static void clear_table() {
Deprecated();
memset(&callback_table, 0, sizeof(timer_callback_t) * callback_num);
callback_num = 0;
}
static int next_open_callback_index() {
for (int i = 0; i < callback_num; i++) {
if (!callback_table[i].func) {
//this index doesn't have valid data, fit for reuse
return i;
}
}
//all indexes up to callback_num are in use, so return callback_num
return callback_num;
}
timer_callback_t* timer_callback_register(void* func, int interval, bool repeats, void* context) {
//Deprecated();
int next_open_index = next_open_callback_index();
//only add callback if we have room
if (callback_num + 1 < MAX_CALLBACKS || next_open_index < callback_num) {
callback_table[callback_num].func = func;
callback_table[callback_num].interval = interval;
callback_table[callback_num].time_left = interval;
callback_table[callback_num].repeats = repeats;
callback_table[callback_num].context = context;
callback_num++;
return &(callback_table[callback_num]);
}
panic("timer callback table out of space");
return NULL;
}
void timer_callback_remove(timer_callback_t* callback) {
Deprecated();
//find this callback in callback table
bool found = false;
for (int i = 0; i < callback_num; i++) {
if (callback_table[callback_num].func == callback->func) {
found = true;
break;
}
}
if (!found) {
panic("tried to delete nonexistant timer callback. investigate!");
}
memset(callback, 0, sizeof(timer_callback_t));
}
void _timer_handle_pit_tick(registers_t* regs) {
//look through every callback and see if we should fire
for (int i = 0; i < callback_num; i++) {
//decrement time left
callback_table[i].time_left -= 1;
//if it's time to fire, do so
if (callback_table[i].time_left <= 0) {
//reset for next firing
callback_table[i].time_left = callback_table[i].interval;
void(*callback_func)(void*) = (void(*)(void*))callback_table[i].func;
callback_func(callback_table[i].context);
//if we only fire once, trash this callback
if (!callback_table[i].repeats) {
timer_callback_remove(&(callback_table[i]));
}
}
}
}
void timer_callback_deliver_immediately(timer_callback_t* callback) {
Deprecated();
callback->time_left = 0;
}
| 920 |
1,139 | <reponame>ghiloufibelgacem/jornaldev<filename>Android/RecyclerViewGridLayoutManager/app/src/main/java/com/journaldev/recyclerviewgridlayoutmanager/DataModel.java
package com.journaldev.recyclerviewgridlayoutmanager;
/**
* Created by anupamchugh on 11/02/17.
*/
public class DataModel {
public String text;
public int drawable;
public String color;
public DataModel(String t, int d, String c )
{
text=t;
drawable=d;
color=c;
}
}
| 195 |
310 | <filename>gear/software/t/terminator.json
{
"name": "Terminator",
"description": "A terminal client.",
"url": "https://code.google.com/archive/p/jessies/wikis/Terminator.wiki"
} | 66 |
2,770 | <reponame>cninja1/streamalert
"""
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from mock import MagicMock
from nose.tools import assert_true, assert_false
from streamalert.scheduled_queries.command.processor import CommandProcessor
class TestCommandProcessor:
def __init__(self):
self._processor = None
self._logger = None
self._kinesis = None
self._state_manager = None
self._manager = None
def setup(self):
self._logger = MagicMock(name='MockLogger')
self._kinesis = MagicMock(name='MockKinesis')
self._state_manager = MagicMock(name='MockStateManager')
self._manager = MagicMock(name='MockManagerFactory')
manager_factory = MagicMock()
manager_factory.new_manager.return_value = self._manager
self._processor = CommandProcessor(
logger=self._logger,
kinesis=self._kinesis,
state_manager=self._state_manager,
manager_factory=manager_factory
)
def test_nonblocking_single_pass_not_finished(self):
"""StreamQuery - CommandProcessor - nonblocking_single_pass - Not Finished"""
self._manager.finished_query_packs = []
self._manager.num_registered_queries = 1
result = self._processor.nonblocking_single_pass()
assert_false(result)
def test_nonblocking_single_pass_finished_succeeded(self):
"""StreamQuery - CommandProcessor - nonblocking_single_pass - Finished"""
query_pack = MagicMock(name='MockQueryPack')
query_pack.query_execution_id = '1111-2222'
query_pack.query_execution.is_succeeded.return_value = True
self._manager.finished_query_packs = [
query_pack
]
self._manager.num_registered_queries = 1
self._state_manager.get.return_value = {
'sent_to_streamalert': False
}
result = self._processor.nonblocking_single_pass()
assert_true(result)
self._kinesis.send_query_results.assert_called_with(query_pack)
def test_nonblocking_single_pass_finished_failed(self):
"""StreamQuery - CommandProcessor - nonblocking_single_pass - Failed"""
query_pack = MagicMock(name='MockQueryPack')
query_pack.query_execution_id = '1111-2222'
query_pack.query_execution.is_succeeded.return_value = False
self._manager.finished_query_packs = [
query_pack
]
self._manager.num_registered_queries = 1
self._state_manager.get.return_value = {
'sent_to_streamalert': False
}
result = self._processor.nonblocking_single_pass()
assert_true(result)
self._kinesis.send_query_results.assert_not_called()
# pylint: disable=invalid-name
def test_nonblocking_single_pass_finished_succeeded_already_sent(self):
"""StreamQuery - CommandProcessor - nonblocking_single_pass - Failed"""
query_pack = MagicMock(name='MockQueryPack')
query_pack.query_execution_id = '1111-2222'
query_pack.query_execution.is_succeeded.return_value = True
self._manager.finished_query_packs = [
query_pack
]
self._manager.num_registered_queries = 1
self._state_manager.get.return_value = {
'sent_to_streamalert': True
}
result = self._processor.nonblocking_single_pass()
assert_true(result)
self._kinesis.send_query_results.assert_not_called()
| 1,585 |
1,299 | <reponame>hongdongni/RxNetty
/*
* Copyright 2015 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.reactivex.netty.protocol.http.ws.client;
import rx.Observable;
/**
* A WebSocket upgrade HTTP request that will generate a {@link WebSocketResponse}
*
* @param <O> The type of the content received in the HTTP response, in case, the upgrade was rejected by the server.
*/
public abstract class WebSocketRequest<O> extends Observable<WebSocketResponse<O>> {
protected WebSocketRequest(OnSubscribe<WebSocketResponse<O>> f) {
super(f);
}
/**
* Specify any sub protocols that are to be requested to the server as specified by the
* <a href="https://tools.ietf.org/html/rfc6455#page-12">specifications</a>
*
* @param subProtocols Sub protocols to request.
*
* @return A new instance of {@link WebSocketRequest} with the sub protocols requested.
*/
public abstract WebSocketRequest<O> requestSubProtocols(String... subProtocols);
/**
* By default, the websocket request made is for the latest version in the specifications, however, if an earlier
* version is required, it can be updated by this method.
*
* @param version WebSocket version.
*
* @return A new instance of {@link WebSocketRequest} with the version requested.
*/
public abstract WebSocketRequest<O> version(int version);
}
| 589 |
948 | {
"name": "__MSG_appName__",
"version": "1.4.2",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"author": "Jaeger <<EMAIL>>",
"homepage_url": "https://github.com/jae-jae/camtd",
"icons": {
"16": "images/default/icon-16.png",
"128": "images/default/icon-128.png"
},
"default_locale": "en",
"background": {
"scripts": [
"scripts/chromereload.js",
"scripts/background.js"
],
"persistent": true
},
"content_scripts": [ {
"js": [ "scripts/indicator.js" ],
"matches": [ "<all_urls>"]
}],
"permissions": [
"downloads",
"<all_urls>",
"notifications",
"contextMenus",
"cookies",
"tabs",
"activeTab"
],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/default/icon-19.png",
"38": "images/default/icon-38.png"
},
"default_title": "__MSG_appName__",
"default_popup": "ui/index.html"
},
"web_accessible_resources": [ "images/down-arrow.png"],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
| 483 |
1,694 | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>.
//
#import <UIKit/UITableViewCell.h>
@class UIImageView;
@interface MultiSelectTableViewCell : UITableViewCell
{
UIImageView *m_selectedImageView;
_Bool m_bAnimated;
unsigned int m_iAnimatedCount;
_Bool m_bSelected;
_Bool m_bNeedOffset;
_Bool m_bIsEditting;
_Bool m_bShowSelectedFlag;
_Bool _m_bCanSelected;
}
@property(nonatomic) _Bool m_bCanSelected; // @synthesize m_bCanSelected=_m_bCanSelected;
@property(nonatomic) _Bool m_bShowSelectedFlag; // @synthesize m_bShowSelectedFlag;
@property(nonatomic) _Bool m_bIsEditting; // @synthesize m_bIsEditting;
@property(nonatomic) _Bool m_bNeedOffset; // @synthesize m_bNeedOffset;
@property(readonly, nonatomic) _Bool m_bSelected; // @synthesize m_bSelected;
- (void).cxx_destruct;
- (id)hitTest:(struct CGPoint)arg1 withEvent:(id)arg2;
- (void)layoutSubviews;
- (void)setEditing:(_Bool)arg1 animated:(_Bool)arg2;
- (id)initWithStyle:(long long)arg1 reuseIdentifier:(id)arg2;
- (void)changeSelectdStatus:(_Bool)arg1;
- (void)adjustSelectFlagFrameInternal;
@end
| 500 |
1,838 | <reponame>RussellM2020/maml_gps
import numpy as np
from rllab.core.serializable import Serializable
from rllab.envs.base import Step
from rllab.envs.mujoco.mujoco_env import MujocoEnv
from rllab.misc import autoargs
from rllab.misc.overrides import overrides
class InvertedDoublePendulumEnv(MujocoEnv, Serializable):
FILE = 'inverted_double_pendulum.xml.mako'
@autoargs.arg("random_start", type=bool,
help="Randomized starting position by adjusting the angles"
"When this is false, the double pendulum started out"
"in balanced position")
def __init__(
self,
*args, **kwargs):
self.random_start = kwargs.get("random_start", True)
super(InvertedDoublePendulumEnv, self).__init__(*args, **kwargs)
Serializable.quick_init(self, locals())
@overrides
def get_current_obs(self):
return np.concatenate([
self.model.data.qpos[:1], # cart x pos
np.sin(self.model.data.qpos[1:]), # link angles
np.cos(self.model.data.qpos[1:]),
np.clip(self.model.data.qvel, -10, 10),
np.clip(self.model.data.qfrc_constraint, -10, 10)
]).reshape(-1)
@overrides
def step(self, action):
self.forward_dynamics(action)
next_obs = self.get_current_obs()
x, _, y = self.model.data.site_xpos[0]
dist_penalty = 0.01 * x ** 2 + (y - 2) ** 2
v1, v2 = self.model.data.qvel[1:3]
vel_penalty = 1e-3 * v1 ** 2 + 5e-3 * v2 ** 2
alive_bonus = 10
r = float(alive_bonus - dist_penalty - vel_penalty)
done = y <= 1
return Step(next_obs, r, done)
@overrides
def reset_mujoco(self, init_state=None):
assert init_state is None
qpos = np.copy(self.init_qpos)
if self.random_start:
qpos[1] = (np.random.rand() - 0.5) * 40 / 180. * np.pi
self.model.data.qpos = qpos
self.model.data.qvel = self.init_qvel
self.model.data.qacc = self.init_qacc
self.model.data.ctrl = self.init_ctrl
| 1,019 |
1,178 | /* Copyright (c) 2008-2011 Freescale 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:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Freescale Semiconductor nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
*
* ALTERNATIVELY, this software may be distributed under the terms of the
* GNU General Public License ("GPL") as published by the Free Software
* Foundation, either version 2 of that License or (at your option) any
* later version.
*
* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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.
*/
/**************************************************************************//**
@File fm_ioctls.h
@Description FM Char device ioctls
*//***************************************************************************/
#ifndef __FM_IOCTLS_H
#define __FM_IOCTLS_H
/**************************************************************************//**
@Group lnx_ioctl_FM_grp Frame Manager Linux IOCTL API
@Description FM Linux ioctls definitions and enums
@{
*//***************************************************************************/
/**************************************************************************//**
@Collection FM IOCTL device ('/dev') definitions
*//***************************************************************************/
#define DEV_FM_NAME "fm" /**< Name of the FM chardev */
#define DEV_FM_MINOR_BASE 0
#define DEV_FM_PCD_MINOR_BASE (DEV_FM_MINOR_BASE + 1) /*/dev/fmx-pcd */
#define DEV_FM_OH_PORTS_MINOR_BASE (DEV_FM_PCD_MINOR_BASE + 1) /*/dev/fmx-port-ohy */
#define DEV_FM_RX_PORTS_MINOR_BASE (DEV_FM_OH_PORTS_MINOR_BASE + FM_MAX_NUM_OF_OH_PORTS) /*/dev/fmx-port-rxy */
#define DEV_FM_TX_PORTS_MINOR_BASE (DEV_FM_RX_PORTS_MINOR_BASE + FM_MAX_NUM_OF_RX_PORTS) /*/dev/fmx-port-txy */
#define DEV_FM_MAX_MINORS (DEV_FM_TX_PORTS_MINOR_BASE + FM_MAX_NUM_OF_TX_PORTS)
#define FM_IOC_NUM(n) n
#define FM_PCD_IOC_NUM(n) (n+20)
#define FM_PORT_IOC_NUM(n) (n+50)
/* @} */
#define IOC_FM_MAX_NUM_OF_PORTS 64
/**************************************************************************//**
@Collection FM Frame error
*//***************************************************************************/
typedef uint32_t ioc_fm_port_frame_err_select_t; /**< typedef for defining Frame Descriptor errors */
#define IOC_FM_PORT_FRM_ERR_UNSUPPORTED_FORMAT 0x04000000 /**< Offline parsing only! Unsupported Format */
#define IOC_FM_PORT_FRM_ERR_LENGTH 0x02000000 /**< Offline parsing only! Length Error */
#define IOC_FM_PORT_FRM_ERR_DMA 0x01000000 /**< DMA Data error */
#ifdef FM_CAPWAP_SUPPORT
#define IOC_FM_PORT_FRM_ERR_NON_FM 0x00400000 /**< non FMan error; probably come from SEC chained to FM */
#endif /* FM_CAPWAP_SUPPORT */
#define IOC_FM_PORT_FRM_ERR_PHYSICAL 0x00080000 /**< Rx FIFO overflow, FCS error, code error, running disparity
error (SGMII and TBI modes), FIFO parity error. PHY
Sequence error, PHY error control character detected. */
#define IOC_FM_PORT_FRM_ERR_SIZE 0x00040000 /**< Frame too long OR Frame size exceeds max_length_frame */
#define IOC_FM_PORT_FRM_ERR_CLS_DISCARD 0x00020000 /**< classification discard */
#define IOC_FM_PORT_FRM_ERR_EXTRACTION 0x00008000 /**< Extract Out of Frame */
#define IOC_FM_PORT_FRM_ERR_NO_SCHEME 0x00004000 /**< No Scheme Selected */
#define IOC_FM_PORT_FRM_ERR_KEYSIZE_OVERFLOW 0x00002000 /**< No Scheme Selected */
#define IOC_FM_PORT_FRM_ERR_COLOR_YELLOW 0x00000400 /**< */
#define IOC_FM_PORT_FRM_ERR_COLOR_RED 0x00000800 /**< */
#define IOC_FM_PORT_FRM_ERR_ILL_PLCR 0x00000200 /**< Illegal Policer Profile selected */
#define IOC_FM_PORT_FRM_ERR_PLCR_FRAME_LEN 0x00000100 /**< Illegal Policer Profile selected */
#define IOC_FM_PORT_FRM_ERR_PRS_TIMEOUT 0x00000080 /**< Parser Time out Exceed */
#define IOC_FM_PORT_FRM_ERR_PRS_ILL_INSTRUCT 0x00000040 /**< Invalid Soft Parser instruction */
#define IOC_FM_PORT_FRM_ERR_PRS_HDR_ERR 0x00000020 /**< Header error was identified during parsing */
#define IOC_FM_PORT_FRM_ERR_BLOCK_LIMIT_EXCEEDED 0x00000008 /**< Frame parsed beyind 256 first bytes */
#define IOC_FM_PORT_FRM_ERR_PROCESS_TIMEOUT 0x00000001 /**< FPT Frame Processing Timeout Exceeded */
/* @} */
/**************************************************************************//**
@Description enum for defining port types
(must match enum e_FmPortType defined in fm_ext.h)
*//***************************************************************************/
typedef enum ioc_fm_port_type {
e_IOC_FM_PORT_TYPE_OFFLINE_PARSING, /**< Offline parsing port (id's: 0-6, share id's with
host command, so must have exclusive id) */
e_IOC_FM_PORT_TYPE_HOST_COMMAND, /**< Host command port (id's: 0-6, share id's with
offline parsing ports, so must have exclusive id) */
e_IOC_FM_PORT_TYPE_RX, /**< 1G Rx port (id's: 0-3) */
e_IOC_FM_PORT_TYPE_RX_10G, /**< 10G Rx port (id's: 0) */
e_IOC_FM_PORT_TYPE_TX, /**< 1G Tx port (id's: 0-3) */
e_IOC_FM_PORT_TYPE_TX_10G, /**< 10G Tx port (id's: 0) */
e_IOC_FM_PORT_TYPE_DUMMY
} ioc_fm_port_type;
/**************************************************************************//**
@Group lnx_ioctl_FM_lib_grp FM library
@Description FM API functions, definitions and enums
The FM module is the main driver module and is a mandatory module
for FM driver users. Before any further module initialization,
this module must be initialized.
The FM is a "single-tone" module. It is responsible of the common
HW modules: FPM, DMA, common QMI, common BMI initializations and
run-time control routines. This module must be initialized always
when working with any of the FM modules.
NOTE - We assumes that the FML will be initialize only by core No. 0!
@{
*//***************************************************************************/
/**************************************************************************//**
@Description FM Exceptions
*//***************************************************************************/
typedef enum ioc_fm_exceptions {
e_IOC_FM_EX_DMA_BUS_ERROR, /**< DMA bus error. */
e_IOC_FM_EX_DMA_READ_ECC, /**< Read Buffer ECC error */
e_IOC_FM_EX_DMA_SYSTEM_WRITE_ECC, /**< Write Buffer ECC error on system side */
e_IOC_FM_EX_DMA_FM_WRITE_ECC, /**< Write Buffer ECC error on FM side */
e_IOC_FM_EX_FPM_STALL_ON_TASKS , /**< Stall of tasks on FPM */
e_IOC_FM_EX_FPM_SINGLE_ECC, /**< Single ECC on FPM. */
e_IOC_FM_EX_FPM_DOUBLE_ECC, /**< Double ECC error on FPM ram access */
e_IOC_FM_EX_QMI_SINGLE_ECC, /**< Single ECC on QMI. */
e_IOC_FM_EX_QMI_DOUBLE_ECC, /**< Double bit ECC occured on QMI */
e_IOC_FM_EX_QMI_DEQ_FROM_UNKNOWN_PORTID,/**< Dequeu from unknown port id */
e_IOC_FM_EX_BMI_LIST_RAM_ECC, /**< Linked List RAM ECC error */
e_IOC_FM_EX_BMI_PIPELINE_ECC, /**< Pipeline Table ECC Error */
e_IOC_FM_EX_BMI_STATISTICS_RAM_ECC, /**< Statistics Count RAM ECC Error Enable */
e_IOC_FM_EX_BMI_DISPATCH_RAM_ECC, /**< Dispatch RAM ECC Error Enable */
e_IOC_FM_EX_IRAM_ECC, /**< Double bit ECC occured on IRAM*/
e_IOC_FM_EX_MURAM_ECC /**< Double bit ECC occured on MURAM*/
} ioc_fm_exceptions;
/**************************************************************************//**
@Group lnx_ioctl_FM_runtime_control_grp FM Runtime Control Unit
@Description FM Runtime control unit API functions, definitions and enums.
The FM driver provides a set of control routines for each module.
These routines may only be called after the module was fully
initialized (both configuration and initialization routines were
called). They are typically used to get information from hardware
(status, counters/statistics, revision etc.), to modify a current
state or to force/enable a required action. Run-time control may
be called whenever necessary and as many times as needed.
@{
*//***************************************************************************/
/**************************************************************************//**
@Collection General FM defines.
*//***************************************************************************/
#define IOC_FM_MAX_NUM_OF_VALID_PORTS (FM_MAX_NUM_OF_OH_PORTS + \
FM_MAX_NUM_OF_1G_RX_PORTS + \
FM_MAX_NUM_OF_10G_RX_PORTS + \
FM_MAX_NUM_OF_1G_TX_PORTS + \
FM_MAX_NUM_OF_10G_TX_PORTS)
/* @} */
/**************************************************************************//**
@Description Structure for Port bandwidth requirement. Port is identified
by type and relative id.
(must be identical to t_FmPortBandwidth defined in fm_ext.h)
*//***************************************************************************/
typedef struct ioc_fm_port_bandwidth_t {
ioc_fm_port_type type; /**< FM port type */
uint8_t relativePortId; /**< Type relative port id */
uint8_t bandwidth; /**< bandwidth - (in term of percents) */
} ioc_fm_port_bandwidth_t;
/**************************************************************************//**
@Description A Structure containing an array of Port bandwidth requirements.
The user should state the ports requiring bandwidth in terms of
percentage - i.e. all port's bandwidths in the array must add
up to 100.
(must be identical to t_FmPortsBandwidthParams defined in fm_ext.h)
*//***************************************************************************/
typedef struct ioc_fm_port_bandwidth_params {
uint8_t numOfPorts;
/**< num of ports listed in the array below */
/*TODO:Andy64 BUG*/
ioc_fm_port_bandwidth_t portsBandwidths[IOC_FM_MAX_NUM_OF_VALID_PORTS];
/**< for each port, it's bandwidth (all port's
bandwidths must add up to 100.*/
} ioc_fm_port_bandwidth_params;
/**************************************************************************//**
@Description enum for defining FM counters
*//***************************************************************************/
typedef enum ioc_fm_counters {
e_IOC_FM_COUNTERS_ENQ_TOTAL_FRAME, /**< QMI total enqueued frames counter */
e_IOC_FM_COUNTERS_DEQ_TOTAL_FRAME, /**< QMI total dequeued frames counter */
e_IOC_FM_COUNTERS_DEQ_0, /**< QMI 0 frames from QMan counter */
e_IOC_FM_COUNTERS_DEQ_1, /**< QMI 1 frames from QMan counter */
e_IOC_FM_COUNTERS_DEQ_2, /**< QMI 2 frames from QMan counter */
e_IOC_FM_COUNTERS_DEQ_3, /**< QMI 3 frames from QMan counter */
e_IOC_FM_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI dequeue from default queue counter */
e_IOC_FM_COUNTERS_DEQ_FROM_CONTEXT, /**< QMI dequeue from FQ context counter */
e_IOC_FM_COUNTERS_DEQ_FROM_FD, /**< QMI dequeue from FD command field counter */
e_IOC_FM_COUNTERS_DEQ_CONFIRM, /**< QMI dequeue confirm counter */
e_IOC_FM_COUNTERS_SEMAPHOR_ENTRY_FULL_REJECT, /**< DMA semaphor reject due to full entry counter */
e_IOC_FM_COUNTERS_SEMAPHOR_QUEUE_FULL_REJECT, /**< DMA semaphor reject due to full CAM queue counter */
e_IOC_FM_COUNTERS_SEMAPHOR_SYNC_REJECT /**< DMA semaphor reject due to sync counter */
} ioc_fm_counters;
typedef struct ioc_fm_obj_t {
void *obj;
} ioc_fm_obj_t;
/**************************************************************************//**
@Description structure for returning revision information
*//***************************************************************************/
typedef struct ioc_fm_revision_info_t {
uint8_t major; /**< Major revision */
uint8_t minor; /**< Minor revision */
} ioc_fm_revision_info_t;
/**************************************************************************//**
@Description structure for FM counters
*//***************************************************************************/
typedef struct ioc_fm_counters_params_t {
ioc_fm_counters cnt; /**< The requested counter */
uint32_t val; /**< The requested value to get/set from/into the counter */
} ioc_fm_counters_params_t;
/**************************************************************************//**
@Function FM_IOC_SET_PORTS_BANDWIDTH
@Description Sets relative weights between ports when accessing common resources.
@Param[in] ioc_fm_port_bandwidth_params Port bandwidth percentages,
their sum must equal 100.
@Return E_OK on success; Error code otherwise.
@Cautions Allowed only following FM_Init().
*//***************************************************************************/
#define FM_IOC_SET_PORTS_BANDWIDTH _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(2), ioc_fm_port_bandwidth_params)
/**************************************************************************//**
@Function FM_IOC_GET_REVISION
@Description Returns the FM revision
@Param[out] ioc_fm_revision_info_t A structure of revision information parameters.
@Return None.
@Cautions Allowed only following FM_Init().
*//***************************************************************************/
#define FM_IOC_GET_REVISION _IOR(FM_IOC_TYPE_BASE, FM_IOC_NUM(3), ioc_fm_revision_info_t)
/**************************************************************************//**
@Function FM_IOC_GET_COUNTER
@Description Reads one of the FM counters.
@Param[in,out] ioc_fm_counters_params_t The requested counter parameters.
@Return Counter's current value.
@Cautions Allowed only following FM_Init().
Note that it is user's responsibilty to call this routine only
for enabled counters, and there will be no indication if a
disabled counter is accessed.
*//***************************************************************************/
#define FM_IOC_GET_COUNTER _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(4), ioc_fm_counters_params_t)
/**************************************************************************//**
@Function FM_IOC_SET_COUNTER
@Description Sets a value to an enabled counter. Use "0" to reset the counter.
@Param[in] ioc_fm_counters_params_t The requested counter parameters.
@Return E_OK on success; Error code otherwise.
@Cautions Allowed only following FM_Init().
*//***************************************************************************/
#define FM_IOC_SET_COUNTER _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(5), ioc_fm_counters_params_t)
/**************************************************************************//**
@Function FM_IOC_FORCE_INTR
@Description Causes an interrupt event on the requested source.
@Param[in] ioc_fm_exceptions An exception to be forced.
@Return E_OK on success; Error code if the exception is not enabled,
or is not able to create interrupt.
@Cautions Allowed only following FM_Init().
*//***************************************************************************/
#define FM_IOC_FORCE_INTR _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(6), ioc_fm_exceptions)
/** @} */ /* end of lnx_ioctl_FM_runtime_control_grp group */
/** @} */ /* end of lnx_ioctl_FM_lib_grp group */
/** @} */ /* end of lnx_ioctl_FM_grp */
#endif /* __FM_IOCTLS_H */
| 7,226 |
6,969 | <reponame>MLinesCode/The-Complete-FAANG-Preparation<gh_stars>1000+
class Solution:
def generateParenthesis(self, n):
ans = ['()']
for _ in range(2, n + 1):
new = set()
for s in ans:
for i in range(len(s)):
a = s[:i] + '()' + s[i:]
new.add(a)
ans = list(new)
return ans
| 225 |
2,151 | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGATE_H_
#define CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGATE_H_
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
#include "base/observer_list_threadsafe.h"
#include "chrome/browser/ui/passwords/password_manager_presenter.h"
#include "chrome/browser/ui/passwords/password_ui_view.h"
#include "chrome/common/extensions/api/passwords_private.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/password_manager/core/browser/ui/export_progress_status.h"
#include "extensions/browser/extension_function.h"
namespace content {
class WebContents;
}
namespace extensions {
// Delegate used by the chrome.passwordsPrivate API to facilitate removing saved
// passwords and password exceptions and to notify listeners when these values
// have changed.
class PasswordsPrivateDelegate : public KeyedService {
public:
~PasswordsPrivateDelegate() override {}
// Sends the saved passwords list to the event router.
virtual void SendSavedPasswordsList() = 0;
// Gets the saved passwords list.
using UiEntries = std::vector<api::passwords_private::PasswordUiEntry>;
using UiEntriesCallback = base::Callback<void(const UiEntries&)>;
virtual void GetSavedPasswordsList(const UiEntriesCallback& callback) = 0;
// Sends the password exceptions list to the event router.
virtual void SendPasswordExceptionsList() = 0;
// Gets the password exceptions list.
using ExceptionEntries = std::vector<api::passwords_private::ExceptionEntry>;
using ExceptionEntriesCallback =
base::Callback<void(const ExceptionEntries&)>;
virtual void GetPasswordExceptionsList(
const ExceptionEntriesCallback& callback) = 0;
// Removes the saved password entry corresponding to the |index| generated for
// each entry of the password list.
// |index| the index created when going over the list of saved passwords.
virtual void RemoveSavedPassword(size_t index) = 0;
// Removes the saved password exception entry corresponding set in the
// given |index|
// |index| The index for the exception url entry being removed.
virtual void RemovePasswordException(size_t index) = 0;
// Undoes the last removal of a saved password or exception.
virtual void UndoRemoveSavedPasswordOrException() = 0;
// Requests the plain text password for entry corresponding to the |index|
// generated for each entry of the password list.
// |index| the index created when going over the list of saved passwords.
// |web_contents| The web content object used as the UI; will be used to show
// an OS-level authentication dialog if necessary.
virtual void RequestShowPassword(size_t index,
content::WebContents* web_contents) = 0;
// Trigger the password import procedure, allowing the user to select a file
// containing passwords to import.
virtual void ImportPasswords(content::WebContents* web_contents) = 0;
// Trigger the password export procedure, allowing the user to save a file
// containing their passwords. |callback| will be called with an error
// message if the request is rejected, because another export is in progress.
virtual void ExportPasswords(
base::OnceCallback<void(const std::string&)> callback,
content::WebContents* web_contents) = 0;
// Cancel any ongoing export.
virtual void CancelExportPasswords() = 0;
// Get the most recent progress status.
virtual api::passwords_private::ExportProgressStatus
GetExportProgressStatus() = 0;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGATE_H_
| 1,154 |
852 | <reponame>ckamtsikis/cmssw
#ifndef _DQM_SiTrackerPhase2_Phase2TrackerValidationUtil_h
#define _DQM_SiTrackerPhase2_Phase2TrackerValidationUtil_h
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include <string>
#include <sstream>
namespace phase2tkutil {
std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo);
std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo);
typedef dqm::reco::MonitorElement MonitorElement;
typedef dqm::reco::DQMStore DQMStore;
MonitorElement* book1DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker);
MonitorElement* book2DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker);
MonitorElement* bookProfile1DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker);
} // namespace phase2tkutil
#endif
| 369 |
339 | <reponame>isuruuy429/product-ei
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.ei.dataservice.integration.test.services;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.test.utils.axis2client.AxisServiceClient;
import org.wso2.carbon.automation.test.utils.concurrency.test.ConcurrencyTest;
import org.wso2.carbon.automation.test.utils.concurrency.test.exception.ConcurrencyTestFailedError;
import org.wso2.ei.dataservice.integration.test.DSSIntegrationTest;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathExpressionException;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* This class performs tests, which related to Return Generated Keys.
*/
public class ReturnGeneratedKeysTestCase extends DSSIntegrationTest {
private final OMFactory factory = OMAbstractFactory.getOMFactory();
private final OMNamespace omNs =
factory.createOMNamespace("http://ws.wso2.org/dataservice/samples/returnGeneratedKeysSample", "ns1");
private final String serviceName = "H2ReturnGeneratedKeysTest";
@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {
super.init();
List<File> sqlFileLis = new ArrayList<>();
sqlFileLis.add(selectSqlFile("CreateTables.sql"));
deployService(serviceName, createArtifact(getResourceLocation() + File.separator + "dbs" + File.separator +
"rdbms" + File.separator + "h2" + File.separator +
"H2ReturnGeneratedKeysTest.dbs", sqlFileLis));
}
@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
deleteService(serviceName);
cleanup();
}
@Test(groups = "wso2.dss", description = "Invoking insert operation with Return Generated Keys" , dependsOnMethods = "performConcurrencyTest")
public void performInsertWithReturnGeneratedKeysTest() throws AxisFault, XPathExpressionException {
OMElement payload = factory.createOMElement("insertBalance", omNs);
OMElement queryElement = factory.createOMElement("balance", omNs);
queryElement.setText("22.184");
payload.addChild(queryElement);
OMElement result = new AxisServiceClient().sendReceive(payload, getServiceUrlHttp(serviceName), "insertBalance");
/* id should be 26 because concurrency test has been performed before this method */
boolean id = "26".equals(result.getFirstElement().getFirstChildWithName(
new QName("http://ws.wso2.org/dataservice/samples/returnGeneratedKeysSample", "ID")).getText());
Assert.assertTrue(id, "Insert operation with return generated keys is failed");
}
@Test(groups = "wso2.dss", description = "Concurrency Test for Return Generated Keys")
public void performConcurrencyTest() throws ConcurrencyTestFailedError, InterruptedException,
XPathExpressionException {
ConcurrencyTest concurrencyTest = new ConcurrencyTest(5, 5);
OMElement payload = factory.createOMElement("insertBalance", omNs);
OMElement queryElement = factory.createOMElement("balance", omNs);
queryElement.setText("144.184");
payload.addChild(queryElement);
concurrencyTest.run(getServiceUrlHttp(serviceName), payload, "insertBalance");
}
}
| 1,363 |
543 | /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.lang;
import java.util.*;
/**
* This interface imposes a total ordering on the objects of each class that
* implements it. This ordering is referred to as the class's <i>natural
* ordering</i>, and the class's {@code compareTo} method is referred to as
* its <i>natural comparison method</i>.<p>
*
* Lists (and arrays) of objects that implement this interface can be sorted
* automatically by {@link Collections#sort(List) Collections.sort} (and
* {@link Arrays#sort(Object[]) Arrays.sort}). Objects that implement this
* interface can be used as keys in a {@linkplain SortedMap sorted map} or as
* elements in a {@linkplain SortedSet sorted set}, without the need to
* specify a {@linkplain Comparator comparator}.<p>
*
* The natural ordering for a class {@code C} is said to be <i>consistent
* with equals</i> if and only if {@code e1.compareTo(e2) == 0} has
* the same boolean value as {@code e1.equals(e2)} for every
* {@code e1} and {@code e2} of class {@code C}. Note that {@code null}
* is not an instance of any class, and {@code e.compareTo(null)} should
* throw a {@code NullPointerException} even though {@code e.equals(null)}
* returns {@code false}.<p>
*
* It is strongly recommended (though not required) that natural orderings be
* consistent with equals. This is so because sorted sets (and sorted maps)
* without explicit comparators behave "strangely" when they are used with
* elements (or keys) whose natural ordering is inconsistent with equals. In
* particular, such a sorted set (or sorted map) violates the general contract
* for set (or map), which is defined in terms of the {@code equals}
* method.<p>
*
* For example, if one adds two keys {@code a} and {@code b} such that
* {@code (!a.equals(b) && a.compareTo(b) == 0)} to a sorted
* set that does not use an explicit comparator, the second {@code add}
* operation returns false (and the size of the sorted set does not increase)
* because {@code a} and {@code b} are equivalent from the sorted set's
* perspective.<p>
*
* Virtually all Java core classes that implement {@code Comparable}
* have natural orderings that are consistent with equals. One
* exception is {@link java.math.BigDecimal}, whose {@linkplain
* java.math.BigDecimal#compareTo natural ordering} equates {@code
* BigDecimal} objects with equal numerical values and different
* representations (such as 4.0 and 4.00). For {@link
* java.math.BigDecimal#equals BigDecimal.equals()} to return true,
* the representation and numerical value of the two {@code
* BigDecimal} objects must be the same.<p>
*
* For the mathematically inclined, the <i>relation</i> that defines
* the natural ordering on a given class C is:<pre>{@code
* {(x, y) such that x.compareTo(y) <= 0}.
* }</pre> The <i>quotient</i> for this total order is: <pre>{@code
* {(x, y) such that x.compareTo(y) == 0}.
* }</pre>
*
* It follows immediately from the contract for {@code compareTo} that the
* quotient is an <i>equivalence relation</i> on {@code C}, and that the
* natural ordering is a <i>total order</i> on {@code C}. When we say that a
* class's natural ordering is <i>consistent with equals</i>, we mean that the
* quotient for the natural ordering is the equivalence relation defined by
* the class's {@link Object#equals(Object) equals(Object)} method:<pre>
* {(x, y) such that x.equals(y)}. </pre><p>
*
* In other words, when a class's natural ordering is consistent with
* equals, the equivalence classes defined by the equivalence relation
* of the {@code equals} method and the equivalence classes defined by
* the quotient of the {@code compareTo} method are the same.
*
* <p>This interface is a member of the
* <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
* Java Collections Framework</a>.
*
* @param <T> the type of objects that this object may be compared to
*
* @author <NAME>
* @see java.util.Comparator
* @since 1.2
*/
public interface Comparable<T> {
/**
* Compares this object with the specified object for order. Returns a
* negative integer, zero, or a positive integer as this object is less
* than, equal to, or greater than the specified object.
*
* <p>The implementor must ensure {@link Integer#signum
* signum}{@code (x.compareTo(y)) == -signum(y.compareTo(x))} for
* all {@code x} and {@code y}. (This implies that {@code
* x.compareTo(y)} must throw an exception if and only if {@code
* y.compareTo(x)} throws an exception.)
*
* <p>The implementor must also ensure that the relation is transitive:
* {@code (x.compareTo(y) > 0 && y.compareTo(z) > 0)} implies
* {@code x.compareTo(z) > 0}.
*
* <p>Finally, the implementor must ensure that {@code
* x.compareTo(y)==0} implies that {@code signum(x.compareTo(z))
* == signum(y.compareTo(z))}, for all {@code z}.
*
* @apiNote
* It is strongly recommended, but <i>not</i> strictly required that
* {@code (x.compareTo(y)==0) == (x.equals(y))}. Generally speaking, any
* class that implements the {@code Comparable} interface and violates
* this condition should clearly indicate this fact. The recommended
* language is "Note: this class has a natural ordering that is
* inconsistent with equals."
*
* @param o the object to be compared.
* @return a negative integer, zero, or a positive integer as this object
* is less than, equal to, or greater than the specified object.
*
* @throws NullPointerException if the specified object is null
* @throws ClassCastException if the specified object's type prevents it
* from being compared to this object.
*/
public int compareTo(T o);
}
| 2,174 |
15,577 | #pragma once
#include <Core/Block.h>
#include <Formats/FormatSettings.h>
#include <Processors/Formats/IRowOutputFormat.h>
namespace DB
{
class WriteBuffer;
/** A stream for outputting data in tsv format.
*/
class TabSeparatedRowOutputFormat : public IRowOutputFormat
{
public:
/** with_names - output in the first line a header with column names
* with_types - output the next line header with the names of the types
*/
TabSeparatedRowOutputFormat(
WriteBuffer & out_,
const Block & header_,
bool with_names_,
bool with_types_,
const RowOutputFormatParams & params_,
const FormatSettings & format_settings_);
String getName() const override { return "TabSeparatedRowOutputFormat"; }
void writeField(const IColumn & column, const ISerialization & serialization, size_t row_num) override;
void writeFieldDelimiter() override;
void writeRowEndDelimiter() override;
void writeBeforeTotals() override;
void writeBeforeExtremes() override;
void doWritePrefix() override;
/// https://www.iana.org/assignments/media-types/text/tab-separated-values
String getContentType() const override { return "text/tab-separated-values; charset=UTF-8"; }
protected:
bool with_names;
bool with_types;
const FormatSettings format_settings;
};
}
| 463 |
530 | <reponame>Yzubi/bladecoder-adventure-engine
package com.bladecoder.engine.ui.retro;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable;
import com.bladecoder.engine.model.ActorRenderer;
public class RendererDrawable extends BaseDrawable {
private ActorRenderer renderer;
public void setRenderer(ActorRenderer r) {
renderer = r;
if (r != null) {
setMinWidth(renderer.getWidth());
setMinHeight(renderer.getHeight());
}
}
@Override
public void draw(Batch batch, float x, float y, float width, float height) {
if (renderer == null)
return;
float scale;
if (renderer.getWidth() > renderer.getHeight())
scale = width / renderer.getWidth();
else
scale = height / renderer.getHeight();
renderer.draw((SpriteBatch) batch, x + renderer.getWidth() * scale / 2, y, scale, scale, 0f, null);
}
}
| 357 |
362 | <filename>Gfycat/src/main/java/net/danlew/gfycat/rx/MediaPlayerErrorOnSubscribe.java
package net.danlew.gfycat.rx;
import android.media.MediaPlayer;
import rx.Observable;
import rx.Subscriber;
import rx.android.MainThreadSubscription;
import static rx.android.MainThreadSubscription.verifyMainThread;
public class MediaPlayerErrorOnSubscribe implements Observable.OnSubscribe<MediaPlayerErrorEvent> {
private final MediaPlayer mMediaPlayer;
public MediaPlayerErrorOnSubscribe(MediaPlayer mediaPlayer) {
mMediaPlayer = mediaPlayer;
}
@Override
public void call(Subscriber<? super MediaPlayerErrorEvent> subscriber) {
verifyMainThread();
mMediaPlayer.setOnErrorListener((mp, what, extra) -> {
if (!subscriber.isUnsubscribed()) {
subscriber.onNext(new MediaPlayerErrorEvent(mp, what, extra));
return true;
}
return false;
});
subscriber.add(new MainThreadSubscription() {
@Override
protected void onUnsubscribe() {
mMediaPlayer.setOnErrorListener(null);
}
});
}
}
| 463 |
3,200 | <gh_stars>1000+
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ut/src/runtime/kernel/opencl/common.h"
#include "mindspore/lite/src/runtime/kernel/opencl/kernel/power.h"
// PrimitiveType_PowFusion: src/ops/populate/power_populate.cc
using mindspore::lite::Tensor;
using mindspore::schema::Format::Format_NHWC;
namespace mindspore::lite::opencl::test {
class TestPowerOpenCLCI : public CommonTest {
public:
TestPowerOpenCLCI() {}
};
// PrimitiveType_Concat: src/ops/populate/concat_populate.cc
OpParameter *CreateParameter(bool broadcast_, float shift_, float scale_, float power_ = 2) {
auto *param = test::CreateParameter<PowerParameter>(schema::PrimitiveType_PowFusion);
param->power_ = power_;
param->broadcast_ = broadcast_;
param->shift_ = shift_;
param->scale_ = scale_;
return reinterpret_cast<OpParameter *>(param);
}
TEST_F(TestPowerOpenCLCI, Int32CI) {
std::vector<int> input0_shape = {1, 2, 8};
std::vector<int> input1_shape = {1, 2, 8};
std::vector<int> output_shape = {1, 2, 8};
bool broadcast_ = false;
float shift_ = 0;
float scale_ = 1;
float input0_data[] = {2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0};
float input1_data[] = {2, 2, 2, 1, 2, 2, 3, 3, 2, 2, 3, 0, 2, 2, 1, 2};
float output_data[] = {4.0, 9.0, 16.0, 5.0, 36.0, 49.0, 512, 729,
100.0, 121.0, 1728.0, 1.0, 196.0, 225.0, 16.0, 289.0};
for (auto fp16_enable : {false, true}) {
auto *param = CreateParameter(broadcast_, shift_, scale_);
TestMain({{input0_shape, input0_data, VAR}, {input1_shape, input1_data, VAR}}, {output_shape, output_data}, param,
fp16_enable, fp16_enable ? 1e-3 : 1e-9);
}
}
TEST_F(TestPowerOpenCLCI, Fp32CI) {
std::vector<int> input0_shape = {2, 8};
std::vector<int> input1_shape = {2, 8};
std::vector<int> output_shape = {2, 8};
bool broadcast_ = false;
float shift_ = 0;
float scale_ = 1;
float input0_data[] = {0.78957046, -0.99770847, 1.05838929, 1.60738329, -1.66226552, -2.03170525,
-0.48257631, -0.94244638, 1.47462044, -0.80247114, 0.12354778, -0.36436107,
-2.41973013, -0.40221205, -0.26739485, 0.23298305};
float input1_data[] = {3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2};
float output_data[] = {0.49223521, 0.99542219, 1.12018788, 1.60738329, 2.76312667, 4.1278262, 0.23287989, 0.88820518,
3.20657016, 0.64395994, 0.01526405, 0.13275899, 5.85509388, 0.16177453, 0.07150001, 0.0542811};
for (auto fp16_enable : {false, true}) {
auto *param = CreateParameter(broadcast_, shift_, scale_);
TestMain({{input0_shape, input0_data, VAR}, {input1_shape, input1_data, VAR}}, {output_shape, output_data}, param,
fp16_enable, fp16_enable ? 1e-2 : 1e-6);
}
}
TEST_F(TestPowerOpenCLCI, Fp32UnAlign) {
std::vector<int> input0_shape = {2, 7};
std::vector<int> input1_shape = {2, 7};
std::vector<int> output_shape = {2, 7};
bool broadcast_ = false;
float shift_ = 0;
float scale_ = 1;
float input0_data[] = {0.78957046, -0.99770847, 1.05838929, 1.60738329, -1.66226552, -2.03170525, -0.48257631,
1.47462044, -0.80247114, 0.12354778, -0.36436107, -2.41973013, -0.40221205, -0.26739485};
float input1_data[] = {3, 2, 2, 1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2};
float output_data[] = {0.49223521, 0.99542219, 1.12018788, 1.60738329, 2.76312667, 4.1278262, 0.23287989,
3.20657016, 0.64395994, 0.01526405, 0.13275899, 5.85509388, 0.16177453, 0.07150001};
for (auto fp16_enable : {false, true}) {
auto *param = CreateParameter(broadcast_, shift_, scale_);
TestMain({{input0_shape, input0_data, VAR}, {input1_shape, input1_data, VAR}}, {output_shape, output_data}, param,
fp16_enable, fp16_enable ? 1e-2 : 1e-6);
}
}
TEST_F(TestPowerOpenCLCI, broadcast) {
std::vector<int> input0_shape = {1, 2, 8};
std::vector<int> output_shape = {1, 2, 8};
bool broadcast_ = true;
float shift_ = 0;
float scale_ = 1;
float input0_data[] = {2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0};
float output_data[] = {4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64, 81, 100.0, 121.0, 144, 169, 196.0, 225.0, 256, 289.0};
for (auto fp16_enable : {false}) {
auto *param = CreateParameter(broadcast_, shift_, scale_);
TestMain({{input0_shape, input0_data, VAR}}, {output_shape, output_data}, param, fp16_enable,
fp16_enable ? 1e-3 : 1e-6);
}
}
TEST_F(TestPowerOpenCLCI, Fp16CI) {
std::vector<int> input0_shape = {2, 8};
std::vector<int> input1_shape = {2, 8};
std::vector<int> output_shape = {2, 8};
bool broadcast_ = false;
float shift_ = 0;
float scale_ = 1;
float input0_data[] = {0.1531, -0.8003, -0.1848, 0.3833, -1.469, 0.5586, -0.3223, -0.8887,
0.697, -1.007, -0.45, -1.736, -0.462, -0.699, -0.596, 0.7466};
float input1_data[] = {2.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 1.0, 2.0, 2.0, 1.0, 1.0};
float output_data[] = {0.02344, -0.8003, -0.1848, 0.147, 2.156, 0.312, 0.1039, 0.7896,
0.4856, 1.014, 0.2025, -1.736, 0.2134, 0.489, -0.596, 0.7466};
for (auto fp16_enable : {true}) {
auto *param = CreateParameter(broadcast_, shift_, scale_);
TestMain({{input0_shape, input0_data, VAR}, {input1_shape, input1_data, VAR}}, {output_shape, output_data}, param,
fp16_enable, fp16_enable ? 1e-3 : 1e-6);
}
}
} // namespace mindspore::lite::opencl::test
| 2,848 |
2,151 | <reponame>zipated/src
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/video_decoder.h"
#include "media/base/video_frame.h"
namespace media {
VideoDecoder::VideoDecoder() = default;
void VideoDecoder::Destroy() {
delete this;
}
VideoDecoder::~VideoDecoder() = default;
bool VideoDecoder::NeedsBitstreamConversion() const {
return false;
}
bool VideoDecoder::CanReadWithoutStalling() const {
return true;
}
int VideoDecoder::GetMaxDecodeRequests() const {
return 1;
}
} // namespace media
namespace std {
void default_delete<media::VideoDecoder>::operator()(
media::VideoDecoder* ptr) const {
ptr->Destroy();
}
} // namespace std
| 262 |
2,151 | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "streaming/cast/rtcp_common.h"
#include "absl/types/span.h"
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
namespace openscreen {
namespace cast_streaming {
namespace {
// Tests that the RTCP Common Header for a packet type that includes an Item
// Count is successfully serialized and re-parsed.
TEST(RtcpCommonTest, SerializesAndParsesHeaderForSenderReports) {
RtcpCommonHeader original;
original.packet_type = RtcpPacketType::kSenderReport;
original.with.report_count = 31;
original.payload_size = 16;
uint8_t buffer[kRtcpCommonHeaderSize];
original.Serialize(buffer);
const auto parsed = RtcpCommonHeader::Parse(buffer);
ASSERT_TRUE(parsed.has_value());
EXPECT_EQ(original.packet_type, parsed->packet_type);
EXPECT_EQ(original.with.report_count, parsed->with.report_count);
EXPECT_EQ(original.payload_size, parsed->payload_size);
}
// Tests that the RTCP Common Header for a packet type that includes a RTCP
// Subtype is successfully serialized and re-parsed.
TEST(RtcpCommonTest, SerializesAndParsesHeaderForCastFeedback) {
RtcpCommonHeader original;
original.packet_type = RtcpPacketType::kPayloadSpecific;
original.with.subtype = RtcpSubtype::kFeedback;
original.payload_size = 99 * sizeof(uint32_t);
uint8_t buffer[kRtcpCommonHeaderSize];
original.Serialize(buffer);
const auto parsed = RtcpCommonHeader::Parse(buffer);
ASSERT_TRUE(parsed.has_value());
EXPECT_EQ(original.packet_type, parsed->packet_type);
EXPECT_EQ(original.with.subtype, parsed->with.subtype);
EXPECT_EQ(original.payload_size, parsed->payload_size);
}
// Tests that a RTCP Common Header will not be parsed from an empty buffer.
TEST(RtcpCommonTest, WillNotParseHeaderFromEmptyBuffer) {
const uint8_t kEmptyPacket[] = {};
EXPECT_FALSE(
RtcpCommonHeader::Parse(absl::Span<const uint8_t>(kEmptyPacket, 0))
.has_value());
}
// Tests that a RTCP Common Header will not be parsed from a buffer containing
// garbage data.
TEST(RtcpCommonTest, WillNotParseHeaderFromGarbage) {
// clang-format off
const uint8_t kGarbage[] = {
0x4f, 0x27, 0xeb, 0x22, 0x27, 0xeb, 0x22, 0x4f,
0xeb, 0x22, 0x4f, 0x27, 0x22, 0x4f, 0x27, 0xeb,
};
// clang-format on
EXPECT_FALSE(RtcpCommonHeader::Parse(kGarbage).has_value());
}
// Tests whether RTCP Common Header validation logic is correct.
TEST(RtcpCommonTest, WillNotParseHeaderWithInvalidData) {
// clang-format off
const uint8_t kCastFeedbackPacket[] = {
0b10000001, // Version=2, Padding=no, ItemCount=1 byte.
206, // RTCP Packet type byte.
0x00, 0x04, // Length of remainder of packet, in 32-bit words.
9, 8, 7, 6, // SSRC of receiver.
1, 2, 3, 4, // SSRC of sender.
'C', 'A', 'S', 'T',
0x0a, // Checkpoint Frame ID (lower 8 bits).
0x00, // Number of "Loss Fields"
0x00, 0x28, // Current Playout Delay in milliseconds.
};
// clang-format on
// Start with a valid packet, and expect the parse to succeed.
uint8_t buffer[sizeof(kCastFeedbackPacket)];
memcpy(buffer, kCastFeedbackPacket, sizeof(buffer));
EXPECT_TRUE(RtcpCommonHeader::Parse(buffer).has_value());
// Wrong version in first byte: Expect parse failure.
buffer[0] = 0b01000001;
EXPECT_FALSE(RtcpCommonHeader::Parse(buffer).has_value());
buffer[0] = kCastFeedbackPacket[0];
// Wrong packet type (not in RTCP range): Expect parse failure.
buffer[1] = 42;
EXPECT_FALSE(RtcpCommonHeader::Parse(buffer).has_value());
buffer[1] = kCastFeedbackPacket[1];
}
// Test that the Report Block optionally included in Sender Reports or Receiver
// Reports can be serialized and re-parsed correctly.
TEST(RtcpCommonTest, SerializesAndParsesRtcpReportBlocks) {
constexpr Ssrc kSsrc{0x04050607};
RtcpReportBlock original;
original.ssrc = kSsrc;
original.packet_fraction_lost_numerator = 0x67;
original.cumulative_packets_lost = 74536;
original.extended_high_sequence_number = 0x0201fedc;
original.jitter = RtpTimeDelta::FromTicks(123);
original.last_status_report_id = 0x0908;
original.delay_since_last_report = RtcpReportBlock::Delay(99999);
uint8_t buffer[kRtcpReportBlockSize];
original.Serialize(buffer);
// If the number of report blocks is zero, or some other SSRC is specified,
// ParseOne() should not return a result.
EXPECT_FALSE(RtcpReportBlock::ParseOne(buffer, 0, 0).has_value());
EXPECT_FALSE(RtcpReportBlock::ParseOne(buffer, 0, kSsrc).has_value());
EXPECT_FALSE(RtcpReportBlock::ParseOne(buffer, 1, 0).has_value());
// Expect that the report block is parsed correctly.
const auto parsed = RtcpReportBlock::ParseOne(buffer, 1, kSsrc);
ASSERT_TRUE(parsed.has_value());
EXPECT_EQ(original.ssrc, parsed->ssrc);
EXPECT_EQ(original.packet_fraction_lost_numerator,
parsed->packet_fraction_lost_numerator);
EXPECT_EQ(original.cumulative_packets_lost, parsed->cumulative_packets_lost);
EXPECT_EQ(original.extended_high_sequence_number,
parsed->extended_high_sequence_number);
EXPECT_EQ(original.jitter, parsed->jitter);
EXPECT_EQ(original.last_status_report_id, parsed->last_status_report_id);
EXPECT_EQ(original.delay_since_last_report, parsed->delay_since_last_report);
}
// Tests that the Report Block parser can, among multiple Report Blocks, find
// the one with a matching recipient SSRC.
TEST(RtcpCommonTest, ParsesOneReportBlockFromMultipleBlocks) {
constexpr Ssrc kSsrc{0x04050607};
constexpr int kNumBlocks = 5;
RtcpReportBlock expected;
expected.ssrc = kSsrc;
expected.packet_fraction_lost_numerator = 0x67;
expected.cumulative_packets_lost = 74536;
expected.extended_high_sequence_number = 0x0201fedc;
expected.jitter = RtpTimeDelta::FromTicks(123);
expected.last_status_report_id = 0x0908;
expected.delay_since_last_report = RtcpReportBlock::Delay(99999);
// Generate multiple report blocks with different recipient SSRCs.
uint8_t buffer[kRtcpReportBlockSize * kNumBlocks];
for (int i = 0; i < kNumBlocks; ++i) {
RtcpReportBlock another;
another.ssrc = expected.ssrc + i - 2;
another.packet_fraction_lost_numerator =
expected.packet_fraction_lost_numerator + i - 2;
another.cumulative_packets_lost = expected.cumulative_packets_lost + i - 2;
another.extended_high_sequence_number =
expected.extended_high_sequence_number + i - 2;
another.jitter = expected.jitter + RtpTimeDelta::FromTicks(i - 2);
another.last_status_report_id = expected.last_status_report_id + i - 2;
another.delay_since_last_report =
expected.delay_since_last_report + RtcpReportBlock::Delay(i - 2);
another.Serialize(absl::Span<uint8_t>(buffer + i * kRtcpReportBlockSize,
kRtcpReportBlockSize));
}
// Expect that the desired report block is found and parsed correctly.
const auto parsed = RtcpReportBlock::ParseOne(buffer, kNumBlocks, kSsrc);
ASSERT_TRUE(parsed.has_value());
EXPECT_EQ(expected.ssrc, parsed->ssrc);
EXPECT_EQ(expected.packet_fraction_lost_numerator,
parsed->packet_fraction_lost_numerator);
EXPECT_EQ(expected.cumulative_packets_lost, parsed->cumulative_packets_lost);
EXPECT_EQ(expected.extended_high_sequence_number,
parsed->extended_high_sequence_number);
EXPECT_EQ(expected.jitter, parsed->jitter);
EXPECT_EQ(expected.last_status_report_id, parsed->last_status_report_id);
EXPECT_EQ(expected.delay_since_last_report, parsed->delay_since_last_report);
}
} // namespace
} // namespace cast_streaming
} // namespace openscreen
| 2,855 |
28,056 | package com.alibaba.json.bvt.issue_3100;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.json.bvtVO.一个中文名字的包.User;
import junit.framework.TestCase;
public class Issue3132 extends TestCase {
public void test_for_issue() throws Exception {
User user = new User();
user.setId(9);
user.setName("asdffsf");
System.out.println(JSONObject.toJSONString(user));
}
}
| 174 |
1,511 | /*
*
* Copyright (C) 1996-2010, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: dcmimgle
*
* Author: <NAME>
*
* Purpose: DicomMonoOutputPixel (Source)
*
* Last Update: $Author: joergr $
* Update Date: $Date: 2010-10-14 13:14:18 $
* CVS/RCS Revision: $Revision: 1.9 $
* Status: $State: Exp $
*
* CVS/RCS Log at end of file
*
*/
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmimgle/dimoopx.h"
#include "dcmtk/dcmimgle/dimopx.h"
/*----------------*
* constructors *
*----------------*/
DiMonoOutputPixel::DiMonoOutputPixel(const DiMonoPixel *pixel,
const unsigned long size,
const unsigned long frame,
const unsigned long max)
: Count(0),
FrameSize(size),
UsedValues(NULL),
MaxValue(max)
{
if (pixel != NULL)
{
if (pixel->getCount() > frame * size)
Count = pixel->getCount() - frame * size; // number of pixels remaining for this 'frame'
}
if (Count > FrameSize)
Count = FrameSize; // cut off at frame 'size'
}
/*--------------*
* destructor *
*--------------*/
DiMonoOutputPixel::~DiMonoOutputPixel()
{
delete[] UsedValues;
}
/**********************************/
int DiMonoOutputPixel::isUnused(const unsigned long value)
{
if (UsedValues == NULL)
determineUsedValues(); // create on demand
if (UsedValues != NULL)
{
if (value <= MaxValue)
return OFstatic_cast(int, UsedValues[value] == 0);
return 2; // out of range
}
return 0;
}
/*
*
* CVS/RCS Log:
* $Log: dimoopx.cc,v $
* Revision 1.9 2010-10-14 13:14:18 joergr
* Updated copyright header. Added reference to COPYRIGHT file.
*
* Revision 1.8 2005/12/08 15:43:01 meichel
* Changed include path schema for all DCMTK header files
*
* Revision 1.7 2003/12/08 14:55:04 joergr
* Adapted type casts to new-style typecast operators defined in ofcast.h.
*
* Revision 1.6 2001/06/01 15:49:58 meichel
* Updated copyright header
*
* Revision 1.5 2000/03/08 16:24:31 meichel
* Updated copyright header.
*
* Revision 1.4 1999/07/23 13:45:39 joergr
* Enhanced handling of corrupted pixel data (wrong length).
*
* Revision 1.3 1999/02/11 16:53:35 joergr
* Added routine to check whether particular grayscale values are unused in
* the output data.
* Removed unused parameter / member variable.
*
* Revision 1.2 1999/01/20 14:54:30 joergr
* Replaced invocation of getCount() by member variable Count where possible.
*
* Revision 1.1 1998/11/27 16:15:02 joergr
* Added copyright message.
*
* Revision 1.3 1998/05/11 14:52:33 joergr
* Added CVS/RCS header to each file.
*
*
*/
| 1,270 |
2,053 | /*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package scouter.client.batch.actions;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.zip.ZipInputStream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import scouter.client.net.INetReader;
import scouter.client.net.TcpProxy;
import scouter.client.stack.base.MainProcessor;
import scouter.client.util.ConsoleProxy;
import scouter.client.util.ExUtil;
import scouter.client.util.StackUtil;
import scouter.client.views.ObjectThreadDumpView;
import scouter.io.DataInputX;
import scouter.lang.pack.BatchPack;
import scouter.lang.pack.MapPack;
import scouter.net.RequestCmd;
import scouter.util.ZipFileUtil;
public class OpenBatchStackJob extends Job {
private BatchPack pack;
private int serverId;
private boolean isSFA;
public OpenBatchStackJob(BatchPack pack, int serverId, boolean isSFA) {
super("Load Batch History Stack");
this.pack = pack;
this.serverId = serverId;
this.isSFA = isSFA;
}
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Load Batch Stack....", IProgressMonitor.UNKNOWN);
final String stackfile = getStackData(serverId, pack);
if(stackfile == null){
return Status.CANCEL_STATUS;
}
if(isSFA){
ExUtil.exec(Display.getDefault(), new Runnable() {
public void run() {
try {
MainProcessor.instance().processStackFile(stackfile);
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}else{
final String indexFilename = stackfile.subSequence(0, stackfile.length() - 4) + ".inx";
final List<Long> [] lists = getStackIndexList(indexFilename);
if(lists == null || lists[0].size() == 0){
return Status.OK_STATUS;
}
ExUtil.exec(Display.getDefault(), new Runnable() {
public void run() {
try {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ObjectThreadDumpView view = (ObjectThreadDumpView) window.getActivePage().showView(ObjectThreadDumpView.ID, null, IWorkbenchPage.VIEW_ACTIVATE);
if (view != null) {
view.setInput(pack.objName, indexFilename, lists);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
return Status.OK_STATUS;
}
private String getStackData(int serverId, BatchPack input) {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
String dirPath = StackUtil.getStackWorkspaceDir(input.objName);
String filename = getStackFilename();
String logFilename = dirPath + filename + ".log";
if(!(new File(logFilename).exists())){
String zipFilename = filename + ".zip";
File zipFile = new File(dirPath, zipFilename);
try {
MapPack param = new MapPack();
param.put("objHash", input.objHash);
param.put("time", input.startTime);
param.put("filename", zipFilename);
ZipInputStream zis = null;
final BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(zipFile));
try {
tcp.process(RequestCmd.BATCH_HISTORY_STACK, param, new INetReader() {
public void process(DataInputX in) throws IOException {
byte [] data = in.readBlob();
if(data != null && data.length >= 0){
out.write(data);
}
}
});
out.flush();
zis = new ZipInputStream(new FileInputStream(zipFile));
ZipFileUtil.recieveZipFile(zis, dirPath);
}finally{
if(out != null){
try {out.close(); } catch(Exception ex){}
}
if(zis != null){
try {zis.close(); } catch(Exception ex){}
}
}
zipFile.delete();
} catch (Throwable th) {
ConsoleProxy.errorSafe(th.toString());
return null;
} finally {
TcpProxy.putTcpProxy(tcp);
}
}
return logFilename;
}
private String getStackFilename(){
StringBuilder buffer = new StringBuilder(100);
Date date = new Date(pack.startTime);
buffer.append(pack.batchJobId).append('_').append(new SimpleDateFormat("yyyyMMdd").format(date)).append('_').append(new SimpleDateFormat("HHmmss.SSS").format(date)).append('_').append(pack.pID);
return buffer.toString();
}
private List<Long> [] getStackIndexList(String filename){
File stackfile = new File(filename);
if(!stackfile.exists()){
return null;
}
List<Long> [] lists = new ArrayList[2];
lists[0] = new ArrayList<Long>();
lists[1] = new ArrayList<Long>();
BufferedReader rd = null;
try{
rd = new BufferedReader(new FileReader(stackfile));
String line;
String [] values;
long time;
long position;
while((line = rd.readLine()) != null){
line = line.trim();
values = line.split(" ");
if(values.length != 2){
continue;
}
time = Long.parseLong(values[0]);
position = Long.parseLong(values[1]);
lists[0].add(time);
lists[1].add(position);
}
}catch(Exception ex){
ex.printStackTrace();
}finally{
if(rd != null){
try {rd.close();}catch(Exception ex){}
}
}
return lists;
}
}
| 2,329 |
577 | package org.fluentlenium.core.dom;
import org.fluentlenium.adapter.FluentAdapter;
import org.fluentlenium.core.components.ComponentInstantiator;
import org.fluentlenium.core.components.DefaultComponentInstantiator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class DomTest {
@Mock
private WebElement element;
@Mock
private WebDriver driver;
private ComponentInstantiator instantiator;
private FluentAdapter fluentAdapter;
@Before
public void before() {
fluentAdapter = new FluentAdapter();
fluentAdapter.initFluent(driver);
instantiator = new DefaultComponentInstantiator(fluentAdapter);
}
@Test
public void testAncestors() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("ancestor::*"))).thenReturn(elements);
assertThat(dom.ancestors().toElements()).isEqualTo(elements);
}
@Test
public void testDescendants() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("descendant::*"))).thenReturn(elements);
assertThat(dom.descendants().toElements()).isEqualTo(elements);
}
@Test
public void testFollowings() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("following::*"))).thenReturn(elements);
assertThat(dom.followings().toElements()).isEqualTo(elements);
}
@Test
public void testFollowingSiblings() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("following-sibling::*"))).thenReturn(elements);
assertThat(dom.followingSiblings().toElements()).isEqualTo(elements);
}
@Test
public void testPrecedingElementsInList() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("preceding::*"))).thenReturn(elements);
assertThat(dom.precedings().toElements()).isEqualTo(elements);
}
@Test
public void testPrecedingSiblings() {
Dom dom = new Dom(element, instantiator);
List<WebElement> elements = Arrays.asList(mock(WebElement.class), mock(WebElement.class), mock(WebElement.class));
when(element.findElements(By.xpath("preceding-sibling::*"))).thenReturn(elements);
assertThat(dom.precedingSiblings().toElements()).isEqualTo(elements);
}
@Test
public void testParent() {
Dom dom = new Dom(element, instantiator);
WebElement parent = mock(WebElement.class);
when(element.findElement(By.xpath("parent::*"))).thenReturn(parent);
assertThat(dom.parent().getElement()).isEqualTo(parent);
}
}
| 1,406 |
660 | <reponame>ashakhno/media-driver<filename>media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_avp_hwcmd_g12_X.cpp
/*
* Copyright (c) 2017-2020, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
//!
//! \file mhw_avp_hwcmd_g12.cpp
//! \brief Auto-generated definitions for MHW commands and states.
//!
// DO NOT EDIT
#include "mhw_vdbox_avp_hwcmd_g12_X.h"
#include <string.h>
mhw_vdbox_avp_g12_X::MEMORYADDRESSATTRIBUTES_CMD::MEMORYADDRESSATTRIBUTES_CMD()
{
DW0.Value = 0x00000000;
//DW0.CompressionType = COMPRESSION_TYPE_MEDIACOMPRESSIONENABLE;
//DW0.BaseAddressRowStoreScratchBufferCacheSelect = BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED0;
//DW0.BaseAddressTiledResourceMode = BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODENONE;
}
mhw_vdbox_avp_g12_X::SPLITBASEADDRESS4KBYTEALIGNED_CMD::SPLITBASEADDRESS4KBYTEALIGNED_CMD()
{
DW0_1.Value[0] = DW0_1.Value[1] = 0x00000000;
}
mhw_vdbox_avp_g12_X::SPLITBASEADDRESS64BYTEALIGNED_CMD::SPLITBASEADDRESS64BYTEALIGNED_CMD()
{
DW0_1.Value[0] = DW0_1.Value[1] = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_BSD_OBJECT_CMD::AVP_BSD_OBJECT_CMD()
{
DW0.Value = 0x71a00001;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPBSDOBJECTSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_PIC_STATE_CMD::AVP_PIC_STATE_CMD()
{
DW0.Value = 0x71b00031;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPPICSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
//DW2.SequenceChromaSubsamplingFormat = 0;
DW3.Value = 0x00000000;
//DW3.ErrorResilientModeFlag = ERROR_RESILIENT_MODE_FLAG_DISABLE;
DW4.Value = 0x00000000;
//DW4.SegmentationEnableFlag = SEGMENTATION_ENABLE_FLAG_ALLBLOCKSAREIMPLIEDTOBELONGTOSEGMENT0;
//DW4.SegmentationTemporalUpdateFlag = SEGMENTATION_TEMPORAL_UPDATE_FLAG_DECODESEGIDFROMBITSTREAM;
//DW4.FrameCodedLosslessMode = FRAME_CODED_LOSSLESS_MODE_NORMALMODE;
DW5.Value = 0x00000000;
DW6.Value = 0x00000000;
//DW6.McompFilterType = MCOMP_FILTER_TYPE_EIGHT_TAP;
DW7.Value = 0x00000000;
DW8.Value = 0x00000000;
memset(&WarpParametersArrayReference1To7Projectioncoeff0To5, 0, sizeof(WarpParametersArrayReference1To7Projectioncoeff0To5));
DW30.Value = 0x00000000;
DW31.Value = 0x00000000;
DW32.Value = 0x00000000;
DW33.Value = 0x00000000;
DW34.Value = 0x00000000;
DW35.Value = 0x00000000;
DW36.Value = 0x00000000;
DW37.Value = 0x00000000;
DW38.Value = 0x00000000;
DW39.Value = 0x00000000;
DW40.Value = 0x00000000;
DW41.Value = 0x00000000;
DW42.Value = 0x00000000;
DW43.Value = 0x00000000;
DW44.Value = 0x00000000;
DW45.Value = 0x00000000;
DW46.Value = 0x00000000;
DW47.Value = 0x00000000;
DW48.Value = 0x00000000;
DW49.Value = 0x00000000;
DW50.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_PIPE_MODE_SELECT_CMD::AVP_PIPE_MODE_SELECT_CMD()
{
DW0.Value = 0x71800004;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPPIPEMODESELECT;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
//DW1.CodecSelect = CODEC_SELECT_DECODE;
//DW1.CdefOutputStreamoutEnableFlag = CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE;
//DW1.LoopRestorationOutputStreamoutEnableFlag = LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE;
//DW1.PicStatusErrorReportEnable = PIC_STATUSERROR_REPORT_ENABLE_DISABLE;
//DW1.CodecStandardSelect = CODEC_STANDARD_SELECT_HEVC;
//DW1.MultiEngineMode = MULTI_ENGINE_MODE_SINGLEENGINEMODEORMSACFEONLYDECODEMODE;
//DW1.PipeWorkingMode = PIPE_WORKING_MODE_LEGACYDECODERENCODERMODE_SINGLEPIPE;
DW2.Value = 0x00000000;
//DW2.MediaSoftResetCounterPer1000Clocks = MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS_DISABLE;
DW3.Value = 0x00000000;
//DW3.PicStatusErrorReportId = PIC_STATUSERROR_REPORT_ID_32_BITUNSIGNED;
DW4.Value = 0x00000000;
DW5.Value = 0x00000000;
//DW5.PhaseIndicator = PHASE_INDICATOR_FIRSTPHASE;
}
mhw_vdbox_avp_g12_X::AVP_IND_OBJ_BASE_ADDR_STATE_CMD::AVP_IND_OBJ_BASE_ADDR_STATE_CMD()
{
DW0.Value = 0x71830004;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPINDOBJBASEADDRSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
}
mhw_vdbox_avp_g12_X::AVP_TILE_CODING_CMD::AVP_TILE_CODING_CMD()
{
DW0.Value = 0x71950004;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPTILECODING;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
DW3.Value = 0x00000000;
DW4.Value = 0x00000000;
//DW4.FilmGrainSampleTemplateWriteReadControl = FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_READ;
DW5.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_TILE_CODING_CMD_LST::AVP_TILE_CODING_CMD_LST()
{
DW0.Value = 0x71950005;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPTILECODING;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
DW3.Value = 0x00000000;
DW4.Value = 0x00000000;
//DW4.FilmGrainSampleTemplateWriteReadControl = FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_READ;
DW5.Value = 0x00000000;
DW6.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_SURFACE_STATE_CMD::AVP_SURFACE_STATE_CMD()
{
DW0.Value = 0x71810003;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_SURFACESTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
//DW1.SurfaceId = SURFACE_ID_RECONSTRUCTEDPICTURE;
DW2.Value = 0x00000000;
//DW2.SurfaceFormat = 0;
DW3.Value = 0x00000000;
DW4.Value = 0x00000000;
//DW4.MemoryCompressionEnableForAv1IntraFrame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1LastFrame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1Last2Frame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1Last3Frame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1GoldenFrame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1BwdrefFrame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1Altref2Frame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.MemoryCompressionEnableForAv1AltrefFrame = MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONDISABLE;
//DW4.CompressionTypeForIntraFrame = COMPRESSION_TYPE_FOR_INTRA_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForLastFrame = COMPRESSION_TYPE_FOR_LAST_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForLast2Frame = COMPRESSION_TYPE_FOR_LAST2_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForLast3Frame = COMPRESSION_TYPE_FOR_LAST3_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForGoldenFrame = COMPRESSION_TYPE_FOR_GOLDEN_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForBwdrefFrame = COMPRESSION_TYPE_FOR_BWDREF_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForAltref2Frame = COMPRESSION_TYPE_FOR_ALTREF2_FRAME_MEDIACOMPRESSIONENABLED;
//DW4.CompressionTypeForAltrefFrame = COMPRESSION_TYPE_FOR_ALTREF_FRAME_MEDIACOMPRESSIONENABLED;
}
mhw_vdbox_avp_g12_X::AVP_SEGMENT_STATE_CMD::AVP_SEGMENT_STATE_CMD()
{
DW0.Value = 0x71b20002;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPSEGMENTSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
DW3.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_PIPE_BUF_ADDR_STATE_CMD::AVP_PIPE_BUF_ADDR_STATE_CMD()
{
DW0.Value = 0x718200ba;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPPIPEBUFADDRSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
memset(&Reserved672, 0, sizeof(Reserved672));
memset(&Reserved1888, 0, sizeof(Reserved1888));
memset(&Reserved3904, 0, sizeof(Reserved3904));
memset(&Reserved4192, 0, sizeof(Reserved4192));
memset(&Reserved5344, 0, sizeof(Reserved5344));
memset(&Reserved5824, 0, sizeof(Reserved5824));
memset(&Reserved5920, 0, sizeof(Reserved5920));
}
mhw_vdbox_avp_g12_X::AVP_INLOOP_FILTER_STATE_CMD::AVP_INLOOP_FILTER_STATE_CMD()
{
DW0.Value = 0x71b3000d;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPINLOOPFILTERSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
DW3.Value = 0x00000000;
DW4.Value = 0x00000000;
DW5.Value = 0x00000000;
DW6.Value = 0x00000000;
DW7.Value = 0x00000000;
DW8.Value = 0x00000000;
DW9.Value = 0x00000000;
DW10.Value = 0x00000000;
DW11.Value = 0x00000000;
DW12.Value = 0x00000000;
DW13.Value = 0x00000000;
DW14.Value = 0x00000000;
}
mhw_vdbox_avp_g12_X::AVP_INTER_PRED_STATE_CMD::AVP_INTER_PRED_STATE_CMD()
{
DW0.Value = 0x7192000d;
//DW0.DwordLength = GetOpLength(dwSize);
//DW0.MediaInstructionCommand = MEDIA_INSTRUCTION_COMMAND_AVPINTERPREDSTATE;
//DW0.MediaInstructionOpcode = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
//DW0.PipelineType = PIPELINE_TYPE_UNNAMED2;
//DW0.CommandType = COMMAND_TYPE_PARALLELVIDEOPIPE;
DW1.Value = 0x00000000;
DW2.Value = 0x00000000;
DW3.Value = 0x00000000;
DW4.Value = 0x00000000;
DW5.Value = 0x00000000;
DW6.Value = 0x00000000;
DW7.Value = 0x00000000;
DW8.Value = 0x00000000;
DW9.Value = 0x00000000;
DW10.Value = 0x00000000;
DW11.Value = 0x00000000;
DW12.Value = 0x00000000;
DW13.Value = 0x00000000;
DW14.Value = 0x00000000;
}
| 11,441 |
575 | <filename>ui/events/win/keyboard_hook_win_base.h
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_EVENTS_WIN_KEYBOARD_HOOK_WIN_BASE_H_
#define UI_EVENTS_WIN_KEYBOARD_HOOK_WIN_BASE_H_
#include <memory>
#include <windows.h>
#include "base/check.h"
#include "base/containers/flat_set.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/threading/thread_checker.h"
#include "ui/events/event.h"
#include "ui/events/events_export.h"
#include "ui/events/keyboard_hook_base.h"
#include "ui/events/keycodes/dom/dom_code.h"
namespace ui {
// Exposes a method to drive the Windows KeyboardHook implementation by feeding
// it key event data. This method is used by both the low-level keyboard hook
// and by unit tests which simulate the hooked behavior w/o actually installing
// a hook (doing so would cause problems with test parallelization).
class EVENTS_EXPORT KeyboardHookWinBase : public KeyboardHookBase {
public:
KeyboardHookWinBase(base::Optional<base::flat_set<DomCode>> dom_codes,
KeyEventCallback callback,
bool enable_hook_registration);
~KeyboardHookWinBase() override;
// Create a KeyboardHookWinBase instance which does not register a
// low-level hook and captures modifier keys.
static std::unique_ptr<KeyboardHookWinBase>
CreateModifierKeyboardHookForTesting(
base::Optional<base::flat_set<DomCode>> dom_codes,
KeyEventCallback callback);
// Create a KeyboardHookWinBase instance which does not register a
// low-level hook and captures media keys.
static std::unique_ptr<KeyboardHookWinBase> CreateMediaKeyboardHookForTesting(
KeyEventCallback callback);
// Called when a key event message is delivered via the low-level hook.
// Exposed here to allow for testing w/o engaging the low-level hook.
// Returns true if the message was handled.
virtual bool ProcessKeyEventMessage(WPARAM w_param,
DWORD vk,
DWORD scan_code,
DWORD time_stamp) = 0;
protected:
bool Register(HOOKPROC hook_proc);
bool enable_hook_registration() const { return enable_hook_registration_; }
static LRESULT CALLBACK ProcessKeyEvent(KeyboardHookWinBase* instance,
int code,
WPARAM w_param,
LPARAM l_param);
private:
const bool enable_hook_registration_ = true;
HHOOK hook_ = nullptr;
THREAD_CHECKER(thread_checker_);
DISALLOW_COPY_AND_ASSIGN(KeyboardHookWinBase);
};
} // namespace ui
#endif // UI_EVENTS_WIN_KEYBOARD_HOOK_WIN_BASE_H_
| 1,099 |
984 | /*
* Copyright DataStax, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.datastax.dse.driver.internal.core.cql.reactive;
import static org.assertj.core.api.Fail.fail;
import com.datastax.oss.driver.shaded.guava.common.util.concurrent.Uninterruptibles;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
public class TestSubscriber<T> implements Subscriber<T> {
private final List<T> elements = new ArrayList<>();
private final CountDownLatch latch = new CountDownLatch(1);
private final long demand;
private Subscription subscription;
private Throwable error;
public TestSubscriber() {
this.demand = Long.MAX_VALUE;
}
public TestSubscriber(long demand) {
this.demand = demand;
}
@Override
public void onSubscribe(Subscription s) {
if (subscription != null) {
fail("already subscribed");
}
subscription = s;
subscription.request(demand);
}
@Override
public void onNext(T t) {
elements.add(t);
}
@Override
public void onError(Throwable t) {
error = t;
latch.countDown();
}
@Override
public void onComplete() {
latch.countDown();
}
@Nullable
public Throwable getError() {
return error;
}
@NonNull
public List<T> getElements() {
return elements;
}
public void awaitTermination() {
Uninterruptibles.awaitUninterruptibly(latch, 1, TimeUnit.MINUTES);
if (latch.getCount() > 0) fail("subscriber not terminated");
}
}
| 725 |
3,631 | /*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.drools.verifier.core.cache.inspectors.action;
import org.drools.verifier.core.configuration.AnalyzerConfiguration;
import org.drools.verifier.core.index.model.Action;
import org.drools.verifier.core.index.model.FieldAction;
import org.drools.verifier.core.maps.InspectorFactory;
public class ActionInspectorFactory
extends InspectorFactory<ActionInspector, Action> {
public ActionInspectorFactory(final AnalyzerConfiguration configuration) {
super(configuration);
}
@Override
public ActionInspector make(final Action action) {
if (action instanceof FieldAction) {
return new FieldActionInspector((FieldAction) action,
configuration);
} else {
return null;
}
}
}
| 475 |
2,031 | /**
* Non-metric Space Library
*
* Main developers: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
*
* For the complete list of contributors and further details see:
* https://github.com/nmslib/nmslib
*
* Copyright (c) 2013-2018
*
* This code is released under the
* Apache License Version 2.0 http://www.apache.org/licenses/.
*
*/
#include <cmath>
#include <fstream>
#include <sstream>
#include <string>
#include <sstream>
#include <memory>
#include <iomanip>
#include <limits>
#include <cstdio>
#include <cstdint>
#include "object.h"
#include "utils.h"
#include "logging.h"
#include "distcomp.h"
#include "experimentconf.h"
#include "space/space_vector.h"
#include "read_data.h"
namespace similarity {
using namespace std;
/** Standard functions to read/write/create objects */
template <typename dist_t>
unique_ptr<DataFileInputState> VectorSpace<dist_t>::OpenReadFileHeader(const string& inpFileName) const {
return unique_ptr<DataFileInputState>(new DataFileInputStateVec(inpFileName));
}
template <typename dist_t>
unique_ptr<DataFileOutputState> VectorSpace<dist_t>::OpenWriteFileHeader(const ObjectVector& dataset,
const string& outFileName) const {
return unique_ptr<DataFileOutputState>(new DataFileOutputState(outFileName));
}
template <typename dist_t>
unique_ptr<Object>
VectorSpace<dist_t>::CreateObjFromStr(IdType id, LabelType label, const string& s,
DataFileInputState* pInpStateBase) const {
DataFileInputStateVec* pInpState = NULL;
if (pInpStateBase != NULL) {
pInpState = dynamic_cast<DataFileInputStateVec*>(pInpStateBase);
if (NULL == pInpState) {
PREPARE_RUNTIME_ERR(err) << "Bug: unexpected pointer type";
THROW_RUNTIME_ERR(err);
}
}
vector<dist_t> vec;
ReadVec(s, label, vec);
if (pInpState != NULL) {
if (pInpState->dim_ == 0) pInpState->dim_ = vec.size();
else if (vec.size() != pInpState->dim_) {
stringstream lineStr;
if (pInpStateBase != NULL) lineStr << " line:" << pInpState->line_num_ << " ";
PREPARE_RUNTIME_ERR(err) << "The # of vector elements (" << vec.size() << ")" << lineStr.str() <<
" doesn't match the # of elements in previous lines. (" << pInpState->dim_ << " )";
THROW_RUNTIME_ERR(err);
}
}
return unique_ptr<Object>(CreateObjFromVect(id, label, vec));
}
template <typename dist_t>
bool VectorSpace<dist_t>::ApproxEqual(const Object& obj1, const Object& obj2) const {
const dist_t* p1 = reinterpret_cast<const dist_t*>(obj1.data());
const dist_t* p2 = reinterpret_cast<const dist_t*>(obj2.data());
const size_t len1 = GetElemQty(&obj1);
const size_t len2 = GetElemQty(&obj2);
if (len1 != len2) {
PREPARE_RUNTIME_ERR(err) << "Bug: comparing vectors of different lengths: " << len1 << " and " << len2;
THROW_RUNTIME_ERR(err);
}
for (size_t i = 0; i < len1; ++i)
// We have to specify the namespace here, otherwise a compiler
// thinks that it should use the equally named member function
if (!similarity::ApproxEqual(p1[i], p2[i])) return false;
return true;
}
template <typename dist_t>
string VectorSpace<dist_t>::CreateStrFromObj(const Object* pObj, const string& externId /* ignored */) const {
stringstream out;
const dist_t* p = reinterpret_cast<const dist_t*>(pObj->data());
const size_t length = GetElemQty(pObj);
for (size_t i = 0; i < length; ++i) {
if (i) out << " ";
// Clear all previous flags & set to the maximum precision available
out.unsetf(ios_base::floatfield);
out << setprecision(numeric_limits<dist_t>::max_digits10) << noshowpoint << p[i];
}
return out.str();
}
template <typename dist_t>
bool VectorSpace<dist_t>::ReadNextObjStr(DataFileInputState &inpStateBase, string& strObj, LabelType& label, string& externId) const {
externId.clear();
DataFileInputStateOneFile* pInpState = dynamic_cast<DataFileInputStateOneFile*>(&inpStateBase);
CHECK_MSG(pInpState != NULL, "Bug: unexpected pointer type");
if (!pInpState->inp_file_) return false;
if (!getline(pInpState->inp_file_, strObj)) return false;
pInpState->line_num_++;
return true;
}
/** End of standard functions to read/write/create objects */
template <typename dist_t>
void VectorSpace<dist_t>::ReadVec(string line, LabelType& label, vector<dist_t>& v)
{
v.clear();
label = Object::extractLabel(line);
#if 0
if (!ReadVecDataViaStream(line, v)) {
#else
if (!ReadVecDataEfficiently(line, v)) {
#endif
PREPARE_RUNTIME_ERR(err) << "Failed to parse the line: '" << line << "'";
LOG(LIB_ERROR) << err.stream().str();
THROW_RUNTIME_ERR(err);
}
}
template <typename dist_t>
Object* VectorSpace<dist_t>::CreateObjFromVect(IdType id, LabelType label, const vector<dist_t>& InpVect) const {
return new Object(id, label, InpVect.size() * sizeof(dist_t), &InpVect[0]);
};
template class VectorSpace<PivotIdType>;
template class VectorSpace<float>;
} // namespace similarity
| 1,950 |
2,294 | <gh_stars>1000+
"""
When mu is 0, the solutions remain around 0, regardless of sigma.
When mu is not 0, the mean of the solutions drift toward positive or negative,
proportional to the magnitude of mu.
The variance of the solutions increases linearly in time. The slope of the
increase is proportional to the std of the Gaussian distribution at each step.
"""; | 93 |
2,939 | <gh_stars>1000+
#ifndef EIR_DIALECT_H
#define EIR_DIALECT_H
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/Dialect.h"
#include "lumen/EIR/IR/EIRDialect.h.inc"
#endif // EIR_DIALECT_H
| 124 |
1,745 | <reponame>Milerius/bsf<gh_stars>1000+
/* Copyright (C) 2011-2014 <NAME> <<EMAIL>>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef LIBSIMDPP_SIMDPP_DETAIL_INSN_STORE_H
#define LIBSIMDPP_SIMDPP_DETAIL_INSN_STORE_H
#ifndef LIBSIMDPP_SIMD_H
#error "This file must be included through simd.h"
#endif
#include <simdpp/types.h>
#include <simdpp/detail/null/memory.h>
#include <simdpp/detail/align.h>
namespace simdpp {
namespace SIMDPP_ARCH_NAMESPACE {
namespace detail {
namespace insn {
static SIMDPP_INL
void i_store(char* p, const uint8x16& a)
{
p = detail::assume_aligned(p, 16);
#if SIMDPP_USE_NULL
detail::null::store(p, a);
#elif SIMDPP_USE_SSE2
_mm_store_si128(reinterpret_cast<__m128i*>(p), a.native());
#elif SIMDPP_USE_NEON
vst1q_u64(reinterpret_cast<uint64_t*>(p), vreinterpretq_u64_u8(a.native()));
#elif SIMDPP_USE_ALTIVEC
vec_stl(a.native(), 0, reinterpret_cast<uint8_t*>(p));
#elif SIMDPP_USE_MSA
__msa_st_b((v16i8)a.native(), p, 0);
#endif
}
#if SIMDPP_USE_AVX2
static SIMDPP_INL
void i_store(char* p, const uint8x32& a)
{
p = detail::assume_aligned(p, 32);
_mm256_store_si256(reinterpret_cast<__m256i*>(p), a.native());
}
#endif
#if SIMDPP_USE_AVX512BW
SIMDPP_INL void i_store(char* p, const uint8<64>& a)
{
p = detail::assume_aligned(p, 64);
_mm512_store_si512(reinterpret_cast<__m512i*>(p), a.native());
}
#endif
// -----------------------------------------------------------------------------
static SIMDPP_INL
void i_store(char* p, const uint16<8>& a)
{
i_store(p, uint8<16>(a));
}
#if SIMDPP_USE_AVX2
static SIMDPP_INL
void i_store(char* p, const uint16<16>& a)
{
i_store(p, uint8<32>(a));
}
#endif
#if SIMDPP_USE_AVX512BW
SIMDPP_INL void i_store(char* p, const uint16<32>& a)
{
i_store(p, uint8<64>(a));
}
#endif
// -----------------------------------------------------------------------------
static SIMDPP_INL
void i_store(char* p, const uint32<4>& a)
{
i_store(p, uint8<16>(a));
}
#if SIMDPP_USE_AVX2
static SIMDPP_INL
void i_store(char* p, const uint32<8>& a)
{
i_store(p, uint8<32>(a));
}
#endif
#if SIMDPP_USE_AVX512F
static SIMDPP_INL
void i_store(char* p, const uint32<16>& a)
{
p = detail::assume_aligned(p, 64);
_mm512_store_epi32(p, a.native());
}
#endif
// -----------------------------------------------------------------------------
static SIMDPP_INL
void i_store(char* p, const uint64<2>& a)
{
#if SIMDPP_USE_NULL || (SIMDPP_USE_ALTIVEC && !SIMDPP_USE_VSX_207)
p = detail::assume_aligned(p, 16);
detail::null::store(p, a);
#else
i_store(p, uint8<16>(a));
#endif
}
#if SIMDPP_USE_AVX2
static SIMDPP_INL
void i_store(char* p, const uint64<4>& a)
{
i_store(p, uint8<32>(a));
}
#endif
#if SIMDPP_USE_AVX512F
static SIMDPP_INL
void i_store(char* p, const uint64<8>& a)
{
p = detail::assume_aligned(p, 64);
_mm512_store_epi64(p, a.native());
}
#endif
// -----------------------------------------------------------------------------
static SIMDPP_INL
void i_store(char* p, const float32x4& a)
{
p = detail::assume_aligned(p, 16);
float* q = reinterpret_cast<float*>(p);
(void) q;
#if SIMDPP_USE_NULL || SIMDPP_USE_NEON_NO_FLT_SP
detail::null::store(p, a);
#elif SIMDPP_USE_SSE2
_mm_store_ps(q, a.native());
#elif SIMDPP_USE_NEON
vst1q_f32(q, a.native());
#elif SIMDPP_USE_ALTIVEC
vec_stl(a.native(), 0, q);
#elif SIMDPP_USE_MSA
__msa_st_w((v4i32) a.native(), q, 0);
#endif
}
#if SIMDPP_USE_AVX
static SIMDPP_INL
void i_store(char* p, const float32x8& a)
{
float* q = reinterpret_cast<float*>(p);
q = detail::assume_aligned(q, 32);
_mm256_store_ps(q, a.native());
}
#endif
#if SIMDPP_USE_AVX512F
static SIMDPP_INL
void i_store(char* p, const float32<16>& a)
{
p = detail::assume_aligned(p, 64);
_mm512_store_ps(p, a.native());
}
#endif
// -----------------------------------------------------------------------------
static SIMDPP_INL
void i_store(char* p, const float64x2& a)
{
p = detail::assume_aligned(p, 16);
double* q = reinterpret_cast<double*>(p);
(void) q;
#if SIMDPP_USE_SSE2
_mm_store_pd(q, a.native());
#elif SIMDPP_USE_NEON64
vst1q_f64(q, a.native());
#elif SIMDPP_USE_VSX_206
vec_stl(a.native(), 0, q);
#elif SIMDPP_USE_MSA
__msa_st_d((v2i64) a.native(), q, 0);
#elif SIMDPP_USE_NULL || SIMDPP_USE_NEON || SIMDPP_USE_ALTIVEC
detail::null::store(p, a);
#endif
}
#if SIMDPP_USE_AVX
static SIMDPP_INL
void i_store(char* p, const float64x4& a)
{
p = detail::assume_aligned(p, 32);
_mm256_store_pd(reinterpret_cast<double*>(p), a.native());
}
#endif
#if SIMDPP_USE_AVX512F
static SIMDPP_INL
void i_store(char* p, const float64<8>& a)
{
p = detail::assume_aligned(p, 64);
_mm512_store_pd(p, a.native());
}
#endif
// -----------------------------------------------------------------------------
template<class V> SIMDPP_INL
void i_store(char* p, const V& ca)
{
const unsigned veclen = V::base_vector_type::length_bytes;
typename detail::remove_sign<V>::type a = ca;
p = detail::assume_aligned(p, veclen);
for (unsigned i = 0; i < V::vec_length; ++i) {
i_store(p, a.vec(i));
p += veclen;
}
}
} // namespace insn
} // namespace detail
} // namespace SIMDPP_ARCH_NAMESPACE
} // namespace simdpp
#endif
| 2,419 |
3,102 | // REQUIRES: aarch64-registered-target
// -fopemp and -fopenmp-simd behavior are expected to be the same
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \
// RUN: -fopenmp -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \
// RUN: -fopenmp-simd -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s
#pragma omp declare simd
#pragma omp declare simd notinbranch
#pragma omp declare simd simdlen(2)
#pragma omp declare simd simdlen(4)
#pragma omp declare simd simdlen(5) // not a multiple of 128-bits
#pragma omp declare simd simdlen(6)
#pragma omp declare simd simdlen(8)
#pragma omp declare simd simdlen(32)
#pragma omp declare simd simdlen(34) // requires more than 2048 bits
double foo(float x);
// CHECK-DAG: "_ZGVsM2v_foo" "_ZGVsM32v_foo" "_ZGVsM4v_foo" "_ZGVsM6v_foo" "_ZGVsM8v_foo" "_ZGVsMxv_foo"
// CHECK-NOT: _ZGVsN
// CHECK-NOT: _ZGVsM5v_foo
// CHECK-NOT: _ZGVsM34v_foo
// CHECK-NOT: foo
void foo_loop(double *x, float *y, int N) {
for (int i = 0; i < N; ++i) {
x[i] = foo(y[i]);
}
}
// test integers
#pragma omp declare simd notinbranch
char a01_fun(int x);
// CHECK-DAG: _ZGVsMxv_a01_fun
// CHECK-NOT: a01_fun
static int *in;
static char *out;
void do_something() {
*out = a01_fun(*in);
}
| 600 |
372 | <gh_stars>100-1000
package io.mvpstarter.sample.injection.component;
import dagger.Subcomponent;
import io.mvpstarter.sample.features.detail.DetailActivity;
import io.mvpstarter.sample.features.main.MainActivity;
import io.mvpstarter.sample.injection.PerActivity;
import io.mvpstarter.sample.injection.module.ActivityModule;
@PerActivity
@Subcomponent(modules = ActivityModule.class)
public interface ActivityComponent {
void inject(MainActivity mainActivity);
void inject(DetailActivity detailActivity);
}
| 151 |
1,345 | <reponame>MaksHess/napari<filename>napari/components/_tests/test_world_coordinates.py
import warnings
import numpy as np
import pytest
from napari.components import ViewerModel
def test_translated_images():
"""Test two translated images."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data)
viewer.add_image(data, translate=[10, 0, 0])
assert viewer.dims.range[0] == (0, 20, 1)
assert viewer.dims.range[1] == (0, 10, 1)
assert viewer.dims.range[2] == (0, 10, 1)
assert viewer.dims.nsteps == (20, 10, 10)
for i in range(viewer.dims.nsteps[0]):
viewer.dims.set_current_step(0, i)
assert viewer.dims.current_step[0] == i
def test_scaled_images():
"""Test two scaled images."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data)
viewer.add_image(data[::2], scale=[2, 1, 1])
assert viewer.dims.range[0] == (
-0.5,
10,
1,
) # TODO: non-integer with mixed scale?
assert viewer.dims.range[1] == (0, 10, 1)
assert viewer.dims.range[2] == (0, 10, 1)
assert viewer.dims.nsteps == (10, 10, 10)
for i in range(viewer.dims.nsteps[0]):
viewer.dims.set_current_step(0, i)
assert viewer.dims.current_step[0] == i
def test_scaled_and_translated_images():
"""Test scaled and translated images."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data)
viewer.add_image(data[::2], scale=[2, 1, 1], translate=[10, 0, 0])
assert viewer.dims.range[0] == (
0,
19.5,
1,
) # TODO: non-integer with mixed scale?
assert viewer.dims.range[1] == (0, 10, 1)
assert viewer.dims.range[2] == (0, 10, 1)
assert viewer.dims.nsteps == (19, 10, 10)
for i in range(viewer.dims.nsteps[0]):
viewer.dims.set_current_step(0, i)
assert viewer.dims.current_step[0] == i
def test_both_scaled_and_translated_images():
"""Test both scaled and translated images."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data, scale=[2, 1, 1])
viewer.add_image(data, scale=[2, 1, 1], translate=[20, 0, 0])
assert viewer.dims.range[0] == (0, 40, 2)
assert viewer.dims.range[1] == (0, 10, 1)
assert viewer.dims.range[2] == (0, 10, 1)
assert viewer.dims.nsteps == (20, 10, 10)
for i in range(viewer.dims.nsteps[0]):
viewer.dims.set_current_step(0, i)
assert viewer.dims.current_step[0] == i
def test_no_warning_non_affine_slicing():
"""Test no warning if not slicing into an affine."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data, scale=[2, 1, 1], translate=[10, 15, 20])
with warnings.catch_warnings(record=True) as recorded_warnings:
viewer.layers[0].refresh()
assert len(recorded_warnings) == 0
def test_warning_affine_slicing():
"""Test warning if slicing into an affine."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
with pytest.warns(UserWarning) as wrn:
viewer.add_image(
data,
scale=[2, 1, 1],
translate=[10, 15, 20],
shear=[[1, 0, 0], [0, 1, 0], [4, 0, 1]],
)
assert 'Non-orthogonal slicing is being requested' in str(wrn[0].message)
with pytest.warns(UserWarning) as recorded_warnings:
viewer.layers[0].refresh()
# note right now refresh tiggers two `_slice_indices` calls
assert len(recorded_warnings) == 2
| 1,629 |
1,585 | package com.jaeger.ninegridimgdemo.activity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.jaeger.ninegridimageview.NineGridImageView;
import com.jaeger.ninegridimgdemo.R;
import com.jaeger.ninegridimgdemo.adapter.PostAdapter;
import com.jaeger.ninegridimgdemo.entity.Post;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.jaeger.ninegridimageview.NineGridImageView.BOTTOMCOLSPAN;
import static com.jaeger.ninegridimageview.NineGridImageView.LEFTROWSPAN;
import static com.jaeger.ninegridimageview.NineGridImageView.NOSPAN;
import static com.jaeger.ninegridimageview.NineGridImageView.TOPCOLSPAN;
/**
* Created by Jaeger on 16/2/24.
*
* Email: <EMAIL>
* GitHub: https://github.com/laobie
*/
public class FillStyleActivity extends BaseActivity {
public static final String CONTENT = "看图,字不重要。想看大图?抱歉我还没做这个 ( •̀ .̫ •́ )";
private RecyclerView mRvPostLister;
private PostAdapter mPostAdapter;
private List<Post> mPostList;
private String[] IMG_URL_LIST = {
"https://pic4.zhimg.com/02685b7a5f2d8cbf74e1fd1ae61d563b_xll.jpg",
"https://pic4.zhimg.com/fc04224598878080115ba387846eabc3_xll.jpg",
"https://pic3.zhimg.com/d1750bd47b514ad62af9497bbe5bb17e_xll.jpg",
"https://pic4.zhimg.com/da52c865cb6a472c3624a78490d9a3b7_xll.jpg",
"https://pic3.zhimg.com/0c149770fc2e16f4a89e6fc479272946_xll.jpg",
"https://pic1.zhimg.com/76903410e4831571e19a10f39717988c_xll.png",
"https://pic3.zhimg.com/33c6cf59163b3f17ca0c091a5c0d9272_xll.jpg",
"https://pic4.zhimg.com/52e093cbf96fd0d027136baf9b5cdcb3_xll.png",
"https://pic3.zhimg.com/f6dc1c1cecd7ba8f4c61c7c31847773e_xll.jpg",
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
setContentView(R.layout.activity_recycler);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
mRvPostLister = (RecyclerView) findViewById(R.id.rv_post_list);
mRvPostLister.setLayoutManager(new LinearLayoutManager(this));
fummuyData();
mPostAdapter = new PostAdapter(this, mPostList, NineGridImageView.STYLE_FILL);
mRvPostLister.setAdapter(mPostAdapter);
}
private void fummuyData() {
mPostList = new ArrayList<>();
//单张
mPostList.add(fummuyPost(1,NOSPAN));
//2张
mPostList.add(fummuyPost(2,NOSPAN));
//3张,不跨行不跨列
mPostList.add(fummuyPost(3,NOSPAN));
//3张,首行跨列
mPostList.add(fummuyPost(3,TOPCOLSPAN));
//3张,末行跨列
mPostList.add(fummuyPost(3,BOTTOMCOLSPAN));
//3张,首列跨行
mPostList.add(fummuyPost(3,LEFTROWSPAN));
//4张,不跨行不跨列
mPostList.add(fummuyPost(4,NOSPAN));
//4张,首行跨列
mPostList.add(fummuyPost(4,TOPCOLSPAN));
//4张,末行跨列
mPostList.add(fummuyPost(4,BOTTOMCOLSPAN));
//4张,首列跨行
mPostList.add(fummuyPost(4,LEFTROWSPAN));
//5张,不跨行不跨列
mPostList.add(fummuyPost(5,NOSPAN));
//5张,首行跨列
mPostList.add(fummuyPost(5,TOPCOLSPAN));
//5张,末行跨列
mPostList.add(fummuyPost(5,BOTTOMCOLSPAN));
//5张,首列跨行
mPostList.add(fummuyPost(5,LEFTROWSPAN));
//6张,不跨行不跨列
mPostList.add(fummuyPost(6,NOSPAN));
//6张,首行跨列
mPostList.add(fummuyPost(6,TOPCOLSPAN));
//6张,末行跨列
mPostList.add(fummuyPost(6,BOTTOMCOLSPAN));
//6张,首列跨行
mPostList.add(fummuyPost(6,LEFTROWSPAN));
}
private Post fummuyPost(int num, int spanType) {
List<String> imgUrls = new ArrayList<>();
imgUrls.addAll(Arrays.asList(IMG_URL_LIST).subList(0, num % 9));
return new Post(CONTENT, spanType, imgUrls);
}
}
| 2,122 |
739 | """
* Copyright 2007,2008,2009 <NAME>
* Copyright (C) 2009 <NAME> <<EMAIL>>
*
* Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*
"""
import math
from pyjamas.ui import HasHorizontalAlignment
from pyjamas.ui import HasVerticalAlignment
# Validates multipliers used to simplify computing the
# upper left corner location of symbols and labels to
# properly reflect their alignment relative to the
# plotted point or labeled symbol.
def validateMultipliers(widthMultiplier, heightMultiplier):
if (not (widthMultiplier == 0 or abs(widthMultiplier)==1) and
not (heightMultiplier == 0 or abs(heightMultiplier)==1)):
raise IllegalArgumentException(
"widthMultiplier, heightMultiplier args must both be " +
"either 0, 1, or -1")
# retrieves a location given its multipliers
def getAnnotationLocation(widthMultiplier, heightMultiplier):
locationMap = [
[NORTHWEST, NORTH, NORTHEAST],
[WEST, CENTER, EAST],
[SOUTHWEST, SOUTH, SOUTHEAST]]
# assumes both multiplier are -1, 0, or 1
result = locationMap[heightMultiplier+1][widthMultiplier+1]
return result
# Negative width or height "turn the symbol inside-out",
# requiring a corresponding "reflection" of annotation
# location (only needed for baseline-based bar symbols)
def transform(a, signWidth, signHeight):
result = a
if signWidth < 0 or signHeight < 0:
result = getAnnotationLocation(
signWidth*a.widthMultiplier,
signHeight*a.heightMultiplier)
return result
"""*
** Defines the location of a data point's annotation or hover
** annotation (which can be defined by either plain text, HTML,
** or a widget) relative to the location of that point's
** symbol. The "Field Summary"
** section below lists all available annotation locations.
** <p>
**
** The default annotation location is {@link
** AnnotationLocation#SOUTH SOUTH} for annotations and
** is symbol-type-dependent for hover annotations. See the
** <tt>setHoverLocation</tt> method for list of these defaults.
**
** <p>
**
** You can further adjust the position of a point's
** annotation (or hover annotation) by specifying non-zero
** positional shifts via the <tt>setAnnotationXShift</tt>
** and <tt>setAnnotationYShift</tt> (or via the
** <tt>setHoverXShift</tt>, <tt>setHoverYShift</tt>),
** and <tt>setHoverAnnotationSymbolType</tt> methods for
** hover annotations).
** <p>
**
** @see Curve.Point#setAnnotationLocation Point.setAnnotationLocation
** @see Curve.Point#setAnnotationXShift Point.setAnnotationXShift
** @see Curve.Point#setAnnotationYShift Point.setAnnotationYShift
** @see Symbol#setHoverLocation Symbol.setHoverLocation
** @see Symbol#setHoverAnnotationSymbolType
** Symbol.setHoverAnnotationSymbolType
** @see Symbol#setHoverXShift Symbol.setHoverXShift
** @see Symbol#setHoverYShift Symbol.setHoverYShift
** @see #DEFAULT_HOVER_LOCATION DEFAULT_HOVER_LOCATION
**
*"""
class AnnotationLocation:
# these multiply the width and height of the annotation and
# the symbol it is attached to in order to define the
# center of the annotation (see equations in later code),
# and thus the upper left corner anchoring point.
def __init__(self, widthMultiplier, heightMultiplier):
validateMultipliers(widthMultiplier, heightMultiplier)
self.widthMultiplier = widthMultiplier
self.heightMultiplier = heightMultiplier
# These define the alignment of the label within it's
# containing 1 x 1 Grid. For example, if this
# containing grid is to the left of the labeled
# symbol (widthMultiplier==-1) the horizontal
# alignment will be ALIGN_RIGHT, so as to bring the
# contained label flush against the left edge of the
# labeled symbol.
def getHorizontalAlignment(self):
if self.widthMultiplier == -1:
result = HasHorizontalAlignment.ALIGN_RIGHT
elif self.widthMultiplier == 0:
result = HasHorizontalAlignment.ALIGN_CENTER
elif self.widthMultiplier == 1:
result = HasHorizontalAlignment.ALIGN_LEFT
else:
raise IllegalStateException(
"Invalid widthMultiplier: " + str(self.widthMultiplier) +
" 1, 0, or -1 were expected.")
return result
""" Given the x-coordinate at the center of the symbol
* that this annotation annotates, the annotation's
* width, and the symbol's width, this method returns
* the x-coordinate of the upper left corner of
* this annotation.
"""
def getUpperLeftX(self, x, w, symbolW):
result = int (round(x +
(self.widthMultiplier * (w + symbolW) - w)/2.) )
return result
""" analogous to getUpperLeftX, except for the y-coordinate """
def getUpperLeftY(self, y, h, symbolH):
result = int (round(y +
(self.heightMultiplier * (h + symbolH) - h)/2.))
return result
# analogous to getHorizontalAlignment
def getVerticalAlignment(self):
if self.heightMultiplier == -1:
result = HasVerticalAlignment.ALIGN_BOTTOM
elif self.heightMultiplier == 0:
result = HasVerticalAlignment.ALIGN_MIDDLE
elif self.heightMultiplier == 1:
result = HasVerticalAlignment.ALIGN_TOP
else:
raise IllegalStateException(
"Invalid heightMultiplier: " + self.heightMultiplier +
" -1, 0, or 1 were expected.")
return result
"""
* This method returns the annotation location whose
* "attachment point" keeps the annotation either
* completely outside, centered on, or completely inside
* (depending on if the heightMultiplier of this annotation
* is 1, 0, or -1) the point on the pie's circumference
* associated with the given angle.
* <p>
*
* The use of heightMultiplier rather than widthMultiplier
* is somewhat arbitrary, but was chosen so that the
* NORTH, CENTER, and SOUTH annotation locations have the
* same interpretation for a pie slice whose bisecting
* radius points due south (due south is the default initial
* pie slice orientation) and for a 1px x 1px BOX_CENTER
* type symbol positioned at the due south position on the
* pie's circumference. As the pie-slice-arc-bisection
* point moves clockwise around the pie perimeter, the
* attachment point (except for vertically-centered
* annotations, which remain centered on the pie arc) also
* moves clockwise, but in discrete jumps (e.g. from
* NORTH, to NORTHEAST, to EAST, to SOUTHEAST, to SOUTH,
* etc. for annotations inside the pie) so the annotation
* remains appropriately attached to the center of the
* slice's arc as the angle changes.
*
"""
def decodePieLocation(self, thetaMid):
# a sin or cos that is small enough so that the
# associated angle is horizontal (for sines) or vertical
# (for cosines) enough to warrant use of a "centered"
# annotation location.
LOOKS_VERTICAL_OR_HORIZONTAL_DELTA = 0.1
sinTheta = math.sin(thetaMid)
cosTheta = math.cos(thetaMid)
if cosTheta < -LOOKS_VERTICAL_OR_HORIZONTAL_DELTA:
pieTransformedWidthMultiplier = -self.heightMultiplier
elif cosTheta > LOOKS_VERTICAL_OR_HORIZONTAL_DELTA:
pieTransformedWidthMultiplier = self.heightMultiplier
else:
pieTransformedWidthMultiplier = 0
# XXX ?? surely this should be widthMultiplier?
if sinTheta < -LOOKS_VERTICAL_OR_HORIZONTAL_DELTA:
pieTransformedHeightMultiplier = -self.heightMultiplier
elif sinTheta > LOOKS_VERTICAL_OR_HORIZONTAL_DELTA:
pieTransformedHeightMultiplier = self.heightMultiplier
else:
pieTransformedHeightMultiplier = 0
return getAnnotationLocation(pieTransformedWidthMultiplier,
pieTransformedHeightMultiplier)
# end of class AnnotationLocation
# non-tagging-only locations used by ANCHOR_MOUSE_* symbol types
AT_THE_MOUSE = AnnotationLocation(0,0)
AT_THE_MOUSE_SNAP_TO_X = AnnotationLocation(0,0)
AT_THE_MOUSE_SNAP_TO_Y = AnnotationLocation(0,0)
"""*
** Specifies that a point's annotation (label) should
** be positioned so as to be centered on the symbol
** used to represent the point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
CENTER = AnnotationLocation(0,0)
north = AnnotationLocation(0,-1)
west = AnnotationLocation(-1, 0)
south = AnnotationLocation(0, 1)
"""*
** Specifies that a point's annotation (label) should be
** placed just above, and centered horizontally on,
** vertical bars that grow down from a horizontal
** baseline, and just below, and centered horizontally on,
** vertical bars that grow up from a horizontal baseline.
**
** <p>
**
** This another name for
** <tt>AnnotationLocation.NORTH</tt>. Its sole purpose is
** to clarify/document the behavior of this location type
** when used in conjunction with curves that employ
** <tt>VBAR_BASELINE_*</tt> symbol types.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see SymbolType#VBAR_BASELINE_CENTER SymbolType.VBAR_BASELINE_CENTER
**
*"""
CLOSEST_TO_HORIZONTAL_BASELINE = north
"""*
** Specifies that a point's annotation (label) should be
** placed just to the right of, and centered vertically
** on, horizontal bars that grow left from a vertical
** baseline, and just to the left of, and centered
** vertically on, horizontal bars that grow right from a
** vertical baseline.
**
** <p>
**
** This another name for
** <tt>AnnotationLocation.WEST</tt>. Its sole purpose is
** to clarify/document the behavior of this location type
** when used in conjunction with curves that employ the
** <tt>HBAR_BASELINE_*</tt> symbol types.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see SymbolType#HBAR_BASELINE_CENTER SymbolType.HBAR_BASELINE_CENTER
**
*"""
CLOSEST_TO_VERTICAL_BASELINE = west
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the right of, and vertically
** centered on, the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation
*"""
EAST = AnnotationLocation(1, 0)
"""*
** Specifies that a point's annotation (label) should be
** placed just below, and centered horizontally on,
** vertical bars that grow down from a horizontal
** baseline, and just above, and centered horizontally on,
** vertical bars that grow up from a horizontal baseline.
**
** <p>
**
** This another name for
** <tt>AnnotationLocation.SOUTH</tt>. Its sole purpose is
** to clarify/document the behavior of this location type
** when used in conjunction with curves that employ
** <tt>VBAR_BASELINE_*</tt> symbol types.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see SymbolType#VBAR_BASELINE_CENTER SymbolType.VBAR_BASELINE_CENTER
**
*"""
FARTHEST_FROM_HORIZONTAL_BASELINE = south
"""*
** Specifies that a point's annotation (label) should be
** placed just to the left of, and centered vertically on,
** horizontal bars that grow left from a vertical
** baseline, and just to the right of, and centered
** vertically on, horizontal bars that grow right from a
** vertical baseline.
**
** <p>
**
** This another name for
** <tt>AnnotationLocation.EAST</tt>. Its sole purpose is
** to clarify/document the behavior of this location type
** when used in conjunction with curves that employ the
** <tt>HBAR_BASELINE_*</tt> family of symbol types.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see SymbolType#HBAR_BASELINE_CENTER SymbolType.HBAR_BASELINE_CENTER
**
*"""
FARTHEST_FROM_VERTICAL_BASELINE = EAST
"""*
** Specifies that a point's annotation (label) should
** be positioned just inside, and centered on, the
** arc side of a pie slice.
** <p>
**
** You can move a pie slice's annotation a specific number
** of pixels radially away from (or towards) the pie
** center by passing a positive (or negative) argument to
** the associated <tt>Point</tt>'s
** <tt>setAnnotationXShift</tt> method.
**
** <p> This is pie-friendly synonym for, and when used
** with non-pie symbol types will behave exactly the same
** as, <tt>AnnotationLocation.NORTH</tt>
**
** @see #OUTSIDE_PIE_ARC OUTSIDE_PIE_ARC
** @see #ON_PIE_ARC ON_PIE_ARC
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see AnnotationLocation#NORTH NORTH
*"""
INSIDE_PIE_ARC = north
"""*
** Specifies that a point's annotation (label) should
** be positioned just above, and horizontally centered on,
** the symbol used to represent the point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
NORTH = north
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the right of and above,
** the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation
*"""
NORTHEAST = AnnotationLocation(1, -1)
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the left of and above,
** the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation
*"""
NORTHWEST = AnnotationLocation(-1, -1)
"""*
** Specifies that a point's annotation (label) should
** be centered on the center-point of the
** arc side of a pie slice.
** <p>
**
** You can move a pie slice's annotation a specific number
** of pixels radially away from (or towards) the pie
** center by passing a positive (or negative) argument to
** the associated <tt>Point</tt>'s
** <tt>setAnnotationXShift</tt> method.
**
**
**
** <p> This is pie-friendly synonym for, and when used
** with non-pie symbol types will behave exactly the same
** as, <tt>AnnotationLocation.CENTER</tt>
**
** @see #OUTSIDE_PIE_ARC OUTSIDE_PIE_ARC
** @see #INSIDE_PIE_ARC INSIDE_PIE_ARC
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see AnnotationLocation#CENTER CENTER
**
*"""
ON_PIE_ARC = CENTER
"""*
** Specifies that a point's annotation (label) should
** be positioned just outside, and centered on, the
** arc side of a pie slice.
** <p>
**
** You can move a pie slice's annotation a specific number
** of pixels radially away from (or towards) the pie
** center by passing a positive (or negative) argument to
** the associated <tt>Point</tt>'s
** <tt>setAnnotationXShift</tt> method.
**
** <p> This is pie-friendly synonym for, and when used
** with non-pie symbol types will behave exactly the same
** as, <tt>AnnotationLocation.SOUTH</tt>
**
** @see #INSIDE_PIE_ARC INSIDE_PIE_ARC
** @see #ON_PIE_ARC ON_PIE_ARC
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
** @see Curve.Point#setAnnotationXShift setAnnotationXShift
** @see AnnotationLocation#SOUTH SOUTH
*"""
OUTSIDE_PIE_ARC = south
"""*
** Specifies that a point's annotation (label) should
** be positioned just below, and horizontally centered on,
** the symbol used to represent the point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
SOUTH = south
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the right of and below,
** the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
SOUTHEAST = AnnotationLocation(1, 1)
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the left of and below,
** the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
SOUTHWEST = AnnotationLocation(-1, 1)
"""*
** Specifies that a point's annotation (label) should
** be positioned just to the left of, and vertically
** centered on, the symbol used to represent the
** point.
**
** @see Curve.Point#setAnnotationLocation setAnnotationLocation
*"""
WEST = west
| 5,429 |
1,009 | <filename>src/aof_buf_queue.h<gh_stars>1000+
/*
* Copyright (c) 2017, Alibaba Group Holding Limited
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Redis nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __AOF_BUF_QUEUE_H
#define __AOF_BUF_QUEUE_H
#include <unistd.h>
#include <pthread.h>
#include <sys/param.h>
#include "server.h"
#include "config.h"
#include "adlist.h"
#include "bio.h"
#include "sds.h"
#include "msqueue.h"
#include "util.h"
#define REDIS_AOF_BUF_QUEUE_DEFAULT_LIMIT (1 << 30)
#define REDIS_AOF_BUF_QUEUE_MIN_LIMIT (256*1024*1024)
#define AOF_BIO_LATENCY_LOG_RATE_US (30*1000*1000) //30 seconds
#define REDIS_DEFAULT_RDB_SAVE_INCREMENTAL_FSYNC 1
#define REDIS_RDB_AUTOSYNC_BYTES (1024*1024*32) /* fdatasync every 32MB */
#define AOF_FSYNC_BIO_WRITE 3
struct aofQueue;
typedef struct aofFileItem {
int fd;
int need_sync;
size_t filesize;
size_t sync_offset;
long long last_sync;
} aofFileItem;
#define AOF_BUF_ACT_WRITE 0
#define AOF_BUF_ACT_CLOSE 1
#define AOF_BUF_ACT_SYNC 2
typedef struct aofReqItem {
queueNode node;
int req;
aofFileItem *file;
sds buf;
} aofReqItem;
typedef struct aofQueue {
queue *req_queue;
list *file_list;
size_t total_buf_len;
int handling;
long long flow_ctrl_duration;
long long flow_ctrl_times;
pthread_mutex_t mutex;
pthread_cond_t cond;
} aofQueue;
aofQueue *aofQueueCreate();
void aofQueuePushWriteFileReq(aofQueue *queue, int fd, sds buf);
int aofQueueNeedSync(aofQueue *queue, int fd);
void aofQueuePushSyncFileReq(aofQueue *queue, int fd);
int aofQueuePushCloseFileReq(aofQueue *queue, int fd);
aofReqItem *aofQueueBufPop(aofQueue *queue);
void aofQueueHandleReq(aofQueue *queue);
void aofQueueHandleAppendOnlyFlush(int force);
int enableOrDisableAofBioWrite(struct client *c, int sync_mode);
void aofBioWriteInit(void);
sds catAofBioInfo(sds info);
inline size_t aofQueueTotalLen(aofQueue *queue) {
return atomic_add(queue->total_buf_len, 0);
}
#endif
| 1,292 |
544 | //
// GooglePalette+Accents.h
// CrayonsExample
//
// Created by <NAME> on 03/12/2015.
// Copyright © 2015 orange in a day. All rights reserved.
//
#import "GooglePalette.h"
@interface GooglePalette (Accents)
@end
| 80 |
1,962 | package com.bolingcavalry.api;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import java.util.ArrayList;
import java.util.List;
/**
* @author will
* @email <EMAIL>
* @date 2020-03-14 22:08
* @description 通过集合创建的DataSource
*/
public class FromCollection {
public static void main(String[] args) throws Exception {
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
//并行度为1
env.setParallelism(1);
//创建一个List,里面有两个Tuple2元素
List<Tuple2<String, Integer>> list = new ArrayList<>();
list.add(new Tuple2("aaa", 1));
list.add(new Tuple2("bbb", 1));
//通过List创建DataStream
DataStream<Tuple2<String, Integer>> fromCollectionDataStream = env.fromCollection(list);
//通过多个Tuple2元素创建DataStream
DataStream<Tuple2<String, Integer>> fromElementDataStream = env.fromElements(
new Tuple2("ccc", 1),
new Tuple2("ddd", 1),
new Tuple2("aaa", 1)
);
//通过union将两个DataStream合成一个
DataStream<Tuple2<String, Integer>> unionDataStream = fromCollectionDataStream.union(fromElementDataStream);
//统计每个单词的数量
unionDataStream
.keyBy(0)
.sum(1)
.print();
env.execute("API DataSource demo : collection");
}
}
| 726 |
3,066 | <filename>extensions/functions/src/test/java/io/crate/window/RankFunctionsIntegrationTest.java
/*
* Licensed to Crate.io GmbH ("Crate") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership. Crate licenses
* this file to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial agreement.
*/
package io.crate.window;
import io.crate.integrationtests.SQLIntegrationTestCase;
import org.elasticsearch.plugins.Plugin;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collection;
import static io.crate.testing.TestingHelpers.printedTable;
import static org.hamcrest.Matchers.is;
public class RankFunctionsIntegrationTest extends SQLIntegrationTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(EnterpriseFunctionsProxyTestPlugin.class);
return plugins;
}
@Test
public void testGeneralPurposeWindowFunctionsWithStandaloneValues() {
execute("select col1, col2, " +
"rank() OVER (partition by col2 order by col1), " +
"dense_rank() OVER (partition by col2 order by col1)" +
"from unnest(['A', 'B', 'C', 'A', 'B', 'C', 'A'], [True, True, False, True, False, True, False]) " +
"order by col2, col1");
assertThat(printedTable(response.rows()), is("A| false| 1| 1\n" +
"B| false| 2| 2\n" +
"C| false| 3| 3\n" +
"A| true| 1| 1\n" +
"A| true| 1| 1\n" +
"B| true| 3| 2\n" +
"C| true| 4| 3\n"));
}
}
| 1,101 |
12,964 | /**
* An implementation of counting sort!
*
* <p>Run with:
*
* <p>$ ./gradlew run -Palgorithm=sorting.CountingSort
*
* @author <NAME>, <EMAIL>
*/
package com.williamfiset.algorithms.sorting;
public class CountingSort implements InplaceSort {
@Override
public void sort(int[] values) {
int minValue = Integer.MAX_VALUE;
int maxValue = Integer.MIN_VALUE;
for (int i = 0; i < values.length; i++) {
if (values[i] < minValue) minValue = values[i];
if (values[i] > maxValue) maxValue = values[i];
}
CountingSort.countingSort(values, minValue, maxValue);
}
// Sorts values in the range of [minVal, maxVal] in O(n+maxVal-maxVal)
private static void countingSort(int[] ar, int minVal, int maxVal) {
int sz = maxVal - minVal + 1;
int[] b = new int[sz];
for (int i = 0; i < ar.length; i++) b[ar[i] - minVal]++;
for (int i = 0, k = 0; i < sz; i++) {
while (b[i]-- > 0) ar[k++] = i + minVal;
}
}
public static void main(String[] args) {
CountingSort sorter = new CountingSort();
int[] nums = {+4, -10, +0, +6, +1, -5, -5, +1, +1, -2, 0, +6, +8, -7, +10};
sorter.sort(nums);
// Prints:
// [-10, -7, -5, -5, -2, 0, 0, 1, 1, 1, 4, 6, 6, 8, 10]
System.out.println(java.util.Arrays.toString(nums));
}
}
| 560 |
3,673 | <gh_stars>1000+
// -*-C++-*-
#pragma once
#ifndef INCLUDEOS_ARCH_HEADER
#define INCLUDEOS_ARCH_HEADER
#include <cstddef>
#include <cstdint>
#include <cassert>
#include <ctime>
#include <string>
extern void __arch_poweroff();
extern void __arch_reboot();
extern void __arch_enable_legacy_irq(uint8_t);
extern void __arch_disable_legacy_irq(uint8_t);
extern void __arch_system_deactivate();
extern void __arch_install_irq(uint8_t, void(*)());
extern void __arch_subscribe_irq(uint8_t);
extern void __arch_unsubscribe_irq(uint8_t);
extern void __arch_preempt_forever(void(*)());
inline void __arch_hw_barrier() noexcept;
inline void __sw_barrier() noexcept;
extern uint64_t __arch_system_time() noexcept;
extern timespec __arch_wall_clock() noexcept;
extern uint32_t __arch_rand32();
inline void __arch_hw_barrier() noexcept {
__sync_synchronize();
}
inline void __sw_barrier() noexcept
{
asm volatile("" ::: "memory");
}
// Include arch specific inline implementations
#if defined(ARCH_x86_64)
#include "arch/x86_64.hpp"
#elif defined(ARCH_i686)
#include "arch/i686.hpp"
#elif defined(ARCH_aarch64)
#include "arch/aarch64.hpp"
#else
#error "Unsupported arch specified"
#endif
// retrieve system information
struct arch_system_info_t
{
std::string uuid;
uint64_t physical_memory;
};
const arch_system_info_t& __arch_system_info() noexcept;
#endif
| 525 |
648 | {"resourceType":"DataElement","id":"Composition.section.text","meta":{"lastUpdated":"2015-10-24T07:41:03.495+11:00"},"url":"http://hl7.org/fhir/DataElement/Composition.section.text","status":"draft","experimental":true,"stringency":"fully-specified","element":[{"path":"Composition.section.text","short":"Text summary of the section, for human interpretation","definition":"A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative.","comments":"Document profiles may define what content should be represented in the narrative to ensure clinical safety.","min":0,"max":"1","type":[{"code":"Narrative"}],"condition":["cmp-1"],"mapping":[{"identity":"cda","map":".text"},{"identity":"rim","map":".text"}]}]} | 231 |
1,059 | /* SPDX-License-Identifier: BSD-2-Clause */
#include <tilck/common/basic_defs.h>
#include <tilck/kernel/kb.h>
struct list kb_devices_list = STATIC_LIST_INIT(kb_devices_list);
void register_keyboard_device(struct kb_dev *kb)
{
list_add_tail(&kb_devices_list, &kb->node);
}
void register_keypress_handler(struct keypress_handler_elem *e)
{
struct kb_dev *kb;
list_for_each_ro(kb, &kb_devices_list, node) {
kb->register_handler(e);
}
}
u8 kb_get_current_modifiers(struct kb_dev *kb)
{
u8 shift = 1u * kb_is_shift_pressed(kb);
u8 alt = 2u * kb_is_alt_pressed(kb);
u8 ctrl = 4u * kb_is_ctrl_pressed(kb);
/*
* 0 nothing
* 1 shift
* 2 alt
* 3 shift + alt
* 4 ctrl
* 5 shift + ctrl
* 6 alt + ctrl
* 7 shift + alt + ctrl
*/
return shift + alt + ctrl;
}
/* NOTE: returns 0 if `key` not in [F1 ... F12] */
int kb_get_fn_key_pressed(u32 key)
{
/*
* We know that on the PC architecture, in the PS/2 set 1, keys F1-F12 have
* all a scancode long 1 byte.
*/
if (key >= 256)
return 0;
static const char fn_table[256] =
{
[KEY_F1] = 1,
[KEY_F2] = 2,
[KEY_F3] = 3,
[KEY_F4] = 4,
[KEY_F5] = 5,
[KEY_F6] = 6,
[KEY_F7] = 7,
[KEY_F8] = 8,
[KEY_F9] = 9,
[KEY_F10] = 10,
[KEY_F11] = 11,
[KEY_F12] = 12,
};
return fn_table[(u8) key];
}
| 710 |
515 | <reponame>jkjt/ezdxf
# Created: 30.04.2011, 2018 rewritten for pytest
# Copyright (C) 2011-2019, <NAME>
# License: MIT License
import pytest
from io import StringIO
from ezdxf.lldxf.tags import Tags, DXFTag
from ezdxf.lldxf.extendedtags import ExtendedTags
from ezdxf import DXFKeyError, DXFValueError
from ezdxf.lldxf.tagwriter import TagWriter
@pytest.fixture
def xtags1():
return ExtendedTags.from_text(XTAGS1)
def test_init_appdata(xtags1):
assert xtags1.get_app_data("{ACAD_XDICTIONARY") is not None
def test_init_with_tags():
tags = Tags.from_text(XTAGS1)
xtags = ExtendedTags(tags)
assert 3 == len(xtags.subclasses)
assert 1 == len(xtags.xdata)
def test_init_xdata(xtags1):
assert xtags1.get_xdata("RAK") is not None
def test_init_one_tag():
xtags = ExtendedTags([DXFTag(0, "SECTION")])
assert xtags.noclass[0] == (0, "SECTION")
def test_getitem(xtags1):
assert xtags1[0] == xtags1.noclass[0]
def test_appdata_content_count(xtags1):
xdict = xtags1.get_app_data("{ACAD_XDICTIONARY")
assert 3 == len(xdict)
def test_appdata_content(xtags1):
xdict = xtags1.get_app_data("{ACAD_XDICTIONARY")
assert xdict.get_first_value(360) == "63D5"
def test_tags_skips_appdata_content(xtags1):
with pytest.raises(DXFValueError):
xtags1.noclass.get_first_value(360)
def test_xdata_content_count(xtags1):
rak = xtags1.get_xdata("RAK")
assert 17 == len(rak)
def test_tags_skips_xdata_content(xtags1):
with pytest.raises(DXFValueError):
xtags1.noclass.get_first_value(1000)
def test_copy(xtags1):
stream = StringIO()
tagwriter = TagWriter(stream)
tagwriter.write_tags(xtags1)
assert XTAGS1 == stream.getvalue()
stream.close()
def test_getitem_layer(xtags1):
assert xtags1.noclass[0] == (0, "LAYER")
def test_getitem_xdict(xtags1):
assert xtags1.noclass[2] == (102, 0)
def test_getitem_parent(xtags1):
assert xtags1.noclass[3] == (330, "18")
def test_get_last_item(xtags1):
assert xtags1.noclass[-1] == (330, "18")
def test_tagscount(xtags1):
"""apdata counts as one tag and xdata counts as one tag."""
assert 4 == len(xtags1.noclass)
def test_subclass_AcDbSymbolTableRecord(xtags1):
subclass = xtags1.get_subclass("AcDbSymbolTableRecord")
assert 1 == len(subclass)
def test_subclass_AcDbLayerTableRecord(xtags1):
subclass = xtags1.get_subclass("AcDbLayerTableRecord")
assert 8 == len(subclass)
def test_clone_is_equal(xtags1):
clone = xtags1.clone()
assert xtags1 is not clone
assert xtags1.appdata is not clone.appdata
assert xtags1.subclasses is not clone.subclasses
assert xtags1.xdata is not clone.xdata
assert list(xtags1) == list(clone)
def test_replace_handle(xtags1):
xtags1.replace_handle("AA")
assert "AA" == xtags1.get_handle()
XTAGS1 = """ 0
LAYER
5
7
102
{ACAD_XDICTIONARY
360
63D5
102
}
330
18
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
0
70
0
62
7
6
CONTINUOUS
370
-3
390
8
347
805
1001
RAK
1000
{75-LÄNGENSCHNITT-14
1070
0
1070
7
1000
CONTINUOUS
1071
-3
1071
1
1005
8
1000
75-LÄNGENSCHNITT-14}
1000
{75-LÄNGENSCHNITT-2005
1070
0
1070
7
1000
CONTINUOUS
1071
-3
1071
1
1005
8
1000
75-LÄNGENSCHNITT-2005}
"""
@pytest.fixture
def xtags2():
return ExtendedTags.from_text(XTAGS2)
def test_xdata_count(xtags2):
assert 3 == len(xtags2.xdata)
def test_tags_count(xtags2):
"""3 xdata chunks and two 'normal' tag."""
assert 2 == len(xtags2.noclass)
def test_xdata3_tags(xtags2):
xdata = xtags2.get_xdata("XDATA3")
assert xdata[0] == (1001, "XDATA3")
assert xdata[1] == (1000, "TEXT-XDATA3")
assert xdata[2] == (1070, 2)
assert xdata[3] == (1070, 3)
def test_new_data(xtags2):
xtags2.new_xdata("NEWXDATA", [(1000, "TEXT")])
assert xtags2.has_xdata("NEWXDATA") is True
xdata = xtags2.get_xdata("NEWXDATA")
assert xdata[0] == (1001, "NEWXDATA")
assert xdata[1] == (1000, "TEXT")
def test_set_new_data(xtags2):
xtags2.new_xdata("NEWXDATA", tags=[(1000, "Extended Data String")])
assert xtags2.has_xdata("NEWXDATA") is True
xdata = xtags2.get_xdata("NEWXDATA")
assert (1001, "NEWXDATA") == xdata[0]
assert (1000, "Extended Data String") == xdata[1]
def test_append_xdata(xtags2):
xdata = xtags2.get_xdata("MOZMAN")
assert 4 == len(xdata)
xdata.append(DXFTag(1000, "Extended Data String"))
xdata = xtags2.get_xdata("MOZMAN")
assert 5 == len(xdata)
assert DXFTag(1000, "Extended Data String") == xdata[4]
XTAGS2 = """ 0
LAYER
5
7
1001
RAK
1000
TEXT-RAK
1070
1
1070
1
1001
MOZMAN
1000
TEXT-MOZMAN
1070
2
1070
2
1001
XDATA3
1000
TEXT-XDATA3
1070
2
1070
3
"""
@pytest.fixture
def xtags3():
return ExtendedTags.from_text(SPECIALCASE_TEXT)
def test_read_tags(xtags3):
subclass2 = xtags3.get_subclass("AcDbText")
assert (100, "AcDbText") == subclass2[0]
def test_read_tags_2(xtags3):
subclass2 = xtags3.get_subclass("AcDbText")
assert (100, "AcDbText") == subclass2[0]
assert (1, "Title:") == subclass2[3]
def test_read_tags_3(xtags3):
subclass2 = xtags3.get_subclass("AcDbText", 3)
assert (100, "AcDbText") == subclass2[0]
assert (73, 2) == subclass2[1]
def test_key_error(xtags3):
with pytest.raises(DXFKeyError):
xtags3.get_subclass("AcDbText", pos=4)
def test_skip_empty_subclass(xtags3):
xtags3.subclasses[1] = Tags() # create empty subclass
subclass2 = xtags3.get_subclass("AcDbText")
assert (100, "AcDbText") == subclass2[0]
SPECIALCASE_TEXT = """ 0
TEXT
5
8C9
330
6D
100
AcDbEntity
8
0
100
AcDbText
10
4.30
20
1.82
30
0.0
40
0.125
1
Title:
41
0.85
7
ARIALNARROW
100
AcDbText
73
2
"""
ACAD_REACTORS = "{ACAD_REACTORS"
@pytest.fixture
def xtags4():
return ExtendedTags.from_text(NO_REACTORS)
def test_get_not_existing_reactor(xtags4):
with pytest.raises(DXFValueError):
xtags4.get_app_data(ACAD_REACTORS)
def test_new_reactors(xtags4):
xtags4.new_app_data(ACAD_REACTORS)
assert (102, 0) == xtags4.noclass[
-1
] # code = 102, value = index in appdata list
def test_append_not_existing_reactors(xtags4):
xtags4.new_app_data(ACAD_REACTORS, [DXFTag(330, "DEAD")])
reactors = xtags4.get_app_data_content(ACAD_REACTORS)
assert 1 == len(reactors)
assert DXFTag(330, "DEAD") == reactors[0]
def test_append_to_existing_reactors(xtags4):
xtags4.new_app_data(ACAD_REACTORS, [DXFTag(330, "DEAD")])
reactors = xtags4.get_app_data_content(ACAD_REACTORS)
reactors.append(DXFTag(330, "DEAD2"))
xtags4.set_app_data_content(ACAD_REACTORS, reactors)
reactors = xtags4.get_app_data_content(ACAD_REACTORS)
assert DXFTag(330, "DEAD") == reactors[0]
assert DXFTag(330, "DEAD2") == reactors[1]
NO_REACTORS = """ 0
TEXT
5
8C9
330
6D
100
AcDbEntity
8
0
100
AcDbText
10
4.30
20
1.82
30
0.0
40
0.125
1
Title:
41
0.85
7
ARIALNARROW
"""
def test_legacy_mode():
"""Legacy mode does the same job as filter_subclass_markers()."""
tags = ExtendedTags.from_text(LEICA_DISTO_TAGS, legacy=True)
assert 9 == len(tags.noclass)
assert 1 == len(tags.subclasses)
assert tags.noclass[0] == (0, "LINE")
assert tags.noclass[1] == (8, "LEICA_DISTO_3D")
assert tags.noclass[-1] == (210, (0, 0, 1))
LEICA_DISTO_TAGS = """0
LINE
100
AcDbEntity
8
LEICA_DISTO_3D
62
256
6
ByLayer
5
75
100
AcDbLine
10
0.819021
20
-0.633955
30
-0.273577
11
0.753216
21
-0.582009
31
-0.276937
39
0
210
0
220
0
230
1
"""
def test_group_code_1000_outside_XDATA():
tags = ExtendedTags(Tags.from_text(BLOCKBASEPOINTPARAMETER_CVIL_3D_2018))
assert tags.dxftype() == "BLOCKBASEPOINTPARAMETER"
assert len(tags.subclasses) == 6
block_base_point_parameter = tags.get_subclass(
"AcDbBlockBasepointParameter"
)
assert len(block_base_point_parameter) == 3
assert block_base_point_parameter[0] == (100, "AcDbBlockBasepointParameter")
assert block_base_point_parameter[1] == (1011, (0.0, 0.0, 0.0))
assert block_base_point_parameter[2] == (1012, (0.0, 0.0, 0.0))
block_element = tags.get_subclass("AcDbBlockElement")
assert block_element[4] == (1071, 0)
stream = StringIO()
tagwriter = TagWriter(stream)
tagwriter.write_tags(tags)
lines = stream.getvalue()
stream.close()
assert len(lines.split("\n")) == len(
BLOCKBASEPOINTPARAMETER_CVIL_3D_2018.split("\n")
)
BLOCKBASEPOINTPARAMETER_CVIL_3D_2018 = """0
BLOCKBASEPOINTPARAMETER
5
4C25
330
4C23
100
AcDbEvalExpr
90
1
98
33
99
4
100
AcDbBlockElement
300
Base Point
98
33
99
4
1071
0
100
AcDbBlockParameter
280
1
281
0
100
AcDbBlock1PtParameter
1010
-3.108080399920343
1020
-0.9562299080084814
1030
0.0
93
0
170
0
171
0
100
AcDbBlockBasepointParameter
1011
0.0
1021
0.0
1031
0.0
1012
0.0
1022
0.0
1032
0.0
"""
def test_xrecord_with_group_code_102():
tags = ExtendedTags(Tags.from_text(XRECORD_WITH_GROUP_CODE_102))
assert tags.dxftype() == "XRECORD"
assert len(tags.appdata) == 1
assert tags.noclass[2] == (102, 0) # 0 == index in appdata list
assert tags.appdata[0][0] == (102, "{ACAD_REACTORS")
xrecord = tags.get_subclass("AcDbXrecord")
assert xrecord[2] == (102, "ACAD_ROUNDTRIP_PRE2007_TABLESTYLE")
assert len(list(tags)) * 2 + 1 == len(
XRECORD_WITH_GROUP_CODE_102.split("\n")
) # +1 == appending '\n'
XRECORD_WITH_GROUP_CODE_102 = """0
XRECORD
5
D9B071D01A0CB6A5
102
{ACAD_REACTORS
330
D9B071D01A0CB69D
102
}
330
D9B071D01A0CB69D
100
AcDbXrecord
280
1
102
ACAD_ROUNDTRIP_PRE2007_TABLESTYLE
90
4
91
0
1
92
4
93
0
2
94
4
95
0
3
"""
def test_xrecord_with_long_closing_tag():
tags = ExtendedTags(Tags.from_text(XRECORD_APP_DATA_LONG_CLOSING_TAG))
assert tags.dxftype() == "XRECORD"
# real app data just exists only in the base class, app data marker in AcDbXrecord are just tags, interpreted by
# the associated application
assert len(tags.appdata) == 1
assert len(tags.subclasses[1]) == 35
XRECORD_APP_DATA_LONG_CLOSING_TAG = """ 0
XRECORD
5
2F9
102
{ACAD_REACTORS
330
2FF
102
}
330
2FF
100
AcDbXrecord
280
1
1
AcDb_Thumbnail_Schema
102
{ATTRRECORD
341
2FA
102
USUAL_102_TAG_INSIDE_APP_DATA
2
AcDbDs::TreatedAsObjectData
280
1
291
1
102
ATTRRECORD}
102
USUAL_102_TAG_OUTSIDE_APP_DATA
102
{ATTRRECORD
341
2FB
2
AcDbDs::Legacy
280
1
291
1
102
ATTRRECORD}
2
AcDbDs::ID
280
10
91
8
102
{ATTRRECORD
341
2FC
2
AcDs:Indexable
280
1
291
1
102
ATTRRECORD}
102
{ATTRRECORD
341
2FD
2
AcDbDs::HandleAttribute
280
7
282
1
102
ATTRRECORD}
2
Thumbnail_Data
280
15
91
0
"""
| 4,910 |
1,602 | <gh_stars>1000+
#include "bswap.h"
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
static
void check(void* b, int len, char* match)
{
char* buf = (char*) b;
int i;
int v;
int m;
for( i = 0; i < len; i++ ) {
v = buf[i];
v &= 0xff;
m = match[i];
m &= 0xff;
printf("%02x ", v);
assert(v == m);
}
printf("\n");
}
static
int bswap_test(int n)
{
uint16_t a;
uint32_t b;
uint64_t c;
a = n;
a = htobe16(a);
check(&a, sizeof(a), "\x00\x01"); // print big-endian
a = be16toh(a);
assert(a == n);
a = n;
a = htole16(a);
check(&a, sizeof(a), "\x01\x00"); // print little-endian
a = le16toh(a);
assert(a == n);
b = n;
b = htobe32(n);
check(&b, sizeof(b), "\x00\x00\x00\x01"); // print big-endian
b = be32toh(b);
assert(b == n);
b = n;
b = htole32(n);
check(&b, sizeof(b), "\x01\x00\x00\x00"); // print little-endian
b = le32toh(b);
assert(b == n);
c = n;
c = htobe64(n);
check(&c, sizeof(c), "\x00\x00\x00\x00\x00\x00\x00\x01"); // print big-endian
c = be64toh(c);
assert(c == n);
c = htole64(n);
check(&c, sizeof(c), "\x01\x00\x00\x00\x00\x00\x00\x00"); // print little-endian
c = le64toh(c);
assert(c == n);
printf("bswap_test PASS\n");
return 0;
}
int main(int argc, char** argv)
{
// Pass in argc (which should be 1) just to
// prevent optimization from removing the tests from runtime.
return bswap_test(argc);
}
| 698 |
362 | <filename>scripts/docker_interactive.py<gh_stars>100-1000
"""
Example script for running a python program on a docker image.
Usage example:
python scripts/docker_interactive.py avi
"""
from __future__ import print_function
import argparse
import os
from os.path import abspath, dirname, realpath
import doodad as dd
import doodad.mount as mount
from mount_args import parse_args
def main(args):
mode = dd.mode.LocalDocker(image=args.image, gpu=True)
mount_points = [
# mount.MountLocal(
# local_dir=args.sac_dir,
# mount_point='/root/sac-plus',
# pythonpath=True),
# mount.MountLocal(
# local_dir=args.gym_dir,
# mount_point='/root/gym-larry',
# pythonpath=True),
# mount.MountLocal(
# local_dir=args.local_output_dir,
# mount_point='/mount/outputs',
# output=True),
mount.MountLocal(
local_dir=args.softlearning_dir,
mount_point='/root/softlearning',
pythonpath=True),
# mount.MountLocal(
# local_dir=args.gym_dir,
# mount_point='/root/gym-larry',
# pythonpath=True),
mount.MountLocal(
local_dir=args.local_output_dir,
mount_point='/root/ray_results',
output=True),
]
command = 'cd /root/softlearning'
#command += '; python -c \"import mujoco_py\"'
# if args.gpu is not None:
# command += '; export CUDA_VISIBLE_DEVICES={}'.format(args.gpu)
dd.launch_interactive(
mode=mode, command=command, mount_points=mount_points, verbose=False)
if __name__ == '__main__':
main(parse_args())
| 774 |
744 | <reponame>laowch/GithubTrends<filename>app/src/main/java/com/laowch/githubtrends/ui/AboutActivity.java
package com.laowch.githubtrends.ui;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.laowch.githubtrends.R;
/**
* Created by lao on 10/5/15.
*/
public class AboutActivity extends BaseActivity {
String aboutText = "It's a GitHub Trending repositories Viewer with Material Design.<br>" +
"https://github.com/trending";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
((TextView) findViewById(R.id.about)).setText(Html.fromHtml(aboutText));
final AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
}
| 379 |
552 | #pragma once
#include <glibmm/refptr.h>
#include <gtkmm/builder.h>
#include <gtkmm/fontbutton.h>
#include <gtkmm/flowbox.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/paned.h>
#include <gtkmm/searchentry.h>
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
#include <gtkmm/treemodelcolumn.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treeselection.h>
#include "AssetWidget.h"
#include "AssetTypeFilter.h"
namespace et { namespace core {
class Directory;
} }
namespace et {
namespace edit {
//---------------------------------
// ResourceView
//
// Widget that allows browsing for assets
//
class ResourceView : public AssetTypeFilter::I_Listener
{
public:
// definitions
//--------------------
class ModelColumns : public Gtk::TreeModelColumnRecord
{
public:
ModelColumns()
{
add(m_Name);
add(m_Directory);
}
Gtk::TreeModelColumn<Glib::ustring> m_Name;
Gtk::TreeModelColumn<core::Directory*> m_Directory;
};
typedef sigc::signal<void> T_SignalSelectionChanged;
// construct destruct
//--------------------
ResourceView();
void Init(std::vector<rttr::type> const& allowedTypes);
// accessors
//-----------
Gtk::Widget* GetAttachment() const { return m_Attachment; }
std::string const& GetSelectedDirectory() const { return m_SelectedDirectory; }
bool IsProjectSelected() const { return m_ProjectSelected; }
std::vector<AssetWidget*> const& GetSelectedAssets() const { return m_SelectedAssets; }
T_SignalSelectionChanged GetSelectionChangeSignal() const { return m_SignalSelectionChanged; }
Gtk::Box* GetToolbar() const { return m_Toolbar; }
Gtk::Widget* GetAssetArea() const { return m_AssetArea; }
// functionality
//---------------
void Rebuild();
private:
// events
//--------
void ResourceGroupToggled();
void OnDirectorySelectionChanged();
void OnSearchChanged();
void OnAssetTypeFilterChanged() override;
void OnSelectedChildrenChanged();
// utility
//---------
void RebuildDirectoryTree();
void RebuildAssetList();
Gtk::TreeModel::Row RecursiveGetDirectory(std::string const dir, Gtk::TreeModel::Children const& children) const;
// Data
/////////
Glib::RefPtr<Gtk::Builder> m_RefBuilder;
Gtk::Paned* m_Attachment = nullptr;
// resource view
Gtk::FlowBox* m_FlowBox = nullptr;
Gtk::Widget* m_AssetArea = nullptr;
// engine / project resources
Gtk::RadioButton* m_EngineButton = nullptr;
Gtk::RadioButton* m_ProjectButton = nullptr;
// Directory view
Gtk::TreeView* m_TreeView = nullptr;
ModelColumns m_Columns;
Glib::RefPtr<Gtk::TreeStore> m_TreeModel;
Glib::RefPtr<Gtk::TreeSelection> m_TreeSelection;
// results
bool m_ProjectSelected = true;
std::string m_SelectedDirectory;
core::Directory* m_BaseDirectory = nullptr;
std::vector<AssetWidget> m_FilteredAssets;
std::vector<AssetWidget*> m_SelectedAssets;
// toolbar
Gtk::Box* m_Toolbar = nullptr;
// filter
AssetTypeFilter m_TypeFilter;
// search
Gtk::SearchEntry* m_SearchBar = nullptr;
std::string m_SearchTerm;
T_SignalSelectionChanged m_SignalSelectionChanged;
};
} // namespace edit
} // namespace et
| 1,074 |
3,457 | Array3d v(8,27,64);
cout << v.pow(0.333333) << endl;
| 30 |
348 | {"nom":"<NAME>","circ":"12ème circonscription","dpt":"Nord","inscrits":3565,"abs":2044,"votants":1521,"blancs":23,"nuls":8,"exp":1490,"res":[{"nuance":"REM","nom":"Mme <NAME>","voix":438},{"nuance":"FN","nom":"<NAME>","voix":312},{"nuance":"LR","nom":"Mme <NAME>","voix":192},{"nuance":"FI","nom":"<NAME>","voix":164},{"nuance":"DVG","nom":"<NAME>","voix":141},{"nuance":"COM","nom":"<NAME>","voix":82},{"nuance":"ECO","nom":"Mme <NAME>","voix":41},{"nuance":"DIV","nom":"M. <NAME>","voix":32},{"nuance":"DVD","nom":"M. <NAME>","voix":32},{"nuance":"DVG","nom":"<NAME>","voix":22},{"nuance":"EXG","nom":"<NAME>","voix":20},{"nuance":"EXD","nom":"Mme <NAME>","voix":14}]} | 269 |
1,251 | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_RSNFA_RO_H_
#define _FA_RSNFA_RO_H_
#include "FAConfig.h"
#include "FARSNfaA.h"
#include "FAArray_cont_t.h"
#include "FANfaDelta_ro.h"
namespace BlingFire
{
class FAAllocatorA;
///
/// Read-only NFA container.
///
/// Note:
/// 1. Normally the object of this class is supposed to be loaded and used
/// and then cleared and reloaded and so on (but not modified).
/// 2. Transitions should be added in lexicographical order, see
/// FANfaDelta_ro.h for details, FAAutIOTools guarantee that.
///
class FARSNfa_ro : public FARSNfaA {
public:
FARSNfa_ro (FAAllocatorA * pAlloc);
virtual ~FARSNfa_ro ();
public:
const int GetMaxState () const;
const int GetMaxIw () const;
const int GetInitials (const int ** ppStates) const;
const int GetFinals (const int ** ppStates) const;
const bool IsFinal (const int State) const;
const bool IsFinal (const int * pStates, const int Count) const;
const int GetIWs (
const int State,
const int ** ppIws
) const;
const int GetDest (
const int State,
const int Iw,
const int ** ppIwDstStates
) const;
const int GetDest (
const int State,
const int Iw,
int * pDstStates,
const int MaxCount
) const;
public:
void SetMaxState (const int MaxState);
void SetMaxIw (const int MaxIw);
void Create ();
void SetTransition (
const int State,
const int Iw,
const int * pDstStates,
const int Count
);
void SetInitials (const int * pStates, const int Count);
void SetFinals (const int * pStates, const int Count);
void Prepare ();
void Clear ();
private:
void SetTransition (const int FromState, const int Iw, const int DstState);
private:
int m_MaxState;
int m_MaxIw;
FAArray_cont_t < int > m_initials;
FAArray_cont_t < int > m_finals;
FANfaDelta_ro m_delta;
};
}
#endif
| 961 |
1,444 | <reponame>J-VOL/mage
package mage.cards.e;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.players.Player;
import java.util.List;
import java.util.UUID;
/**
* @author L_J
*/
public final class ElvishImpersonators extends CardImpl {
public ElvishImpersonators(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.ELVES);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// As Elvish Impersonators enters the battlefield, roll a six-sided die twice. Its base power becomes the first result and its base toughness becomes the second result.
this.addAbility(new AsEntersBattlefieldAbility(new ElvishImpersonatorsEffect()));
}
private ElvishImpersonators(final ElvishImpersonators card) {
super(card);
}
@Override
public ElvishImpersonators copy() {
return new ElvishImpersonators(this);
}
}
class ElvishImpersonatorsEffect extends OneShotEffect {
public ElvishImpersonatorsEffect() {
super(Outcome.Neutral);
staticText = "roll a six-sided die twice. Its base power becomes the first result and its base toughness becomes the second result";
}
public ElvishImpersonatorsEffect(final ElvishImpersonatorsEffect effect) {
super(effect);
}
@Override
public ElvishImpersonatorsEffect copy() {
return new ElvishImpersonatorsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
List<Integer> results = controller.rollDice(outcome, source, game, 6, 2, 0);
int firstRoll = results.get(0);
int secondRoll = results.get(1);
game.addEffect(new SetPowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source);
return true;
}
return false;
}
}
| 858 |
5,169 | {
"name": "FuliLibraryForH5",
"version": "1.4.1",
"summary": "FuliLibraryForH5是纳德集团旗下薪起程赋力SDKForH5,主要用语于钱包H5与原生交互所用",
"description": "博纳德集团旗下薪起程赋力SDKForH5,主要用语于钱包H5与原生交互所用,博纳德集团旗下薪起程赋力SDKForH5,主要用语于钱包H5与原生交互所用",
"homepage": "https://github.com/wenwugithub/FuliLibraryForH5",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"<EMAIL>": "<EMAIL>"
},
"source": {
"git": "https://github.com/wenwugithub/FuliLibraryForH5.git",
"tag": "1.4.1"
},
"platforms": {
"ios": "9.0"
},
"source_files": "FuliLibraryForH5/Classes/**/*.{h,m,a,mm}",
"resources": "FuliLibraryForH5/Classes/PassGuard/*.bundle",
"resource_bundles": {
"FuliLibraryForH5": [
"FuliLibraryForH5/Assets/*.png"
]
},
"vendored_libraries": [
"FuliLibraryForH5/Classes/Unionpay/PayMentControl/libPaymentControl.a",
"FuliLibraryForH5/Classes/Unionpay/libPowerEnterUMSdebug.a",
"FuliLibraryForH5/Classes/Unionpay/libPowerEnterUMSrelease.a",
"FuliLibraryForH5/Classes/PassGuard/libPassGuardCtrl.a"
],
"libraries": [
"stdc++",
"c++",
"z.1.2.5",
"z"
],
"pod_target_xcconfig": {
"ENABLE_BITCODE": "NO",
"ENABLE_TESTABILITY": "NO",
"VALID_ARCHITECTURES": "x86_64"
},
"user_target_xcconfig": {
"ENABLE_BITCODE": "NO"
},
"xcconfig": {
"LD_RUNPATH_SEARCH_PATHS": "FuliLibraryForH5/Frameworks"
},
"public_header_files": [
"FuliLibraryForH5/Classes/Main/*.h",
"FuliLibraryForH5/Classes/Category/*.h",
"FuliLibraryForH5/Classes/CustomKeyboard/*.h",
"FuliLibraryForH5/Classes/MD5/*.h",
"FuliLibraryForH5/Classes/Unionpay/*.h",
"FuliLibraryForH5/Classes/*.h"
],
"static_framework": true,
"vendored_frameworks": "FuliLibraryForH5/Frameworks/Fupowerkey.framework",
"frameworks": "AudioToolbox",
"dependencies": {
"RSAEncryptor": [
],
"Masonry": [
],
"DateTools": [
],
"YYKit": [
],
"MBProgressHUD": [
],
"ReactiveObjC": [
],
"IQKeyboardManager": [
],
"SDWebImage": [
],
"XQCIDCard": [
]
}
}
| 1,136 |
672 | <gh_stars>100-1000
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "velox/expression/Expr.h"
#include "velox/expression/VectorFunction.h"
#include "velox/vector/DecodedVector.h"
namespace facebook::velox::functions {
namespace {
// Find the index of the first match for primitive types.
template <
TypeKind kind,
typename std::enable_if<TypeTraits<kind>::isPrimitiveType, int>::type = 0>
void applyTypedFirstMatch(
const SelectivityVector& rows,
DecodedVector& arrayDecoded,
const DecodedVector& elementsDecoded,
const DecodedVector& searchDecoded,
FlatVector<int64_t>& flatResult) {
using T = typename TypeTraits<kind>::NativeType;
auto baseArray = arrayDecoded.base()->as<ArrayVector>();
auto rawSizes = baseArray->rawSizes();
auto rawOffsets = baseArray->rawOffsets();
auto indices = arrayDecoded.indices();
rows.applyToSelected([&](auto row) {
auto size = rawSizes[indices[row]];
auto offset = rawOffsets[indices[row]];
auto search = searchDecoded.valueAt<T>(row);
int i;
for (i = 0; i < size; i++) {
if (!elementsDecoded.isNullAt(offset + i) &&
elementsDecoded.valueAt<T>(offset + i) == search) {
flatResult.set(row, i + 1);
break;
}
}
if (i == size) {
flatResult.set(row, 0);
}
});
}
// Find the index of the first match for complex types.
template <
TypeKind kind,
typename std::enable_if<!TypeTraits<kind>::isPrimitiveType, int>::type = 0>
void applyTypedFirstMatch(
const SelectivityVector& rows,
DecodedVector& arrayDecoded,
const DecodedVector& elementsDecoded,
DecodedVector& searchDecoded,
FlatVector<int64_t>& flatResult) {
auto baseArray = arrayDecoded.base()->as<ArrayVector>();
auto rawSizes = baseArray->rawSizes();
auto rawOffsets = baseArray->rawOffsets();
auto indices = arrayDecoded.indices();
auto elementsBase = elementsDecoded.base();
auto searchBase = searchDecoded.base();
auto searchIndices = searchDecoded.indices();
rows.applyToSelected([&](auto row) {
auto size = rawSizes[indices[row]];
auto offset = rawOffsets[indices[row]];
auto searchIndex = searchIndices[row];
int i;
for (i = 0; i < size; i++) {
if (!elementsBase->isNullAt(offset + i) &&
elementsBase->equalValueAt(searchBase, offset + i, searchIndex)) {
flatResult.set(row, i + 1);
break;
}
}
if (i == size) {
flatResult.set(row, 0);
}
});
}
// Find the index of the instance-th match for primitive types.
template <
TypeKind kind,
typename std::enable_if<TypeTraits<kind>::isPrimitiveType, int>::type = 0>
void applyTypedWithInstance(
const SelectivityVector& rows,
DecodedVector& arrayDecoded,
const DecodedVector& elementsDecoded,
const DecodedVector& searchDecoded,
const DecodedVector& instanceDecoded,
FlatVector<int64_t>& flatResult) {
using T = typename TypeTraits<kind>::NativeType;
auto baseArray = arrayDecoded.base()->as<ArrayVector>();
auto rawSizes = baseArray->rawSizes();
auto rawOffsets = baseArray->rawOffsets();
auto indices = arrayDecoded.indices();
rows.applyToSelected([&](auto row) {
auto size = rawSizes[indices[row]];
auto offset = rawOffsets[indices[row]];
auto search = searchDecoded.valueAt<T>(row);
auto instance = instanceDecoded.valueAt<int64_t>(row);
VELOX_USER_CHECK_NE(
instance,
0,
"array_position cannot take a 0-valued instance argument.");
int startIndex = instance > 0 ? 0 : size - 1;
int endIndex = instance > 0 ? size : -1;
int step = instance > 0 ? 1 : -1;
instance = std::abs(instance);
int i;
for (i = startIndex; i != endIndex; i += step) {
if (!elementsDecoded.isNullAt(offset + i) &&
elementsDecoded.valueAt<T>(offset + i) == search) {
--instance;
if (instance == 0) {
flatResult.set(row, i + 1);
break;
}
}
}
if (i == endIndex) {
flatResult.set(row, 0);
}
});
}
// Find the index of the instance-th match for complex types.
template <
TypeKind kind,
typename std::enable_if<!TypeTraits<kind>::isPrimitiveType, int>::type = 0>
void applyTypedWithInstance(
const SelectivityVector& rows,
DecodedVector& arrayDecoded,
const DecodedVector& elementsDecoded,
DecodedVector& searchDecoded,
const DecodedVector& instanceDecoded,
FlatVector<int64_t>& flatResult) {
auto baseArray = arrayDecoded.base()->as<ArrayVector>();
auto rawSizes = baseArray->rawSizes();
auto rawOffsets = baseArray->rawOffsets();
auto indices = arrayDecoded.indices();
auto elementsBase = elementsDecoded.base();
auto searchBase = searchDecoded.base();
auto searchIndices = searchDecoded.indices();
rows.applyToSelected([&](auto row) {
auto size = rawSizes[indices[row]];
auto offset = rawOffsets[indices[row]];
auto searchIndex = searchIndices[row];
auto instance = instanceDecoded.valueAt<int64_t>(row);
VELOX_USER_CHECK_NE(
instance,
0,
"array_position cannot take a 0-valued instance argument.");
int startIndex = instance > 0 ? 0 : size - 1;
int endIndex = instance > 0 ? size : -1;
int step = instance > 0 ? 1 : -1;
instance = std::abs(instance);
int i;
for (i = startIndex; i != endIndex; i += step) {
if (!elementsBase->isNullAt(offset + i) &&
elementsBase->equalValueAt(searchBase, offset + i, searchIndex)) {
--instance;
if (instance == 0) {
flatResult.set(row, i + 1);
break;
}
}
}
if (i == endIndex) {
flatResult.set(row, 0);
}
});
}
class ArrayPositionFunctionBasic : public exec::VectorFunction {
public:
void apply(
const SelectivityVector& rows,
std::vector<VectorPtr>& args,
const TypePtr& /* outputType */,
exec::EvalCtx* context,
VectorPtr* result) const override {
const auto& arrayVector = args[0];
const auto& searchVector = args[1];
VELOX_CHECK(arrayVector->type()->isArray());
VELOX_CHECK(arrayVector->type()->asArray().elementType()->kindEquals(
searchVector->type()));
BaseVector::ensureWritable(rows, BIGINT(), context->pool(), result);
auto flatResult = (*result)->asFlatVector<int64_t>();
exec::DecodedArgs decodedArgs(rows, args, context);
auto elements = decodedArgs.at(0)->base()->as<ArrayVector>()->elements();
exec::LocalSelectivityVector nestedRows(context, elements->size());
nestedRows.get()->setAll();
exec::LocalDecodedVector elementsHolder(
context, *elements, *nestedRows.get());
if (args.size() == 2) {
VELOX_DYNAMIC_TYPE_DISPATCH(
applyTypedFirstMatch,
searchVector->typeKind(),
rows,
*decodedArgs.at(0),
*elementsHolder.get(),
*decodedArgs.at(1),
*flatResult);
} else {
const auto& instanceVector = args[2];
VELOX_CHECK(instanceVector->type()->isBigint());
VELOX_DYNAMIC_TYPE_DISPATCH(
applyTypedWithInstance,
searchVector->typeKind(),
rows,
*decodedArgs.at(0),
*elementsHolder.get(),
*decodedArgs.at(1),
*decodedArgs.at(2),
*flatResult);
}
}
static std::vector<std::shared_ptr<exec::FunctionSignature>> signatures() {
return {// array(T), T -> int64_t
exec::FunctionSignatureBuilder()
.typeVariable("T")
.returnType("bigint")
.argumentType("array(T)")
.argumentType("T")
.build(),
// array(T), T, int64_t -> int64_t
exec::FunctionSignatureBuilder()
.typeVariable("T")
.returnType("bigint")
.argumentType("array(T)")
.argumentType("T")
.argumentType("bigint")
.build()};
}
};
} // namespace
} // namespace facebook::velox::functions
| 3,428 |
16,989 | /* gzjoin -- command to join gzip files into one gzip file
Copyright (C) 2004, 2005, 2012 <NAME>, all rights reserved
version 1.2, 14 Aug 2012
This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
<NAME> <EMAIL>
*/
/*
* Change history:
*
* 1.0 11 Dec 2004 - First version
* 1.1 12 Jun 2005 - Changed ssize_t to long for portability
* 1.2 14 Aug 2012 - Clean up for z_const usage
*/
/*
gzjoin takes one or more gzip files on the command line and writes out a
single gzip file that will uncompress to the concatenation of the
uncompressed data from the individual gzip files. gzjoin does this without
having to recompress any of the data and without having to calculate a new
crc32 for the concatenated uncompressed data. gzjoin does however have to
decompress all of the input data in order to find the bits in the compressed
data that need to be modified to concatenate the streams.
gzjoin does not do an integrity check on the input gzip files other than
checking the gzip header and decompressing the compressed data. They are
otherwise assumed to be complete and correct.
Each joint between gzip files removes at least 18 bytes of previous trailer
and subsequent header, and inserts an average of about three bytes to the
compressed data in order to connect the streams. The output gzip file
has a minimal ten-byte gzip header with no file name or modification time.
This program was written to illustrate the use of the Z_BLOCK option of
inflate() and the crc32_combine() function. gzjoin will not compile with
versions of zlib earlier than 1.2.3.
*/
#include <stdio.h> /* fputs(), fprintf(), fwrite(), putc() */
#include <stdlib.h> /* exit(), malloc(), free() */
#include <fcntl.h> /* open() */
#include <unistd.h> /* close(), read(), lseek() */
#include "zlib.h"
/* crc32(), crc32_combine(), inflateInit2(), inflate(), inflateEnd() */
#define local static
/* exit with an error (return a value to allow use in an expression) */
local int bail(char *why1, char *why2)
{
fprintf(stderr, "gzjoin error: %s%s, output incomplete\n", why1, why2);
exit(1);
return 0;
}
/* -- simple buffered file input with access to the buffer -- */
#define CHUNK 32768 /* must be a power of two and fit in unsigned */
/* bin buffered input file type */
typedef struct {
char *name; /* name of file for error messages */
int fd; /* file descriptor */
unsigned left; /* bytes remaining at next */
unsigned char *next; /* next byte to read */
unsigned char *buf; /* allocated buffer of length CHUNK */
} bin;
/* close a buffered file and free allocated memory */
local void bclose(bin *in)
{
if (in != NULL) {
if (in->fd != -1)
close(in->fd);
if (in->buf != NULL)
free(in->buf);
free(in);
}
}
/* open a buffered file for input, return a pointer to type bin, or NULL on
failure */
local bin *bopen(char *name)
{
bin *in;
in = malloc(sizeof(bin));
if (in == NULL)
return NULL;
in->buf = malloc(CHUNK);
in->fd = open(name, O_RDONLY, 0);
if (in->buf == NULL || in->fd == -1) {
bclose(in);
return NULL;
}
in->left = 0;
in->next = in->buf;
in->name = name;
return in;
}
/* load buffer from file, return -1 on read error, 0 or 1 on success, with
1 indicating that end-of-file was reached */
local int bload(bin *in)
{
long len;
if (in == NULL)
return -1;
if (in->left != 0)
return 0;
in->next = in->buf;
do {
len = (long)read(in->fd, in->buf + in->left, CHUNK - in->left);
if (len < 0)
return -1;
in->left += (unsigned)len;
} while (len != 0 && in->left < CHUNK);
return len == 0 ? 1 : 0;
}
/* get a byte from the file, bail if end of file */
#define bget(in) (in->left ? 0 : bload(in), \
in->left ? (in->left--, *(in->next)++) : \
bail("unexpected end of file on ", in->name))
/* get a four-byte little-endian unsigned integer from file */
local unsigned long bget4(bin *in)
{
unsigned long val;
val = bget(in);
val += (unsigned long)(bget(in)) << 8;
val += (unsigned long)(bget(in)) << 16;
val += (unsigned long)(bget(in)) << 24;
return val;
}
/* skip bytes in file */
local void bskip(bin *in, unsigned skip)
{
/* check pointer */
if (in == NULL)
return;
/* easy case -- skip bytes in buffer */
if (skip <= in->left) {
in->left -= skip;
in->next += skip;
return;
}
/* skip what's in buffer, discard buffer contents */
skip -= in->left;
in->left = 0;
/* seek past multiples of CHUNK bytes */
if (skip > CHUNK) {
unsigned left;
left = skip & (CHUNK - 1);
if (left == 0) {
/* exact number of chunks: seek all the way minus one byte to check
for end-of-file with a read */
lseek(in->fd, skip - 1, SEEK_CUR);
if (read(in->fd, in->buf, 1) != 1)
bail("unexpected end of file on ", in->name);
return;
}
/* skip the integral chunks, update skip with remainder */
lseek(in->fd, skip - left, SEEK_CUR);
skip = left;
}
/* read more input and skip remainder */
bload(in);
if (skip > in->left)
bail("unexpected end of file on ", in->name);
in->left -= skip;
in->next += skip;
}
/* -- end of buffered input functions -- */
/* skip the gzip header from file in */
local void gzhead(bin *in)
{
int flags;
/* verify gzip magic header and compression method */
if (bget(in) != 0x1f || bget(in) != 0x8b || bget(in) != 8)
bail(in->name, " is not a valid gzip file");
/* get and verify flags */
flags = bget(in);
if ((flags & 0xe0) != 0)
bail("unknown reserved bits set in ", in->name);
/* skip modification time, extra flags, and os */
bskip(in, 6);
/* skip extra field if present */
if (flags & 4) {
unsigned len;
len = bget(in);
len += (unsigned)(bget(in)) << 8;
bskip(in, len);
}
/* skip file name if present */
if (flags & 8)
while (bget(in) != 0)
;
/* skip comment if present */
if (flags & 16)
while (bget(in) != 0)
;
/* skip header crc if present */
if (flags & 2)
bskip(in, 2);
}
/* write a four-byte little-endian unsigned integer to out */
local void put4(unsigned long val, FILE *out)
{
putc(val & 0xff, out);
putc((val >> 8) & 0xff, out);
putc((val >> 16) & 0xff, out);
putc((val >> 24) & 0xff, out);
}
/* Load up zlib stream from buffered input, bail if end of file */
local void zpull(z_streamp strm, bin *in)
{
if (in->left == 0)
bload(in);
if (in->left == 0)
bail("unexpected end of file on ", in->name);
strm->avail_in = in->left;
strm->next_in = in->next;
}
/* Write header for gzip file to out and initialize trailer. */
local void gzinit(unsigned long *crc, unsigned long *tot, FILE *out)
{
fwrite("\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10, out);
*crc = crc32(0L, Z_NULL, 0);
*tot = 0;
}
/* Copy the compressed data from name, zeroing the last block bit of the last
block if clr is true, and adding empty blocks as needed to get to a byte
boundary. If clr is false, then the last block becomes the last block of
the output, and the gzip trailer is written. crc and tot maintains the
crc and length (modulo 2^32) of the output for the trailer. The resulting
gzip file is written to out. gzinit() must be called before the first call
of gzcopy() to write the gzip header and to initialize crc and tot. */
local void gzcopy(char *name, int clr, unsigned long *crc, unsigned long *tot,
FILE *out)
{
int ret; /* return value from zlib functions */
int pos; /* where the "last block" bit is in byte */
int last; /* true if processing the last block */
bin *in; /* buffered input file */
unsigned char *start; /* start of compressed data in buffer */
unsigned char *junk; /* buffer for uncompressed data -- discarded */
z_off_t len; /* length of uncompressed data (support > 4 GB) */
z_stream strm; /* zlib inflate stream */
/* open gzip file and skip header */
in = bopen(name);
if (in == NULL)
bail("could not open ", name);
gzhead(in);
/* allocate buffer for uncompressed data and initialize raw inflate
stream */
junk = malloc(CHUNK);
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = 0;
strm.next_in = Z_NULL;
ret = inflateInit2(&strm, -15);
if (junk == NULL || ret != Z_OK)
bail("out of memory", "");
/* inflate and copy compressed data, clear last-block bit if requested */
len = 0;
zpull(&strm, in);
start = in->next;
last = start[0] & 1;
if (last && clr)
start[0] &= ~1;
strm.avail_out = 0;
for (;;) {
/* if input used and output done, write used input and get more */
if (strm.avail_in == 0 && strm.avail_out != 0) {
fwrite(start, 1, strm.next_in - start, out);
start = in->buf;
in->left = 0;
zpull(&strm, in);
}
/* decompress -- return early when end-of-block reached */
strm.avail_out = CHUNK;
strm.next_out = junk;
ret = inflate(&strm, Z_BLOCK);
switch (ret) {
case Z_MEM_ERROR:
bail("out of memory", "");
case Z_DATA_ERROR:
bail("invalid compressed data in ", in->name);
}
/* update length of uncompressed data */
len += CHUNK - strm.avail_out;
/* check for block boundary (only get this when block copied out) */
if (strm.data_type & 128) {
/* if that was the last block, then done */
if (last)
break;
/* number of unused bits in last byte */
pos = strm.data_type & 7;
/* find the next last-block bit */
if (pos != 0) {
/* next last-block bit is in last used byte */
pos = 0x100 >> pos;
last = strm.next_in[-1] & pos;
if (last && clr)
in->buf[strm.next_in - in->buf - 1] &= ~pos;
}
else {
/* next last-block bit is in next unused byte */
if (strm.avail_in == 0) {
/* don't have that byte yet -- get it */
fwrite(start, 1, strm.next_in - start, out);
start = in->buf;
in->left = 0;
zpull(&strm, in);
}
last = strm.next_in[0] & 1;
if (last && clr)
in->buf[strm.next_in - in->buf] &= ~1;
}
}
}
/* update buffer with unused input */
in->left = strm.avail_in;
in->next = in->buf + (strm.next_in - in->buf);
/* copy used input, write empty blocks to get to byte boundary */
pos = strm.data_type & 7;
fwrite(start, 1, in->next - start - 1, out);
last = in->next[-1];
if (pos == 0 || !clr)
/* already at byte boundary, or last file: write last byte */
putc(last, out);
else {
/* append empty blocks to last byte */
last &= ((0x100 >> pos) - 1); /* assure unused bits are zero */
if (pos & 1) {
/* odd -- append an empty stored block */
putc(last, out);
if (pos == 1)
putc(0, out); /* two more bits in block header */
fwrite("\0\0\xff\xff", 1, 4, out);
}
else {
/* even -- append 1, 2, or 3 empty fixed blocks */
switch (pos) {
case 6:
putc(last | 8, out);
last = 0;
case 4:
putc(last | 0x20, out);
last = 0;
case 2:
putc(last | 0x80, out);
putc(0, out);
}
}
}
/* update crc and tot */
*crc = crc32_combine(*crc, bget4(in), len);
*tot += (unsigned long)len;
/* clean up */
inflateEnd(&strm);
free(junk);
bclose(in);
/* write trailer if this is the last gzip file */
if (!clr) {
put4(*crc, out);
put4(*tot, out);
}
}
/* join the gzip files on the command line, write result to stdout */
int main(int argc, char **argv)
{
unsigned long crc, tot; /* running crc and total uncompressed length */
/* skip command name */
argc--;
argv++;
/* show usage if no arguments */
if (argc == 0) {
fputs("gzjoin usage: gzjoin f1.gz [f2.gz [f3.gz ...]] > fjoin.gz\n",
stderr);
return 0;
}
/* join gzip files on command line and write to stdout */
gzinit(&crc, &tot, stdout);
while (argc--)
gzcopy(*argv++, argc, &crc, &tot, stdout);
/* done */
return 0;
}
| 6,040 |
537 | <filename>src/application/app_centernet.cpp<gh_stars>100-1000
#include <builder/trt_builder.hpp>
#include <infer/trt_infer.hpp>
#include <common/ilogger.hpp>
#include "app_centernet/centernet.hpp"
using namespace std;
static const char* cocolabels[] = {
"person", "bicycle", "car", "motorcycle", "airplane",
"bus", "train", "truck", "boat", "traffic light", "fire hydrant",
"stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse",
"sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack",
"umbrella", "handbag", "tie", "suitcase", "frisbee", "skis",
"snowboard", "sports ball", "kite", "baseball bat", "baseball glove",
"skateboard", "surfboard", "tennis racket", "bottle", "wine glass",
"cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich",
"orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake",
"chair", "couch", "potted plant", "bed", "dining table", "toilet", "tv",
"laptop", "mouse", "remote", "keyboard", "cell phone", "microwave",
"oven", "toaster", "sink", "refrigerator", "book", "clock", "vase",
"scissors", "teddy bear", "hair drier", "toothbrush"
};
bool requires(const char* name);
static void forward_engine(const string& engine_file){
auto engine = CenterNet::create_infer(engine_file, 0, 0.35f);
if(engine == nullptr){
INFOE("Engine is nullptr");
return;
}
string root = "CenterNet_result";
iLogger::rmtree(root);
iLogger::mkdir(root);
auto files = iLogger::find_files("inference", "*.jpg;*.jpeg;*.png;*.gif;*.tif");
vector<cv::Mat> images;
for(int i = 0; i < files.size(); ++i){
auto image = cv::imread(files[i]);
images.emplace_back(image);
}
// warmup
engine->commit(images[0]).get();
auto t0 = iLogger::timestamp_now_float();
auto boxes_array = engine->commits(images);
// wait batch result
boxes_array.back().get();
float inference_average_time = (iLogger::timestamp_now_float() - t0) / boxes_array.size();
for(int i = 0; i < boxes_array.size(); ++i){
auto& image = images[i];
auto boxes = boxes_array[i].get();
for(auto& obj : boxes){
uint8_t b, g, r;
tie(b, g, r) = iLogger::random_color(obj.class_label);
cv::rectangle(image, cv::Point(obj.left, obj.top), cv::Point(obj.right, obj.bottom), cv::Scalar(b, g, r), 5);
auto name = cocolabels[obj.class_label];
auto caption = iLogger::format("%s %.2f", name, obj.confidence);
int width = cv::getTextSize(caption, 0, 1, 1, nullptr).width;
cv::rectangle(image, cv::Point(obj.left-3, obj.top-33), cv::Point(obj.left + width-30, obj.top), cv::Scalar(b, g, r), -1);
cv::putText(image, caption, cv::Point(obj.left, obj.top-5), 0, 0.8, cv::Scalar::all(0), 2, 16);
}
string file_name = iLogger::file_name(files[i], false);
string save_path = iLogger::format("%s/%s.jpg", root.c_str(), file_name.c_str());
INFO("Save to %s, %d object, average time %.2f ms", save_path.c_str(), boxes.size(), inference_average_time);
cv::imwrite(save_path, image);
}
}
static void test(TRT::Mode mode, const string& model){
auto mode_name = TRT::mode_string(mode);
TRT::set_device(0);
const char* name = model.c_str();
INFO("===================== test %s %s ==================================", mode_name, name);
if(not requires(name))
return;
string onnx_file = iLogger::format("%s.onnx", name);
string model_file = iLogger::format("%s.%s.trtmodel", name, mode_name);
int test_batch_size = 16;
if(not iLogger::exists(model_file)){
TRT::compile(
mode, // FP32
test_batch_size, // max batch size
onnx_file, // source
model_file // save to
);
}
forward_engine(model_file);
}
int app_centernet(){
test(TRT::Mode::FP32, "centernet_r18_dcn"); // Type indicates the task. name string indicates the model size and structure.
return 0;
} | 1,866 |
1,738 | #ifndef CRYINCLUDE_EDITOR_CONTROLS_QROLLUPCTRL_H
#define CRYINCLUDE_EDITOR_CONTROLS_QROLLUPCTRL_H
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <QFrame>
#include <QScrollArea>
#include <QIcon>
class QVBoxLayout;
class QRollupCtrlButton;
class QRollupCtrl
: public QScrollArea
{
Q_OBJECT
Q_PROPERTY(int count READ count)
public:
explicit QRollupCtrl(QWidget* parent = 0);
~QRollupCtrl();
int addItem(QWidget* widget, const QString& text);
int addItem(QWidget* widget, const QIcon& icon, const QString& text);
int insertItem(int index, QWidget* widget, const QString& text);
int insertItem(int index, QWidget* widget, const QIcon& icon, const QString& text);
void clear();
void removeItem(QWidget* widget);
void removeItem(int index);
void setItemEnabled(int index, bool enabled);
bool isItemEnabled(int index) const;
void setItemText(int index, const QString& text);
QString itemText(int index) const;
void setItemIcon(int index, const QIcon& icon);
QIcon itemIcon(int index) const;
void setItemToolTip(int index, const QString& toolTip);
QString itemToolTip(int index) const;
QWidget* widget(int index) const;
int indexOf(QWidget* widget) const;
int count() const;
void readSettings (const QString& qSettingsGroup);
void writeSettings(const QString& qSettingsGroup);
public slots:
void setIndexVisible(int index, bool visible);
void setWidgetVisible(QWidget* widget, bool visible);
void expandAllPages(bool v);
protected:
virtual void itemInserted(int index);
virtual void itemRemoved(int index);
void changeEvent(QEvent*) override;
void showEvent(QShowEvent*) override;
private:
Q_DISABLE_COPY(QRollupCtrl)
struct Page
{
QRollupCtrlButton* button;
QFrame* sv;
QWidget* widget;
void setText(const QString& text);
void setIcon(const QIcon& is);
void setToolTip(const QString& tip);
QString text() const;
QIcon icon() const;
QString toolTip() const;
inline bool operator==(const Page& other) const
{
return widget == other.widget;
}
};
typedef QList<Page> PageList;
Page* page(QWidget* widget) const;
const Page* page(int index) const;
Page* page(int index);
void updateTabs();
void relayout();
bool isPageHidden(int index, QString& qObjectName) const;
QWidget* m_body;
PageList m_pageList;
QVBoxLayout* m_layout;
private slots:
void _q_buttonClicked();
void _q_widgetDestroyed(QObject*);
void _q_custumButtonMenu(const QPoint&);
};
//////////////////////////////////////////////////////////////////////////
inline int QRollupCtrl::addItem(QWidget* item, const QString& text)
{ return insertItem(-1, item, QIcon(), text); }
inline int QRollupCtrl::addItem(QWidget* item, const QIcon& iconSet, const QString& text)
{ return insertItem(-1, item, iconSet, text); }
inline int QRollupCtrl::insertItem(int index, QWidget* item, const QString& text)
{ return insertItem(index, item, QIcon(), text); }
#endif
| 1,296 |
7,892 | <reponame>joshrose/audacity
/* inverse.c -- compute the inverse of a sampled function */
/* CHANGE LOG
* --------------------------------------------------------------------
* 28Apr03 dm changes for portability and fix compiler warnings
*/
#include "stdio.h"
#ifndef mips
#include "stdlib.h"
#endif
#include "xlisp.h"
#include "sound.h"
#include "cext.h"
#include "falloc.h"
#include "inverse.h"
void inverse_free(snd_susp_type a_susp);
typedef struct inverse_susp_struct {
snd_susp_node susp;
int64_t terminate_cnt;
boolean logically_stopped;
sound_type s;
int s_cnt;
sample_block_values_type s_ptr;
double s_prev;
double s_time;
double s_time_increment;
double out_time_increment;
boolean started;
} inverse_susp_node, *inverse_susp_type;
void inverse_fetch(snd_susp_type a_susp, snd_list_type snd_list)
{
inverse_susp_type susp = (inverse_susp_type) a_susp;
int cnt = 0; /* how many samples read from s */
int out_cnt = 0; /* how many samples output */
int togo = 0; /* how many more to read from s in inner loop */
int n;
sample_block_type out;
double out_time = susp->susp.current * susp->out_time_increment;
register sample_block_values_type out_ptr;
register sample_block_values_type s_ptr_reg;
falloc_sample_block(out, "inverse_fetch");
out_ptr = out->samples;
snd_list->block = out;
/* make sure we are primed with first value */
/* This is a lot of work just to prefetch susp->s_prev! */
if (!susp->started) {
susp->started = true;
/* see comments below about susp_check_term_log_samples() */
if (susp->s_cnt == 0) {
susp_get_samples(s, s_ptr, s_cnt);
if (susp->s_ptr == zero_block->samples) {
susp->terminate_cnt = susp->susp.current;
}
}
susp->s_prev = susp_fetch_sample(s, s_ptr, s_cnt);
}
while (out_cnt < max_sample_block_len) { /* outer loop */
/* first compute how many samples to generate in inner loop: */
/* don't run past the s input sample block: */
/* most fetch routines call susp_check_term_log_samples() here
* but we can't becasue susp_check_term_log_samples() assumes
* that output time progresses at the same rate as input time.
* Here, some time warping is going on, so this doesn't work.
* Instead, check for termination of s and fix terminate_cnt to
* be the current output count rather than the current input time.
*/
if (susp->s_cnt == 0) {
susp_get_samples(s, s_ptr, s_cnt);
if (susp->s_ptr == zero_block->samples) {
susp->terminate_cnt = susp->susp.current + out_cnt;
/* we can't simply terminate here because we might have
* some output samples computed already, in which case we
* want to return them now and terminate the NEXT time we're
* called.
*/
}
}
togo = susp->s_cnt;
/* if we ran past terminate time, fix up output */
if (susp->terminate_cnt != UNKNOWN &&
susp->terminate_cnt <= susp->susp.current + out_cnt) {
/* pretend like we computed the correct number of samples */
togo = 0;
out_cnt = (long) (susp->terminate_cnt - susp->susp.current);
/* exit the loop to complete the termination */
break;
}
n = togo;
s_ptr_reg = susp->s_ptr;
if (n) do { /* the inner sample computation loop */
/* scan s_ptr_reg to time t, output and loop */
register double next_value = *s_ptr_reg++;
while (out_time < next_value) {
*out_ptr++ = (float) (susp->s_time +
(out_time - susp->s_prev) /
(susp->s->sr * (next_value - susp->s_prev)));
out_time += susp->out_time_increment;
if (++out_cnt >= max_sample_block_len) goto output_full;
}
susp->s_prev = next_value;
susp->s_time += susp->s_time_increment;
} while (--n); /* inner loop */
output_full:
/* using s_ptr_reg is a bad idea on RS/6000: */
susp->s_ptr += (togo - n);
susp_took(s_cnt, (togo - n));
cnt += (togo - n);
} /* outer loop */
/* test for termination */
if (togo == 0 && out_cnt == 0) {
snd_list_terminate(snd_list);
} else {
snd_list->block_len = out_cnt;
susp->susp.current += out_cnt;
}
} /* inverse_fetch */
void inverse_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list)
{
inverse_susp_type susp = (inverse_susp_type) a_susp;
int64_t final_count = MIN(susp->susp.current + max_sample_block_len,
susp->susp.toss_cnt);
time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
long n;
/* fetch samples from s up to final_time for this block of zeros */
while (((long) ((final_time - susp->s->t0) * susp->s->sr + 0.5)) >=
susp->s->current)
susp_get_samples(s, s_ptr, s_cnt);
/* convert to normal processing when we hit final_count */
/* we want each signal positioned at final_time */
if (final_count == susp->susp.toss_cnt) {
n = (long) ROUNDBIG((final_time - susp->s->t0) * susp->s->sr -
(susp->s->current - susp->s_cnt));
susp->s_ptr += n;
susp_took(s_cnt, n);
susp->susp.fetch = susp->susp.keep_fetch;
}
snd_list->block_len = (short) (final_count - susp->susp.current);
susp->susp.current = final_count;
snd_list->u.next = snd_list_create((snd_susp_type) susp);
snd_list->block = internal_zero_block;
}
void inverse_mark(snd_susp_type a_susp)
{
inverse_susp_type susp = (inverse_susp_type) a_susp;
sound_xlmark(susp->s);
}
void inverse_free(snd_susp_type a_susp)
{
inverse_susp_type susp = (inverse_susp_type) a_susp;
sound_unref(susp->s);
ffree_generic(susp, sizeof(inverse_susp_node), "inverse_free");
}
void inverse_print_tree(snd_susp_type a_susp, int n)
{
inverse_susp_type susp = (inverse_susp_type) a_susp;
indent(n);
stdputstr("s:");
sound_print_tree_1(susp->s, n);
}
sound_type snd_make_inverse(sound_type s, time_type t0, rate_type sr)
{
register inverse_susp_type susp;
falloc_generic(susp, inverse_susp_node, "snd_make_inverse");
susp->susp.fetch = inverse_fetch;
susp->terminate_cnt = UNKNOWN;
/* initialize susp state */
susp->susp.free = inverse_free;
susp->susp.sr = sr;
susp->susp.t0 = t0;
susp->susp.mark = inverse_mark;
susp->susp.print_tree = inverse_print_tree;
susp->susp.name = "inverse";
susp->logically_stopped = false;
susp->susp.log_stop_cnt = UNKNOWN; /* log stop time = term time */
susp->susp.current = 0;
susp->s = s;
susp->s_cnt = 0;
susp->s_prev = 0;
susp->s_time = 0;
susp->s_time_increment = 1 / s->sr;
susp->out_time_increment = 1 / (sr * s->scale);
susp->started = false;
return sound_create((snd_susp_type)susp, t0, sr, 1.0 /* scale */);
}
sound_type snd_inverse(sound_type s, time_type t0, rate_type sr)
{
sound_type s_copy = sound_copy(s);
return snd_make_inverse(s_copy, t0, sr);
}
| 3,300 |
668 | <gh_stars>100-1000
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests.bulkimport.populator.client;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.io.IOException;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants;
import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.OfficeHelper;
import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ClientEntityWorkbookPopulatorTest {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().build();
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
}
@Test
public void testClientEntityWorkbookPopulate() throws IOException {
// in order to populate helper sheets
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec, responseSpec);
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
// in order to populate helper sheets
OfficeHelper officeHelper = new OfficeHelper(requestSpec, responseSpec);
Integer outcome_office_creation = officeHelper.createOffice("02 May 2000");
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
Workbook workbook = clientHelper.getClientEntityWorkbook(GlobalEntityType.CLIENTS_ENTTTY, "dd MMMM yyyy");
Sheet officeSheet = workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
Row firstOfficeRow = officeSheet.getRow(1);
Assertions.assertNotNull(firstOfficeRow.getCell(1), "No offices found for given OfficeId ");
Sheet staffSheet = workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME);
Row firstStaffRow = staffSheet.getRow(1);
Assertions.assertNotNull(firstStaffRow.getCell(1), "No staff found for given staffId");
}
}
| 1,181 |
534 | package mekanism.common.lib.distribution;
import mekanism.common.lib.distribution.target.IntegerTarget;
import mekanism.common.util.EmitUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.quicktheories.QuickTheory;
import org.quicktheories.WithQuickTheories;
import org.quicktheories.core.Gen;
import org.quicktheories.dsl.TheoryBuilder2;
import org.quicktheories.impl.Constraint;
@DisplayName("Property based testing of distribution via EmitUtils")
class DistributionPropertyTest implements WithQuickTheories {
private Gen<IntegerTarget> createTargets(int minInfinite, int maxInfinite, int minSome, int maxSome, int minNone, int maxNone) {
Constraint infiniteConstraint = Constraint.between(minInfinite, maxInfinite).withShrinkPoint(0);
Constraint someConstraint = Constraint.between(minSome, maxSome).withShrinkPoint(0);
Constraint noneConstraint = Constraint.between(minNone, maxNone).withShrinkPoint(0);
//Given random generator create integer target using the three constraints we defined above
return prng -> DistributionTest.getTargets((int) prng.next(infiniteConstraint), (int) prng.next(someConstraint), (int) prng.next(noneConstraint));
}
private TheoryBuilder2<IntegerTarget, Integer> distributionTheory(int minInfinite, int maxInfinite, int minSome, int maxSome, int minNone, int maxNone) {
return qt().forAll(createTargets(minInfinite, maxInfinite, minSome, maxSome, minNone, maxNone), integers().allPositive());
}
@Override
public QuickTheory qt() {
//Force our example count to be higher than the default by 100x
return WithQuickTheories.super.qt().withExamples(100_000);
}
@Test
@DisplayName("Test distribution")
void testDistribution() {
distributionTheory(0, 100, 0, 100, 0, 100).check((availableAcceptors, toSend) ->
EmitUtils.sendToAcceptors(availableAcceptors, toSend, toSend) <= toSend
);
}
@Test
@DisplayName("Test distribution no partial")
void testDistributionNoPartial() {
distributionTheory(0, 100, 0, 0, 0, 100).check((availableAcceptors, toSend) ->
EmitUtils.sendToAcceptors(availableAcceptors, toSend, toSend) <= toSend
);
}
@Test
@DisplayName("Test distribution no infinite")
void testDistributionNoInfinite() {
distributionTheory(0, 0, 0, 100, 0, 100).check((availableAcceptors, toSend) ->
EmitUtils.sendToAcceptors(availableAcceptors, toSend, toSend) <= toSend
);
}
} | 922 |
575 | <gh_stars>100-1000
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sharing/sharing_service_proxy_android.h"
#include "base/android/callback_android.h"
#include "base/android/jni_string.h"
#include "base/time/time.h"
#include "chrome/android/chrome_jni_headers/SharingServiceProxy_jni.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/sharing/features.h"
#include "chrome/browser/sharing/sharing_device_source.h"
#include "chrome/browser/sharing/sharing_metrics.h"
#include "chrome/browser/sharing/sharing_send_message_result.h"
#include "chrome/browser/sharing/sharing_service.h"
#include "chrome/browser/sharing/sharing_service_factory.h"
#include "components/sync_device_info/device_info.h"
void JNI_SharingServiceProxy_InitSharingService(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& j_profile) {
SharingService* service = SharingServiceFactory::GetForBrowserContext(
ProfileAndroid::FromProfileAndroid(j_profile));
DCHECK(service);
}
SharingServiceProxyAndroid::SharingServiceProxyAndroid(
SharingService* sharing_service)
: sharing_service_(sharing_service) {
DCHECK(sharing_service_);
JNIEnv* env = base::android::AttachCurrentThread();
Java_SharingServiceProxy_onProxyCreated(env,
reinterpret_cast<intptr_t>(this));
}
SharingServiceProxyAndroid::~SharingServiceProxyAndroid() {
JNIEnv* env = base::android::AttachCurrentThread();
Java_SharingServiceProxy_onProxyDestroyed(env);
}
void SharingServiceProxyAndroid::SendSharedClipboardMessage(
JNIEnv* env,
const base::android::JavaParamRef<jstring>& j_guid,
const base::android::JavaParamRef<jstring>& j_text,
const base::android::JavaParamRef<jobject>& j_runnable) {
auto callback =
base::BindOnce(base::android::RunIntCallbackAndroid,
base::android::ScopedJavaGlobalRef<jobject>(j_runnable));
std::string guid = base::android::ConvertJavaStringToUTF8(env, j_guid);
DCHECK(!guid.empty());
std::unique_ptr<syncer::DeviceInfo> device =
sharing_service_->GetDeviceByGuid(guid);
if (!device) {
std::move(callback).Run(
static_cast<int>(SharingSendMessageResult::kDeviceNotFound));
return;
}
std::string text = base::android::ConvertJavaStringToUTF8(env, j_text);
chrome_browser_sharing::SharingMessage sharing_message;
sharing_message.mutable_shared_clipboard_message()->set_text(std::move(text));
sharing_service_->SendMessageToDevice(
*device, base::TimeDelta::FromSeconds(kSharingMessageTTLSeconds.Get()),
std::move(sharing_message),
base::BindOnce(
[](base::OnceCallback<void(int)> callback,
SharingSendMessageResult result,
std::unique_ptr<chrome_browser_sharing::ResponseMessage>
response) {
std::move(callback).Run(static_cast<int>(result));
},
std::move(callback)));
}
void SharingServiceProxyAndroid::GetDeviceCandidates(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& j_device_info,
jint j_required_feature) {
auto device_candidates = sharing_service_->GetDeviceCandidates(
static_cast<sync_pb::SharingSpecificFields::EnabledFeatures>(
j_required_feature));
for (const auto& device_info : device_candidates) {
Java_SharingServiceProxy_createDeviceInfoAndAppendToList(
env, j_device_info,
base::android::ConvertUTF8ToJavaString(env, device_info->guid()),
base::android::ConvertUTF8ToJavaString(env, device_info->client_name()),
device_info->device_type(),
device_info->last_updated_timestamp().ToJavaTime());
}
}
void SharingServiceProxyAndroid::AddDeviceCandidatesInitializedObserver(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& j_runnable) {
sharing_service_->GetDeviceSource()->AddReadyCallback(
base::BindOnce(base::android::RunRunnableAndroid,
base::android::ScopedJavaGlobalRef<jobject>(j_runnable)));
}
| 1,546 |
746 | <reponame>tomassatka/OpenLineage
package io.openlineage.spark.agent;
import static org.assertj.core.api.Assertions.assertThat;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.openlineage.client.OpenLineage;
import io.openlineage.spark.agent.client.OpenLineageClient;
import io.openlineage.spark.agent.lifecycle.MatchesMapRecursively;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.ZonedDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.junit.jupiter.api.Test;
public class OpenLineageRunEventTest {
private final TypeReference<Map<String, Object>> mapTypeReference =
new TypeReference<Map<String, Object>>() {};
@Test
public void testSerializeRunEvent() throws IOException {
ObjectMapper mapper = OpenLineageClient.createMapper();
ZonedDateTime dateTime = ZonedDateTime.parse("2021-01-01T00:00:01.000000000+02:00[UTC]");
OpenLineage ol = new OpenLineage(OpenLineageClient.OPEN_LINEAGE_CLIENT_URI);
UUID runId = UUID.fromString("5f24c93c-2ce9-49dc-82e7-95ab4915242f");
OpenLineage.RunFacets runFacets =
ol.newRunFacets(
ol.newParentRunFacet(
ol.newParentRunFacetRun(runId), ol.newParentRunFacetJob("namespace", "jobName")),
null);
OpenLineage.Run run = ol.newRun(runId, runFacets);
OpenLineage.DocumentationJobFacet documentationJobFacet =
ol.newDocumentationJobFacetBuilder().description("test documentation").build();
OpenLineage.SourceCodeLocationJobFacet sourceCodeLocationJobFacet =
ol.newSourceCodeLocationJobFacetBuilder()
.branch("branch")
.path("/path/to/file")
.repoUrl("https://github.com/apache/spark")
.type("git")
.version("v1")
.url(URI.create("https://github.com/apache/spark"))
.tag("v1.0.0")
.build();
OpenLineage.SQLJobFacet sqlJobFacet = ol.newSQLJobFacet("SELECT * FROM test");
OpenLineage.JobFacets jobFacets =
ol.newJobFacets(sourceCodeLocationJobFacet, sqlJobFacet, documentationJobFacet);
OpenLineage.Job job = ol.newJob("namespace", "jobName", jobFacets);
List<OpenLineage.InputDataset> inputs =
Arrays.asList(
ol.newInputDataset(
"ins",
"input",
null,
ol.newInputDatasetInputFacetsBuilder()
.dataQualityMetrics(
ol.newDataQualityMetricsInputDatasetFacetBuilder()
.rowCount(10L)
.bytes(20L)
.columnMetrics(
ol.newDataQualityMetricsInputDatasetFacetColumnMetricsBuilder()
.put(
"mycol",
ol.newDataQualityMetricsInputDatasetFacetColumnMetricsAdditionalBuilder()
.count(10D)
.distinctCount(10L)
.max(30D)
.min(5D)
.nullCount(1L)
.sum(3000D)
.quantiles(
ol.newDataQualityMetricsInputDatasetFacetColumnMetricsAdditionalQuantilesBuilder()
.put("25", 52D)
.build())
.build())
.build())
.build())
.build()));
List<OpenLineage.OutputDataset> outputs =
Arrays.asList(
ol.newOutputDataset(
"ons",
"output",
null,
ol.newOutputDatasetOutputFacetsBuilder()
.outputStatistics(ol.newOutputStatisticsOutputDatasetFacet(10L, 20L))
.build()));
OpenLineage.RunEvent runStateUpdate =
ol.newRunEvent("START", dateTime, run, job, inputs, outputs);
Map<String, Object> actualJson =
mapper.readValue(mapper.writeValueAsString(runStateUpdate), mapTypeReference);
Path expectedDataPath =
Paths.get("src", "test", "resources", "test_data", "serde", "openlineage-event.json");
Map<String, Object> expectedJson =
mapper.readValue(expectedDataPath.toFile(), mapTypeReference);
assertThat(actualJson).satisfies(new MatchesMapRecursively(expectedJson));
}
}
| 2,502 |
1,305 | /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.management;
/**
* Represents runtime exceptions thrown by MBean methods in
* the agent. It "wraps" the actual <CODE>java.lang.RuntimeException</CODE> exception thrown.
* This exception will be built by the MBeanServer when a call to an
* MBean method throws a runtime exception.
*
* @since 1.5
*/
public class RuntimeMBeanException extends JMRuntimeException {
/* Serial version */
private static final long serialVersionUID = 5274912751982730171L;
/**
* @serial The encapsulated {@link RuntimeException}
*/
private java.lang.RuntimeException runtimeException ;
/**
* Creates a <CODE>RuntimeMBeanException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE>.
*
* @param e the wrapped exception.
*/
public RuntimeMBeanException(java.lang.RuntimeException e) {
super() ;
runtimeException = e ;
}
/**
* Creates a <CODE>RuntimeMBeanException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE> with
* a detailed message.
*
* @param e the wrapped exception.
* @param message the detail message.
*/
public RuntimeMBeanException(java.lang.RuntimeException e, String message) {
super(message) ;
runtimeException = e ;
}
/**
* Returns the actual {@link RuntimeException} thrown.
*
* @return the wrapped {@link RuntimeException}.
*/
public java.lang.RuntimeException getTargetException() {
return runtimeException ;
}
/**
* Returns the actual {@link RuntimeException} thrown.
*
* @return the wrapped {@link RuntimeException}.
*/
public Throwable getCause() {
return runtimeException;
}
}
| 702 |
1,540 | package test.configuration;
import static org.assertj.core.api.Assertions.assertThat;
import org.testng.TestNG;
import org.testng.annotations.Test;
import test.SimpleBaseTest;
public class SuiteFactoryOnceTest extends SimpleBaseTest {
@Test
public void suiteMethodsShouldOnlyRunOnce() {
TestNG tng = create(SuiteFactoryOnceSample2Test.class);
SuiteFactoryOnceSample1Test.m_before = 0;
SuiteFactoryOnceSample1Test.m_after = 0;
tng.run();
assertThat(SuiteFactoryOnceSample1Test.m_before).isEqualTo(1);
assertThat(SuiteFactoryOnceSample1Test.m_after).isEqualTo(1);
}
}
| 208 |
16,461 | <reponame>rudylee/expo
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import "RNCConnectionState.h"
NS_ASSUME_NONNULL_BEGIN
@class RNCConnectionStateWatcher;
@protocol RNCConnectionStateWatcherDelegate
- (void)connectionStateWatcher:(RNCConnectionStateWatcher *)connectionStateWatcher didUpdateState:(RNCConnectionState *)state;
@end
@interface RNCConnectionStateWatcher : NSObject
- (instancetype)initWithDelegate:(id<RNCConnectionStateWatcherDelegate>)delegate;
- (RNCConnectionState *)currentState;
@end
NS_ASSUME_NONNULL_END
| 224 |
368 | <gh_stars>100-1000
/**
* @file file_reader.h
* @brief 读文件Wrapper类
* @author xiangwangfeng <<EMAIL>>
* @data 2011-4-27
* @website www.xiangwangfeng.com
*/
#pragma once
#include <xstring>
#include "global_defs.h"
NAMESPACE_BEGIN(Util)
//读文件Wrapper类
class FileReader
{
public:
FileReader(const std::wstring& filepath);
~FileReader();
public:
bool open();
int read(char* buffer,size_t length);
void close();
private:
std::wstring _filepath; //文件路径
bool _ready; //是否准备完毕
FILE* _file; //文件指针
};
NAMESPACE_END(Util) | 287 |
1,682 | /*
Copyright (c) 2012 LinkedIn Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.linkedin.restli.examples;
import com.linkedin.data.DataMap;
import com.linkedin.r2.RemoteInvocationException;
import com.linkedin.restli.client.ActionRequest;
import com.linkedin.restli.client.ActionRequestBuilder;
import com.linkedin.restli.client.BatchCreateIdRequest;
import com.linkedin.restli.client.ErrorHandlingBehavior;
import com.linkedin.restli.client.Request;
import com.linkedin.restli.client.Response;
import com.linkedin.restli.client.ResponseFuture;
import com.linkedin.restli.client.RestLiResponseException;
import com.linkedin.restli.client.RestliRequestOptions;
import com.linkedin.restli.common.BatchCreateIdResponse;
import com.linkedin.restli.common.BatchResponse;
import com.linkedin.restli.common.CollectionResponse;
import com.linkedin.restli.common.CreateIdStatus;
import com.linkedin.restli.common.CreateStatus;
import com.linkedin.restli.common.EmptyRecord;
import com.linkedin.restli.common.ErrorResponse;
import com.linkedin.restli.common.HttpStatus;
import com.linkedin.restli.common.RestConstants;
import com.linkedin.restli.examples.greetings.api.Greeting;
import com.linkedin.restli.examples.greetings.api.Tone;
import com.linkedin.restli.examples.greetings.client.ExceptionsBuilders;
import com.linkedin.restli.examples.greetings.client.ExceptionsRequestBuilders;
import com.linkedin.restli.examples.greetings.server.ExceptionsResource;
import com.linkedin.restli.internal.common.ProtocolVersionUtil;
import com.linkedin.restli.internal.server.util.DataMapUtils;
import com.linkedin.restli.server.ErrorResponseFormat;
import com.linkedin.restli.test.util.RootBuilderWrapper;
import java.io.IOException;
import java.util.List;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/**
* Integration tests for {@link ExceptionsResource}.
*/
public class TestExceptionsResource extends RestLiIntegrationTest
{
@BeforeClass
public void initClass() throws Exception
{
super.init();
}
@AfterClass
public void shutDown() throws Exception
{
super.shutdown();
}
@SuppressWarnings("deprecation")
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "exceptionHandlingModesDataProvider")
public void testException(boolean explicit, ErrorHandlingBehavior errorHandlingBehavior, RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException
{
Response<Greeting> response = null;
RestLiResponseException exception = null;
try
{
Request<Greeting> readRequest = builders.get().id(1L).build();
ResponseFuture<Greeting> future;
if (explicit)
{
future = getClient().sendRequest(readRequest, errorHandlingBehavior);
}
else
{
future = getClient().sendRequest(readRequest);
}
response = future.getResponse();
if (!explicit || errorHandlingBehavior == ErrorHandlingBehavior.FAIL_ON_ERROR)
{
Assert.fail("expected exception");
}
}
catch (RestLiResponseException e)
{
if (!explicit || errorHandlingBehavior == ErrorHandlingBehavior.FAIL_ON_ERROR)
{
exception = e;
}
else
{
Assert.fail("not expected exception");
}
}
if (explicit && errorHandlingBehavior == ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS)
{
Assert.assertNotNull(response);
Assert.assertTrue(response.hasError());
exception = response.getError();
Assert.assertEquals(response.getStatus(), HttpStatus.S_500_INTERNAL_SERVER_ERROR.getCode());
Assert.assertNull(response.getEntity());
}
Assert.assertNotNull(exception);
Assert.assertFalse(exception.hasDecodedResponse());
Assert.assertEquals(exception.getStatus(), HttpStatus.S_500_INTERNAL_SERVER_ERROR.getCode());
Assert.assertEquals(exception.getServiceErrorCode(), 42);
Assert.assertEquals(exception.getServiceErrorMessage(), "error processing request");
Assert.assertTrue(exception.getServiceErrorStackTrace().contains("at com.linkedin.restli.examples.greetings.server.ExceptionsResource.get("));
Assert.assertEquals(exception.getCode(), "PROCESSING_ERROR");
Assert.assertEquals(exception.getDocUrl(), "https://example.com/errors/processing-error");
Assert.assertEquals(exception.getRequestId(), "xyz123");
Assert.assertEquals(exception.getErrorDetailType(), Greeting.class.getCanonicalName());
}
@SuppressWarnings("deprecation")
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "exceptionHandlingModesDataProvider")
public void testCreateError(boolean explicit, ErrorHandlingBehavior errorHandlingBehavior, RootBuilderWrapper<Long, Greeting> builders) throws Exception
{
Response<EmptyRecord> response = null;
RestLiResponseException exception = null;
try
{
Request<EmptyRecord> createRequest = builders.create()
.input(new Greeting().setId(11L).setMessage("@#$%@!$%").setTone(Tone.INSULTING))
.build();
ResponseFuture<EmptyRecord> future;
if (explicit)
{
future = getClient().sendRequest(createRequest, errorHandlingBehavior);
}
else
{
future = getClient().sendRequest(createRequest);
}
response = future.getResponse();
if (!explicit || errorHandlingBehavior == ErrorHandlingBehavior.FAIL_ON_ERROR)
{
Assert.fail("expected exception");
}
}
catch (RestLiResponseException e)
{
if (!explicit || errorHandlingBehavior == ErrorHandlingBehavior.FAIL_ON_ERROR)
{
exception = e;
}
else
{
Assert.fail("not expected exception");
}
}
if (explicit && errorHandlingBehavior == ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS)
{
Assert.assertNotNull(response);
Assert.assertTrue(response.hasError());
exception = response.getError();
Assert.assertEquals(response.getStatus(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertNull(response.getEntity());
}
Assert.assertNotNull(exception);
Assert.assertFalse(exception.hasDecodedResponse());
Assert.assertEquals(exception.getStatus(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertEquals(exception.getServiceErrorMessage(), "I will not tolerate your insolence!");
Assert.assertEquals(exception.getServiceErrorCode(), 999);
Assert.assertEquals(exception.getErrorSource(), RestConstants.HEADER_VALUE_ERROR);
Assert.assertEquals(exception.getErrorDetails().getString("reason"), "insultingGreeting");
Assert.assertTrue(exception.getServiceErrorStackTrace().startsWith("com.linkedin.restli.server.RestLiServiceException [HTTP Status:406, serviceErrorCode:999]: I will not tolerate your insolence!"),
"stacktrace mismatch:" + exception.getStackTrace());
Assert.assertFalse(exception.hasCode());
Assert.assertFalse(exception.hasDocUrl());
Assert.assertFalse(exception.hasRequestId());
Assert.assertEquals(exception.getErrorDetailType(), EmptyRecord.class.getCanonicalName());
}
@SuppressWarnings("deprecation")
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testBatchCreateErrors(RestliRequestOptions requestOptions) throws Exception
{
ExceptionsBuilders builders = new ExceptionsBuilders(requestOptions);
Request<CollectionResponse<CreateStatus>> batchCreateRequest = builders.batchCreate()
.input(new Greeting().setId(10L).setMessage("Greetings.").setTone(Tone.SINCERE))
.input(new Greeting().setId(11L).setMessage("@#$%@!$%").setTone(Tone.INSULTING))
.build();
Response<CollectionResponse<CreateStatus>> response = getClient().sendRequest(batchCreateRequest).getResponse();
List<CreateStatus> createStatuses = response.getEntity().getElements();
Assert.assertEquals(createStatuses.size(), 2);
@SuppressWarnings("unchecked")
CreateIdStatus<Long> status0 = (CreateIdStatus<Long>)createStatuses.get(0);
Assert.assertEquals(status0.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
Assert.assertEquals(status0.getKey(), Long.valueOf(10));
@SuppressWarnings("deprecation")
String id = status0.getId();
Assert.assertEquals(BatchResponse.keyToString(status0.getKey(), ProtocolVersionUtil.extractProtocolVersion(response.getHeaders())),
id);
Assert.assertFalse(status0.hasError());
CreateStatus status1 = createStatuses.get(1);
Assert.assertEquals(status1.getStatus().intValue(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertTrue(status1.hasError());
ErrorResponse error = status1.getError();
Assert.assertEquals(error.getStatus().intValue(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertEquals(error.getMessage(), "I will not tolerate your insolence!");
Assert.assertEquals(error.getServiceErrorCode().intValue(), 999);
Assert.assertEquals(error.getExceptionClass(), "com.linkedin.restli.server.RestLiServiceException");
Assert.assertEquals(error.getErrorDetails().data().getString("reason"), "insultingGreeting");
Assert.assertTrue(error.getStackTrace().startsWith(
"com.linkedin.restli.server.RestLiServiceException [HTTP Status:406, serviceErrorCode:999]: I will not tolerate your insolence!"),
"stacktrace mismatch:" + error.getStackTrace());
Assert.assertFalse(error.hasCode());
Assert.assertFalse(error.hasDocUrl());
Assert.assertFalse(error.hasRequestId());
Assert.assertEquals(error.getErrorDetailType(), EmptyRecord.class.getCanonicalName());
}
@SuppressWarnings("deprecation")
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testBatchCreateIdErrors(RestliRequestOptions requestOptions) throws Exception
{
ExceptionsRequestBuilders builders = new ExceptionsRequestBuilders(requestOptions);
BatchCreateIdRequest<Long, Greeting> batchCreateRequest = builders.batchCreate()
.input(new Greeting().setId(10L).setMessage("Greetings.").setTone(Tone.SINCERE))
.input(new Greeting().setId(11L).setMessage("@#$%@!$%").setTone(Tone.INSULTING))
.build();
Response<BatchCreateIdResponse<Long>> response = getClient().sendRequest(batchCreateRequest).getResponse();
List<CreateIdStatus<Long>> createStatuses = response.getEntity().getElements();
Assert.assertEquals(createStatuses.size(), 2);
@SuppressWarnings("unchecked")
CreateIdStatus<Long> status0 = createStatuses.get(0);
Assert.assertEquals(status0.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
Assert.assertEquals(status0.getKey(), Long.valueOf(10));
@SuppressWarnings("deprecation")
String id = status0.getId();
Assert.assertEquals(BatchResponse.keyToString(status0.getKey(), ProtocolVersionUtil.extractProtocolVersion(response.getHeaders())),
id);
Assert.assertFalse(status0.hasError());
CreateIdStatus<Long> status1 = createStatuses.get(1);
Assert.assertEquals(status1.getStatus().intValue(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertTrue(status1.hasError());
ErrorResponse error = status1.getError();
Assert.assertEquals(error.getStatus().intValue(), HttpStatus.S_406_NOT_ACCEPTABLE.getCode());
Assert.assertEquals(error.getMessage(), "I will not tolerate your insolence!");
Assert.assertEquals(error.getServiceErrorCode().intValue(), 999);
Assert.assertEquals(error.getExceptionClass(), "com.linkedin.restli.server.RestLiServiceException");
Assert.assertEquals(error.getErrorDetails().data().getString("reason"), "insultingGreeting");
Assert.assertTrue(error.getStackTrace().startsWith(
"com.linkedin.restli.server.RestLiServiceException [HTTP Status:406, serviceErrorCode:999]: I will not tolerate your insolence!"),
"stacktrace mismatch:" + error.getStackTrace());
Assert.assertFalse(error.hasCode());
Assert.assertFalse(error.hasDocUrl());
Assert.assertFalse(error.hasRequestId());
Assert.assertEquals(error.getErrorDetailType(), EmptyRecord.class.getCanonicalName());
}
/**
* Ensures that the {@link RestLiResponseException} thrown on the client has the correct set of fields as specified by
* the {@link ErrorResponseFormat} override used when the exception is thrown in the resource.
*/
@SuppressWarnings("deprecation")
@Test(dataProvider = "errorResponseFormatData")
public void testErrorResponseFormat(ActionRequestBuilder<?, ?> actionRequestBuilder,
ErrorResponseFormat expectedFormat, String expectedResponseString)
throws RemoteInvocationException
{
ActionRequest<?> actionRequest = actionRequestBuilder.build();
try
{
getClient().sendRequest(actionRequest).getResponse();
}
catch (RestLiResponseException e)
{
Assert.assertEquals(e.hasCode(), expectedFormat.showServiceErrorCode());
Assert.assertEquals(e.hasServiceErrorCode(), expectedFormat.showServiceErrorCode());
Assert.assertEquals(e.hasServiceErrorMessage(), expectedFormat.showMessage());
Assert.assertEquals(e.hasDocUrl(), expectedFormat.showDocUrl());
Assert.assertEquals(e.hasRequestId(), expectedFormat.showRequestId());
Assert.assertEquals(e.hasErrorDetails(), expectedFormat.showDetails());
Assert.assertEquals(e.hasErrorDetailType(), expectedFormat.showDetails());
Assert.assertEquals(e.hasServiceExceptionClass(), expectedFormat.showExceptionClass());
Assert.assertEquals(e.hasServiceErrorStackTrace(), expectedFormat.showStacktrace());
if (expectedFormat.showDetails())
{
Greeting errorDetail = e.getErrorDetailsRecord();
Assert.assertNotNull(errorDetail);
}
Assert.assertEquals(e.toString(), expectedResponseString);
}
}
@Test
public void testExceptionsWithNullStatus() throws Exception
{
ActionRequest<?> actionRequest = new ExceptionsBuilders().actionErrorWithEmptyStatus().build();
try
{
getClient().sendRequest(actionRequest).getResponse();
}
catch (RestLiResponseException e)
{
Assert.assertEquals(e.getStatus(), HttpStatus.S_500_INTERNAL_SERVER_ERROR.getCode());
Assert.assertEquals(e.toString(),
"com.linkedin.restli.client.RestLiResponseException: Response status 500, serviceErrorMessage: This is an exception with no status!");
}
}
@SuppressWarnings("deprecation")
@Test
public void testBadInputErrorResponse() throws IOException
{
HttpPost post = new HttpPost(URI_PREFIX + ExceptionsBuilders.getPrimaryResource());
post.setEntity(new StringEntity("{\"foo\",\"bar\"}"));
try (CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = httpClient.execute(post))
{
Assert.assertEquals(response.getStatusLine().getStatusCode(), HttpStatus.S_400_BAD_REQUEST.getCode());
DataMap responseMap = DataMapUtils.readMap(response.getEntity().getContent());
Assert.assertEquals(responseMap.getString("message"), "Cannot parse request entity");
}
}
@DataProvider(name = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "exceptionHandlingModesDataProvider")
public Object[][] exceptionHandlingModesDataProvider()
{
return new Object[][] {
{ true, ErrorHandlingBehavior.FAIL_ON_ERROR, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders()) },
{ true, ErrorHandlingBehavior.FAIL_ON_ERROR, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
{ true, ErrorHandlingBehavior.FAIL_ON_ERROR, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders()) },
{ true, ErrorHandlingBehavior.FAIL_ON_ERROR, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
{ true, ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders()) },
{ true, ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
{ true, ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders()) },
{ true, ErrorHandlingBehavior.TREAT_SERVER_ERROR_AS_SUCCESS, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
{ false, null, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders()) },
{ false, null, new RootBuilderWrapper<Long, Greeting>(new ExceptionsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
{ false, null, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders()) },
{ false, null, new RootBuilderWrapper<Long, Greeting>(new ExceptionsRequestBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) }
};
}
@DataProvider(name = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
private static Object[][] requestOptionsDataProvider()
{
return new Object[][]
{
{ RestliRequestOptions.DEFAULT_OPTIONS },
{ TestConstants.FORCE_USE_NEXT_OPTIONS }
};
}
@DataProvider(name = "errorResponseFormatData")
private static Object[][] provideErrorResponseFormatData()
{
final ExceptionsBuilders exceptionsBuilders = new ExceptionsBuilders();
return new Object[][]
{
{
exceptionsBuilders.actionErrorResponseFormatMinimal(),
ErrorResponseFormat.MINIMAL,
"com.linkedin.restli.client.RestLiResponseException: Response status 500"
},
{
exceptionsBuilders.actionErrorResponseFormatMessageOnly(),
ErrorResponseFormat.MESSAGE_ONLY,
"com.linkedin.restli.client.RestLiResponseException: Response status 500, serviceErrorMessage: This is an exception, you dummy!"
},
{
exceptionsBuilders.actionErrorResponseFormatMessageAndDetails(),
ErrorResponseFormat.MESSAGE_AND_DETAILS,
"com.linkedin.restli.client.RestLiResponseException: Response status 500, serviceErrorMessage: This is an exception, you dummy!"
},
{
exceptionsBuilders.actionErrorResponseFormatMessageAndServiceCode(),
ErrorResponseFormat.MESSAGE_AND_SERVICECODE,
"com.linkedin.restli.client.RestLiResponseException: Response status 500, serviceErrorMessage: This is an exception, you dummy!, serviceErrorCode: 2147, code: DUMMY_EXCEPTION"
},
{
exceptionsBuilders.actionErrorResponseFormatMessageAndServiceCodeAndExceptionClass(),
ErrorResponseFormat.MESSAGE_AND_SERVICECODE_AND_EXCEPTIONCLASS,
"com.linkedin.restli.client.RestLiResponseException: Response status 500, serviceErrorMessage: This is an exception, you dummy!, serviceErrorCode: 2147, code: DUMMY_EXCEPTION"
}
};
}
}
| 7,077 |
6,304 | <gh_stars>1000+
/*
* Copyright 2019 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "modules/skottie/src/effects/Effects.h"
#include "modules/skottie/src/Composition.h"
#include "modules/skottie/src/Layer.h"
#include "modules/skottie/src/SkottieJson.h"
#include "modules/sksg/include/SkSGRenderEffect.h"
#include "src/utils/SkJSON.h"
#include <algorithm>
#include <iterator>
namespace skottie {
namespace internal {
EffectBuilder::EffectBuilder(const AnimationBuilder* abuilder,
const SkSize& layer_size,
CompositionBuilder* cbuilder)
: fBuilder(abuilder)
, fCompBuilder(cbuilder)
, fLayerSize(layer_size) {}
EffectBuilder::EffectBuilderT EffectBuilder::findBuilder(const skjson::ObjectValue& jeffect) const {
static constexpr struct BuilderInfo {
const char* fName;
EffectBuilderT fBuilder;
} gBuilderInfo[] = {
// alphabetized for binary search lookup
{ "ADBE Black&White" , &EffectBuilder::attachBlackAndWhiteEffect },
{ "ADBE Brightness & Contrast 2", &EffectBuilder::attachBrightnessContrastEffect },
{ "ADBE Bulge" , &EffectBuilder::attachBulgeEffect },
{ "ADBE Corner Pin" , &EffectBuilder::attachCornerPinEffect },
{ "ADBE Displacement Map" , &EffectBuilder::attachDisplacementMapEffect },
{ "ADBE Drop Shadow" , &EffectBuilder::attachDropShadowEffect },
{ "ADBE Easy Levels2" , &EffectBuilder::attachEasyLevelsEffect },
{ "ADBE Fill" , &EffectBuilder::attachFillEffect },
{ "ADBE Fractal Noise" , &EffectBuilder::attachFractalNoiseEffect },
{ "ADBE Gaussian Blur 2" , &EffectBuilder::attachGaussianBlurEffect },
{ "ADBE Geometry2" , &EffectBuilder::attachTransformEffect },
{ "ADBE HUE SATURATION" , &EffectBuilder::attachHueSaturationEffect },
{ "ADBE Invert" , &EffectBuilder::attachInvertEffect },
{ "ADBE Linear Wipe" , &EffectBuilder::attachLinearWipeEffect },
{ "ADBE Motion Blur" , &EffectBuilder::attachDirectionalBlurEffect },
{ "ADBE Pro Levels2" , &EffectBuilder::attachProLevelsEffect },
{ "ADBE Radial Wipe" , &EffectBuilder::attachRadialWipeEffect },
{ "ADBE Ramp" , &EffectBuilder::attachGradientEffect },
{ "ADBE Sharpen" , &EffectBuilder::attachSharpenEffect },
{ "ADBE Shift Channels" , &EffectBuilder::attachShiftChannelsEffect },
{ "ADBE Threshold2" , &EffectBuilder::attachThresholdEffect },
{ "ADBE Tile" , &EffectBuilder::attachMotionTileEffect },
{ "ADBE Tint" , &EffectBuilder::attachTintEffect },
{ "ADBE Tritone" , &EffectBuilder::attachTritoneEffect },
{ "ADBE Venetian Blinds" , &EffectBuilder::attachVenetianBlindsEffect },
{ "CC Sphere" , &EffectBuilder::attachSphereEffect },
{ "CC Toner" , &EffectBuilder::attachCCTonerEffect },
{ "SkSL Color Filter" , &EffectBuilder::attachSkSLColorFilter },
{ "SkSL Shader" , &EffectBuilder::attachSkSLShader },
};
const skjson::StringValue* mn = jeffect["mn"];
if (mn) {
const BuilderInfo key { mn->begin(), nullptr };
const auto* binfo = std::lower_bound(std::begin(gBuilderInfo),
std::end (gBuilderInfo),
key,
[](const BuilderInfo& a, const BuilderInfo& b) {
return strcmp(a.fName, b.fName) < 0;
});
if (binfo != std::end(gBuilderInfo) && !strcmp(binfo->fName, key.fName)) {
return binfo->fBuilder;
}
}
// Some legacy clients rely solely on the 'ty' field and generate (non-BM) JSON
// without a valid 'mn' string. TODO: we should update them and remove this fallback.
enum : int32_t {
kTint_Effect = 20,
kFill_Effect = 21,
kTritone_Effect = 23,
kDropShadow_Effect = 25,
kRadialWipe_Effect = 26,
kGaussianBlur_Effect = 29,
};
switch (ParseDefault<int>(jeffect["ty"], -1)) {
case kTint_Effect: return &EffectBuilder::attachTintEffect;
case kFill_Effect: return &EffectBuilder::attachFillEffect;
case kTritone_Effect: return &EffectBuilder::attachTritoneEffect;
case kDropShadow_Effect: return &EffectBuilder::attachDropShadowEffect;
case kRadialWipe_Effect: return &EffectBuilder::attachRadialWipeEffect;
case kGaussianBlur_Effect: return &EffectBuilder::attachGaussianBlurEffect;
default: break;
}
fBuilder->log(Logger::Level::kWarning, &jeffect,
"Unsupported layer effect: %s", mn ? mn->begin() : "(unknown)");
return nullptr;
}
sk_sp<sksg::RenderNode> EffectBuilder::attachEffects(const skjson::ArrayValue& jeffects,
sk_sp<sksg::RenderNode> layer) const {
if (!layer) {
return nullptr;
}
for (const skjson::ObjectValue* jeffect : jeffects) {
if (!jeffect) {
continue;
}
const auto builder = this->findBuilder(*jeffect);
const skjson::ArrayValue* jprops = (*jeffect)["ef"];
if (!builder || !jprops) {
continue;
}
const AnimationBuilder::AutoPropertyTracker apt(fBuilder, *jeffect, PropertyObserver::NodeType::EFFECT);
layer = (this->*builder)(*jprops, std::move(layer));
if (!layer) {
fBuilder->log(Logger::Level::kError, jeffect, "Invalid layer effect.");
return nullptr;
}
}
return layer;
}
sk_sp<sksg::RenderNode> EffectBuilder::attachStyles(const skjson::ArrayValue& jstyles,
sk_sp<sksg::RenderNode> layer) const {
#if !defined(SKOTTIE_DISABLE_STYLES)
if (!layer) {
return nullptr;
}
using StyleBuilder =
sk_sp<sksg::RenderNode> (EffectBuilder::*)(const skjson::ObjectValue&,
sk_sp<sksg::RenderNode>) const;
static constexpr StyleBuilder gStyleBuilders[] = {
nullptr, // 'ty': 0 -> stroke
&EffectBuilder::attachDropShadowStyle, // 'ty': 1 -> drop shadow
&EffectBuilder::attachInnerShadowStyle, // 'ty': 2 -> inner shadow
&EffectBuilder::attachOuterGlowStyle, // 'ty': 3 -> outer glow
&EffectBuilder::attachInnerGlowStyle, // 'ty': 4 -> inner glow
};
for (const skjson::ObjectValue* jstyle : jstyles) {
if (!jstyle) {
continue;
}
const auto style_type =
ParseDefault<size_t>((*jstyle)["ty"], std::numeric_limits<size_t>::max());
auto builder = style_type < SK_ARRAY_COUNT(gStyleBuilders) ? gStyleBuilders[style_type]
: nullptr;
if (!builder) {
fBuilder->log(Logger::Level::kWarning, jstyle, "Unsupported layer style.");
continue;
}
layer = (this->*builder)(*jstyle, std::move(layer));
}
#endif // !defined(SKOTTIE_DISABLE_STYLES)
return layer;
}
const skjson::Value& EffectBuilder::GetPropValue(const skjson::ArrayValue& jprops,
size_t prop_index) {
static skjson::NullValue kNull;
if (prop_index >= jprops.size()) {
return kNull;
}
const skjson::ObjectValue* jprop = jprops[prop_index];
return jprop ? (*jprop)["v"] : kNull;
}
MaskShaderEffectBase::MaskShaderEffectBase(sk_sp<sksg::RenderNode> child, const SkSize& ls)
: fMaskEffectNode(sksg::MaskShaderEffect::Make(std::move(child)))
, fLayerSize(ls) {}
void MaskShaderEffectBase::onSync() {
const auto minfo = this->onMakeMask();
fMaskEffectNode->setVisible(minfo.fVisible);
fMaskEffectNode->setShader(std::move(minfo.fMaskShader));
}
} // namespace internal
} // namespace skottie
| 4,220 |
2,174 | <gh_stars>1000+
package ceui.lisa.ui.behavior;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.OverScroller;
import androidx.annotation.NonNull;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.ViewCompat;
import ceui.lisa.R;
public class FragmentRightContentBehavior extends CoordinatorLayout.Behavior<View> {
private float headerHeight;
private View contentView;
private OverScroller scroller;
private final Runnable scrollRunnable = new Runnable() {
@Override
public void run() {
if (scroller != null) {
if (scroller.computeScrollOffset()) {
contentView.setTranslationY((float) scroller.getCurrY());
ViewCompat.postOnAnimation(contentView, this);
}
}
}
};
private void startAutoScroll(int current, int target, int duration) {
if (scroller == null) {
scroller = new OverScroller(contentView.getContext());
}
if (scroller.isFinished()) {
contentView.removeCallbacks(scrollRunnable);
scroller.startScroll(0, current, 0, target - current, duration);
ViewCompat.postOnAnimation(contentView, scrollRunnable);
}
}
private void stopAutoScroll() {
if (scroller != null) {
if (!scroller.isFinished()) {
scroller.abortAnimation();
contentView.removeCallbacks(scrollRunnable);
}
}
}
@Override
public void onStopNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View target, int type) {
super.onStopNestedScroll(coordinatorLayout, child, target, type);
if (child.getTranslationY() >= 0f || child.getTranslationY() <= -headerHeight) {
// RV 已经归位(完全折叠或完全展开)
return;
}
if (child.getTranslationY() <= -headerHeight * 0.5f) {
stopAutoScroll();
startAutoScroll((int)child.getTranslationY(), (int)-headerHeight, 1000);
} else {
stopAutoScroll();
startAutoScroll((int)child.getTranslationY(), 0, 600);
}
}
public FragmentRightContentBehavior() {
}
public FragmentRightContentBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean layoutDependsOn(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) {
return child.getId() == R.id.imagesTitleBlockLayout;
}
@Override
public boolean onLayoutChild(@NonNull CoordinatorLayout parent, @NonNull View child, int layoutDirection) {
// 首先让父布局按照标准方式解析
parent.onLayoutChild(child, layoutDirection);
// 获取到 HeaderView 的高度
headerHeight = parent.findViewById(R.id.imagesTitleBlockLayout).getMeasuredHeight();
contentView = child;
// 设置 top 从而排在 HeaderView的下面
ViewCompat.offsetTopAndBottom(child, (int)headerHeight);
return true; // true 表示我们自己完成了解析 不要再自动解析了
}
@Override
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) {
return (axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
@Override
public void onNestedPreScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child,
@NonNull View target, int dx, int dy, @NonNull int[] consumed, int type) {
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type);
stopAutoScroll();
if (dy > 0) { // 只处理手指上滑
float newTransY = child.getTranslationY() - dy;
if (newTransY >= (-headerHeight)) {
// 完全消耗滑动距离后没有完全贴顶或刚好贴顶
// 那么就声明消耗所有滑动距离,并上移 RecyclerView
consumed[1] = dy; // consumed[0/1] 分别用于声明消耗了x/y方向多少滑动距离
child.setTranslationY(newTransY);
} else {
consumed[1] = (int)(headerHeight + child.getTranslationY());
child.setTranslationY(-headerHeight);
}
}
}
@Override
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, @NonNull int[] consumed) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type, consumed);
stopAutoScroll();
if (dyUnconsumed < 0) { // 只处理手指向下滑动的情况
float newTransY = child.getTranslationY() - dyUnconsumed;
if (newTransY <= 0) {
child.setTranslationY(newTransY);
} else {
child.setTranslationY(0.0f);
}
}
}
@Override
public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) {
return super.onDependentViewChanged(parent, child, dependency);
}
}
| 2,412 |
22,481 | """DataUpdateCoordinator for System Bridge."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from datetime import timedelta
import logging
from systembridge import Bridge
from systembridge.exceptions import (
BridgeAuthenticationException,
BridgeConnectionClosedException,
BridgeException,
)
from systembridge.objects.events import Event
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import BRIDGE_CONNECTION_ERRORS, DOMAIN
class SystemBridgeDataUpdateCoordinator(DataUpdateCoordinator[Bridge]):
"""Class to manage fetching System Bridge data from single endpoint."""
def __init__(
self,
hass: HomeAssistant,
bridge: Bridge,
LOGGER: logging.Logger,
*,
entry: ConfigEntry,
) -> None:
"""Initialize global System Bridge data updater."""
self.bridge = bridge
self.title = entry.title
self.host = entry.data[CONF_HOST]
self.unsub: Callable | None = None
super().__init__(
hass, LOGGER, name=DOMAIN, update_interval=timedelta(seconds=30)
)
def update_listeners(self) -> None:
"""Call update on all listeners."""
for update_callback in self._listeners:
update_callback()
async def async_handle_event(self, event: Event):
"""Handle System Bridge events from the WebSocket."""
# No need to update anything, as everything is updated in the caller
self.logger.debug(
"New event from %s (%s): %s", self.title, self.host, event.name
)
self.async_set_updated_data(self.bridge)
async def _listen_for_events(self) -> None:
"""Listen for events from the WebSocket."""
try:
await self.bridge.async_send_event(
"get-data",
[
"battery",
"cpu",
"display",
"filesystem",
"graphics",
"memory",
"network",
"os",
"processes",
"system",
],
)
await self.bridge.listen_for_events(callback=self.async_handle_event)
except BridgeConnectionClosedException as exception:
self.last_update_success = False
self.logger.info(
"Websocket Connection Closed for %s (%s). Will retry: %s",
self.title,
self.host,
exception,
)
except BridgeException as exception:
self.last_update_success = False
self.update_listeners()
self.logger.warning(
"Exception occurred for %s (%s). Will retry: %s",
self.title,
self.host,
exception,
)
async def _setup_websocket(self) -> None:
"""Use WebSocket for updates."""
try:
self.logger.debug(
"Connecting to ws://%s:%s",
self.host,
self.bridge.information.websocketPort,
)
await self.bridge.async_connect_websocket(
self.host, self.bridge.information.websocketPort
)
except BridgeAuthenticationException as exception:
if self.unsub:
self.unsub()
self.unsub = None
raise ConfigEntryAuthFailed() from exception
except (*BRIDGE_CONNECTION_ERRORS, ConnectionRefusedError) as exception:
if self.unsub:
self.unsub()
self.unsub = None
raise UpdateFailed(
f"Could not connect to {self.title} ({self.host})."
) from exception
asyncio.create_task(self._listen_for_events())
async def close_websocket(_) -> None:
"""Close WebSocket connection."""
await self.bridge.async_close_websocket()
# Clean disconnect WebSocket on Home Assistant shutdown
self.unsub = self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, close_websocket
)
async def _async_update_data(self) -> Bridge:
"""Update System Bridge data from WebSocket."""
self.logger.debug(
"_async_update_data - WebSocket Connected: %s",
self.bridge.websocket_connected,
)
if not self.bridge.websocket_connected:
await self._setup_websocket()
return self.bridge
| 2,237 |
319 | /**
* Copyright (c) 2011, The University of Southampton and the individual contributors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the University of Southampton nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.openimaj.ml.linear.learner;
import gov.sandia.cognition.math.matrix.Matrix;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.openimaj.citation.annotation.Reference;
import org.openimaj.citation.annotation.ReferenceType;
import org.openimaj.math.matrix.CFMatrixUtils;
/**
* An implementation of a stochastic gradient decent with proximal parameter
* adjustment (for regularised parameters).
* <p>
* Data is dealt with sequentially using a one pass implementation of the online
* proximal algorithm described in chapter 9 and 10 of: The Geometry of
* Constrained Structured Prediction: Applications to Inference and Learning of
* Natural Language Syntax, PhD, <NAME>
* <p>
* This is a direct extension of the {@link BilinearSparseOnlineLearner} but
* instead of a mixed update scheme (i.e. for a number of iterations W and U are
* updated synchronously) we have an unmixed scheme where W is updated for a
* number of iterations, followed by U for a number of iterations continuing as
* a whole for a number of iterations
* <p>
* The implementation does the following:
* <ul>
* <li>When an X,Y is received:
* <ul>
* <li>Update currently held batch
* <li>If the batch is full:
* <ul>
* <li>While There is a great deal of change in U and W:
* <ul>
* <li>While There is a great deal of change in W:
* <ul>
* <li>Calculate the gradient of W holding U fixed
* <li>Proximal update of W
* <li>Calculate the gradient of Bias holding U and W fixed
* </ul>
* <li>While There is a great deal of change in U:
* <ul>
* <li>Calculate the gradient of U holding W fixed
* <li>Proximal update of U
* <li>Calculate the gradient of Bias holding U and W fixed
* </ul>
* </ul>
* <li>flush the batch
* </ul>
* <li>return current U and W (same as last time is batch isn't filled yet)
* </ul>
* </ul>
*
* @author <NAME> (<EMAIL>)
*
*/
@Reference(
author = { "<NAME>" },
title = "The Geometry of Constrained Structured Prediction: Applications to Inference and Learning of Natural Language Syntax",
type = ReferenceType.Phdthesis,
year = "2012")
public class BilinearUnmixedSparseOnlineLearner extends BilinearSparseOnlineLearner {
static Logger logger = LogManager.getLogger(BilinearUnmixedSparseOnlineLearner.class);
@Override
protected Matrix updateW(Matrix currentW, double wLossWeighted, double weightedLambda) {
Matrix current = currentW;
int iter = 0;
final Double biconvextol = this.params.getTyped(BilinearLearnerParameters.BICONVEX_TOL);
final Integer maxiter = this.params.getTyped(BilinearLearnerParameters.BICONVEX_MAXITER);
while (true) {
final Matrix newcurrent = super.updateW(current, wLossWeighted, weightedLambda);
final double sumchange = CFMatrixUtils.absSum(current.minus(newcurrent));
final double total = CFMatrixUtils.absSum(current);
final double ratio = sumchange / total;
current = newcurrent;
if (ratio < biconvextol || iter >= maxiter) {
logger.debug("W tolerance reached after iteration: " + iter);
break;
}
iter++;
}
return current;
}
@Override
protected Matrix updateU(Matrix currentU, Matrix neww, double uLossWeighted, double weightedLambda) {
Matrix current = currentU;
int iter = 0;
final Double biconvextol = this.params.getTyped(BilinearLearnerParameters.BICONVEX_TOL);
final Integer maxiter = this.params.getTyped(BilinearLearnerParameters.BICONVEX_MAXITER);
while (true) {
final Matrix newcurrent = super.updateU(current, neww, uLossWeighted, weightedLambda);
final double sumchange = CFMatrixUtils.absSum(current.minus(newcurrent));
final double total = CFMatrixUtils.absSum(current);
final double ratio = sumchange / total;
current = newcurrent;
if (ratio < biconvextol || iter >= maxiter) {
logger.debug("U tolerance reached after iteration: " + iter);
break;
}
iter++;
}
return current;
}
}
| 1,744 |
2,338 | //===-- Implementation header for nearbyintl --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_MATH_NEARBYINTL_H
#define LLVM_LIBC_SRC_MATH_NEARBYINTL_H
namespace __llvm_libc {
long double nearbyintl(long double x);
} // namespace __llvm_libc
#endif // LLVM_LIBC_SRC_MATH_NEARBYINTL_H
| 199 |
1,006 | /* Orx - Portable Game Engine
*
* Copyright (c) 2008-2021 Orx-Project
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/
/**
* @file 07_FX.c
* @date 13/08/2008
* @author <EMAIL>
*
* FX tutorial
*/
#include "orx.h"
/* This is a basic C tutorial creating visual FXs.
*
* See previous tutorials for more info about the basic object creation, clock, animation, viewport and sound handling.
*
* This tutorial shows what FXs are and how to create them.
*
* FXs are based on a combination of curves based on sine, triangle, square or linear shape,
* applied on different parameters such as scale, rotation, position, speed, alpha and color.
*
* FXs are set through config file requiring only one line of code to apply them on an object.
* There can be up to 8 curves of any type combined to form a single FX. Up to 8 FXs can be applied
* on the same object at the same time.
*
* FXs can use absolute or relative values, depending on the Absolute attribute in its config.
* Control over curve period, phase, pow and amplification over time is also granted.
* For position and speed FXs, the output value can use the object's orientation and/or scale
* so as to be applied relatively to the object's current state.
* This allows the creation of pretty elaborated and nice looking visual FXs.
*
* FX parameters can be tweaked in the config file and reloaded on-the-fly using backspace,
* unless the FX was specified to be cached in memory (cf. the ''KeepInCache'' attribute).
*
* For example you won't be able to tweak on the fly the circle FX as it has been defined
* with this attribute in the default config file.
* All the other FXs can be updated while the tutorial run.
*
* As always, random parameters can be used from config allowing some variety for a single FX.
* For example, the wobble scale, the flash color and the "attack" move FXs are using limited random values.
*
* We also register to the FX events so as to display when FXs are played and stopped.
* As the FX played on the box object is tagged as looping, it'll never stop.
* Therefore the corresponding event (orxFX_EVENT_STOP) will never be sent.
*
* We also show briefly how to add some personal user data to an orxOBJECT (here a structure containing a single boolean).
* We retrieve it in the event callback to lock the object when an FX starts and unlock it when it stops.
* We use this lock to allow only one FX at a time on the soldier. It's only written here for didactic purpose.
*
*/
/** Tutorial structure
*/
typedef struct MyObject
{
orxBOOL bLock;
} MyObject;
/** Tutorial objects
*/
orxOBJECT *pstSoldier;
orxOBJECT *pstBox;
const orxSTRING zSelectedFX = "WobbleFX";
/** Event handler
*/
orxSTATUS orxFASTCALL EventHandler(const orxEVENT *_pstEvent)
{
/* Input event? */
if(_pstEvent->eType == orxEVENT_TYPE_INPUT)
{
/* Activated? */
if(_pstEvent->eID == orxINPUT_EVENT_ON)
{
orxINPUT_EVENT_PAYLOAD *pstPayload;
/* Gets event payload */
pstPayload = (orxINPUT_EVENT_PAYLOAD *)_pstEvent->pstPayload;
/* Main input? */
if(orxString_Compare(pstPayload->zSetName, orxINPUT_KZ_CONFIG_SECTION) == 0)
{
/* Has a multi-input info? */
if(pstPayload->aeType[1] != orxINPUT_TYPE_NONE)
{
/* Logs info */
orxLOG("<%s> selected [%s + %s]", pstPayload->zInputName, orxInput_GetBindingName(pstPayload->aeType[0], pstPayload->aeID[0], pstPayload->aeMode[0]), orxInput_GetBindingName(pstPayload->aeType[1], pstPayload->aeID[1], pstPayload->aeMode[1]));
}
else
{
/* Logs info */
orxLOG("<%s> selected [%s]", pstPayload->zInputName, orxInput_GetBindingName(pstPayload->aeType[0], pstPayload->aeID[0], pstPayload->aeMode[0]));
}
}
}
}
else
{
orxFX_EVENT_PAYLOAD *pstPayload;
orxOBJECT *pstObject;
/* Gets event payload */
pstPayload = _pstEvent->pstPayload;
/* Gets event recipient */
pstObject = orxOBJECT(_pstEvent->hRecipient);
/* Depending on event type */
switch(_pstEvent->eID)
{
case orxFX_EVENT_START:
{
/* Logs info */
orxLOG("FX <%s>@<%s> has started!", pstPayload->zFXName, orxObject_GetName(pstObject));
/* On soldier? */
if(pstObject == pstSoldier)
{
/* Locks it */
((MyObject *)orxObject_GetUserData(pstObject))->bLock = orxTRUE;
}
break;
}
case orxFX_EVENT_STOP:
{
/* Logs info */
orxLOG("FX <%s>@<%s> has stopped!", pstPayload->zFXName, orxObject_GetName(pstObject));
/* On soldier? */
if(pstObject == pstSoldier)
{
/* Unlocks it */
((MyObject *)orxObject_GetUserData(pstObject))->bLock = orxFALSE;
}
break;
}
}
}
/* Done! */
return orxSTATUS_SUCCESS;
}
/** Update callback
*/
void orxFASTCALL Update(const orxCLOCK_INFO *_pstClockInfo, void *_pstContext)
{
orxS32 i, s32Count;
/* *** FX CONTROLS *** */
/* Pushes main config section */
orxConfig_PushSection("Main");
/* For all inputs/FXs */
for(i = 0, s32Count = orxConfig_GetListCount("FXList");
i < s32Count;
i++)
{
const orxSTRING zFX;
/* Gets its name */
zFX = orxConfig_GetListString("FXList", i);
/* Is active? */
if(orxInput_IsActive(zFX))
{
/* Selects it */
zSelectedFX = zFX;
break;
}
}
/* Pops config section */
orxConfig_PopSection();
/* Soldier not locked? */
if(!((MyObject *)orxObject_GetUserData(pstSoldier))->bLock)
{
/* Apply FX? */
if(orxInput_HasBeenActivated("ApplyFX"))
{
/* Plays FX on soldier */
orxObject_AddFX(pstSoldier, zSelectedFX);
}
}
}
/** Inits the tutorial
*/
orxSTATUS orxFASTCALL Init()
{
orxCLOCK *pstClock;
MyObject *pstMyObject;
orxINPUT_TYPE eType;
orxENUM eID;
orxINPUT_MODE eMode;
orxS32 i, s32Count;
const orxSTRING zInputApplyFX;
orxCHAR acBuffer[1024], *pc = acBuffer;
/* Gets input binding names */
orxInput_GetBinding("ApplyFX", 0, &eType, &eID, &eMode);
zInputApplyFX = orxInput_GetBindingName(eType, eID, eMode);
/* Displays a small hint in console */
pc += orxString_NPrint(pc, (orxU32)(sizeof(acBuffer) - (pc - acBuffer) - 1), "\n- To select a FX:");
orxConfig_PushSection("Main");
for(i = 0, s32Count = orxConfig_GetListCount("FXList");
i < s32Count;
i++)
{
const orxSTRING zInput;
zInput = orxConfig_GetListString("FXList", i);
orxInput_GetBinding(zInput, 0, &eType, &eID, &eMode);
pc += orxString_NPrint(pc, (orxU32)(sizeof(acBuffer) - (pc - acBuffer) - 1), "\n . %-8s => %s", orxInput_GetBindingName(eType, eID, eMode), zInput);
}
orxConfig_PopSection();
pc += orxString_NPrint(pc, (orxU32)(sizeof(acBuffer) - (pc - acBuffer) - 1),
"\n- %s will apply the current selected FX on the soldier"
"\n* In this tutorial, only a single concurrent FX will be applied on the soldier"
"\n* However an object can support up to %u simultaneous FXs"
"\n* The box has a looping rotating FX applied directly from config upon its creation, requiring no code",
zInputApplyFX, orxFXPOINTER_KU32_FX_NUMBER);
orxLOG("%s", acBuffer);
/* Creates viewport */
orxViewport_CreateFromConfig("Viewport");
/* Gets main clock */
pstClock = orxClock_Get(orxCLOCK_KZ_CORE);
/* Registers our update callback */
orxClock_Register(pstClock, Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);
/* Registers event handler */
orxEvent_AddHandler(orxEVENT_TYPE_FX, EventHandler);
orxEvent_AddHandler(orxEVENT_TYPE_INPUT, EventHandler);
/* Creates objects */
pstSoldier = orxObject_CreateFromConfig("Soldier");
pstBox = orxObject_CreateFromConfig("Box");
/* Allocates our own object data */
pstMyObject = orxMemory_Allocate(sizeof(MyObject), orxMEMORY_TYPE_MAIN);
/* Inits it */
pstMyObject->bLock = orxFALSE;
/* Links it to soldier */
orxObject_SetUserData(pstSoldier, pstMyObject);
/* Done! */
return orxSTATUS_SUCCESS;
}
/** Run function
*/
orxSTATUS orxFASTCALL Run()
{
orxSTATUS eResult = orxSTATUS_SUCCESS;
/* Should quit? */
if(orxInput_IsActive("Quit"))
{
/* Updates result */
eResult = orxSTATUS_FAILURE;
}
/* Done! */
return eResult;
}
/** Exit function
*/
void orxFASTCALL Exit()
{
/* We're a bit lazy here so we let orx clean all our mess! :) */
}
/** Main function
*/
int main(int argc, char **argv)
{
/* Executes a new instance of tutorial */
orx_Execute(argc, argv, Init, Run, Exit);
return EXIT_SUCCESS;
}
| 3,933 |
308 | <reponame>shallow-ll/AntSpider
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
import random
from scrapy import signals
from twisted.internet.error import TimeoutError
from douban.util import AGENT_LIST,PRIVATE_PROXY,init_proxy,check_ip_valid,get_new_ip,get_proxy
from douban.proxylib import ProxyTool
import base64
import douban.database as db
proxy_tool = ProxyTool()
class DoubanSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts as if the spider middleware does not modify the
# passed objects.
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scrapy to create your spiders.
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(self, response, spider):
# Called for each response that goes through the spider
# middleware and into the spider.
# Should return None or raise an exception.
return None
def process_spider_output(self, response, result, spider):
# Called with the results returned from the Spider, after
# it has processed the response.
# Must return an iterable of Request, dict or Item objects.
for i in result:
yield i
def process_spider_exception(self, response, exception, spider):
print(f'#return exception reason:{type(exception)}')
#if isinstance(exception,TimeoutError):
# spider.logger.info("Request TimeoutError.")
#return request
#spider.logger.info('exception: %s' % spider.name)
# Called when a spider or process_spider_input() method
# (from other spider middleware) raises an exception.
# Should return either None or an iterable of Response, dict
# or Item objects.
pass
def process_start_requests(self, start_requests, spider):
# Called with the start requests of the spider, and works
# similarly to the process_spider_output() method, except
# that it doesn’t have a response associated.
# Must return only requests (not items).
for r in start_requests:
yield r
def spider_opened(self, spider):
spider.logger.info('Spider opened: %s' % spider.name)
class DoubanDownloaderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts as if the downloader middleware does not modify the
# passed objects.
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scrapy to create your spiders.
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_request(self, request, spider):
# Called for each request that goes through the downloader
# middleware.
# Must either:
# - return None: continue processing this request
# - or return a Response object
# - or return a Request object
# - or raise IgnoreRequest: process_exception() methods of
# installed downloader middleware will be called
return None
def process_response(self, request, response, spider):
# Called with the response returned from the downloader.
# Must either;
# - return a Response object
# - return a Request object
# - or raise IgnoreRequest
return response
def process_exception(self, request, exception, spider):
# Called when a download handler or a process_request()
# (from other downloader middleware) raises an exception.
# Must either:
# - return None: continue processing this exception
# - return a Response object: stops process_exception() chain
# - return a Request object: stops process_exception() chain
pass
def spider_opened(self, spider):
spider.logger.info('Spider opened: %s' % spider.name)
class DepthMiddleware(object):
def __init__(self, maxdepth, stats=None, verbose_stats=False, prio=1):
self.maxdepth = maxdepth
self.stats = stats
self.verbose_stats = verbose_stats
self.prio = prio
@classmethod
def from_crawler(cls, crawler):
settings = crawler.settings
maxdepth = settings.getint('DEPTH_LIMIT')
verbose = settings.getbool('DEPTH_STATS_VERBOSE')
prio = settings.getint('DEPTH_PRIORITY')
return cls(maxdepth, crawler.stats, verbose, prio)
def process_spider_output(self, response, result, spider):
def _filter(request):
if isinstance(request, Request):
depth = response.meta['depth'] + 1
request.meta['depth'] = depth
if self.prio:
request.priority -= depth * self.prio
if self.maxdepth and depth > self.maxdepth:
logger.debug(
"Ignoring link (depth > %(maxdepth)d): %(requrl)s ",
{'maxdepth': self.maxdepth, 'requrl': request.url},
extra={'spider': spider}
)
return False
elif self.stats:
if self.verbose_stats:
self.stats.inc_value('request_depth_count/%s' % depth,
spider=spider)
self.stats.max_value('request_depth_max', depth,
spider=spider)
return True
# base case (depth=0)
if self.stats and 'depth' not in response.meta:
response.meta['depth'] = 0
if self.verbose_stats:
self.stats.inc_value('request_depth_count/0', spider=spider)
return (r for r in result or () if _filter(r))
class ProxyMiddleware(object):
def process_request(self, request, spider):
# curl https://m.douban.com/book/subject/26628811/ -x http://127.0.0.1:8081
#request.meta['proxy'] = 'http://172.16.17.32:9999'
cursor = db.connection.cursor()
sql = "SELECT proxy_ip,call_times FROM proxys where valid = 1 order by call_times limit 2"
print("\n\n###SQL:", sql)
cursor.execute(sql)
all_proxy = cursor.fetchall()
proxy_list = []
for proxy in all_proxy:
ip = proxy["proxy_ip"]
proxy_list.append(ip)
PROXY_LIST = proxy_list
#PROXY_LIST = get_proxy()
print("=======###PROXY INFO: ", len(PROXY_LIST), PROXY_LIST)
proxy_ip = random.choice(PROXY_LIST)
#将mysql调用次数+1
sql = 'UPDATE proxys SET call_times=call_times+1 WHERE proxy_ip="%s"' % (proxy_ip)
cursor.execute(sql)
db.connection.commit()
cursor.close()
# 设置代理的认证信息
#auth = base64.b64encode(bytes("136756895:g<PASSWORD>", 'utf-8'))
#request.headers['Proxy-Authorization'] = b'Basic ' + auth
#proxy_ip = "172.16.58.3:19783"
##private proxy
if PRIVATE_PROXY:
# proxy = "http://136756895:g9zaye1k@" + proxy_ip
proxy = "http://" + proxy_ip
else:
proxy = "http://" + proxy_ip
spider.logger.info("\n==================proxy===================")
spider.logger.info("Switch proxy ip: %s" % proxy)
request.meta['proxy'] = proxy
# request.meta['proxy'] = 'http://10.0.0.164:1080'
class RandomUserAgentMiddleware(object):
def process_request(self, request, spider):
user_agent = random.choice(AGENT_LIST)
if user_agent:
request.headers.setdefault('User-Agent', user_agent)
| 3,355 |
3,151 | <reponame>Jeddunk/ripme
package com.rarchives.ripme.ripper.rippers;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.rarchives.ripme.ripper.AbstractSingleFileRipper;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.rarchives.ripme.ripper.VideoRipper;
import com.rarchives.ripme.utils.Http;
public class YoupornRipper extends AbstractSingleFileRipper {
public YoupornRipper(URL url) throws IOException {
super(url);
}
@Override
public String getHost() {
return "youporn";
}
@Override
public String getDomain() {
return "youporn.com";
}
@Override
public boolean canRip(URL url) {
Pattern p = Pattern.compile("^https?://[wm.]*youporn\\.com/watch/[0-9]+.*$");
Matcher m = p.matcher(url.toExternalForm());
return m.matches();
}
@Override
public Document getFirstPage() throws IOException {
return Http.url(this.url).get();
}
@Override
public List<String> getURLsFromPage(Document doc) {
List<String> results = new ArrayList<>();
Elements videos = doc.select("video");
Element video = videos.get(0);
results.add(video.attr("src"));
return results;
}
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://[wm.]*youporn\\.com/watch/([0-9]+).*$");
Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) {
return m.group(1);
}
throw new MalformedURLException(
"Expected youporn format:"
+ "youporn.com/watch/####"
+ " Got: " + url);
}
@Override
public void downloadURL(URL url, int index) {
addURLToDownload(url, getPrefix(index));
}
} | 873 |
3,882 | <gh_stars>1000+
import textwrap
from pytype import load_pytd
from pytype.pyi import parser
from pytype.pytd import mro
from pytype.pytd import visitors
from pytype.pytd.parse import parser_test_base
import unittest
class MroTest(parser_test_base.ParserTest):
"""Test pytype.pytd.mro."""
def test_dedup(self):
self.assertEqual([], mro.Dedup([]))
self.assertEqual([1], mro.Dedup([1]))
self.assertEqual([1, 2], mro.Dedup([1, 2]))
self.assertEqual([1, 2], mro.Dedup([1, 2, 1]))
self.assertEqual([1, 2], mro.Dedup([1, 1, 2, 2]))
self.assertEqual([3, 2, 1], mro.Dedup([3, 2, 1, 3]))
def test_mro_merge(self):
self.assertEqual([], mro.MROMerge([[], []]))
self.assertEqual([1], mro.MROMerge([[], [1]]))
self.assertEqual([1], mro.MROMerge([[1], []]))
self.assertEqual([1, 2], mro.MROMerge([[1], [2]]))
self.assertEqual([1, 2], mro.MROMerge([[1, 2], [2]]))
self.assertEqual([1, 2, 3, 4], mro.MROMerge([[1, 2, 3], [2, 4]]))
self.assertEqual([1, 2, 3], mro.MROMerge([[1, 2], [1, 2, 3]]))
self.assertEqual([1, 2], mro.MROMerge([[1, 1], [2, 2]]))
self.assertEqual([1, 2, 3, 4, 5, 6],
mro.MROMerge([[1, 3, 5], [2, 3, 4], [4, 5, 6]]))
self.assertEqual([1, 2, 3], mro.MROMerge([[1, 2, 1], [2, 3, 2]]))
def test_get_bases_in_mro(self):
ast = parser.parse_string(textwrap.dedent("""
from typing import Generic, TypeVar
T = TypeVar("T")
class Foo(Generic[T]): pass
class Bar(Foo[int]): pass
"""), python_version=self.python_version)
ast = ast.Visit(visitors.AdjustTypeParameters())
loader = load_pytd.Loader(None, self.python_version)
ast = loader.resolve_ast(ast)
bases = mro.GetBasesInMRO(ast.Lookup("Bar"), lookup_ast=ast)
self.assertListEqual(["Foo", "typing.Generic", "builtins.object"],
[t.name for t in bases])
if __name__ == "__main__":
unittest.main()
| 910 |
364 | package io.agora.agora_rtc_engine_example;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
import org.junit.runner.RunWith;
import dev.flutter.plugins.e2e.FlutterRunner;
@RunWith(FlutterRunner.class)
public class MainActivityTest {
@Rule
public ActivityTestRule<MainActivity> rule =
new ActivityTestRule<>(MainActivity.class);
}
| 135 |
647 | <gh_stars>100-1000
package trick.sie.utils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeModel;
/**
* Models the variable hierarchy information from an S_sie.resource file in a
* manner appropriate for driving a JTree.
*
* @author <NAME>
*/
public class SieTreeModel implements TreeModel {
/* the root */
private final SieTemplate root = new SieTemplate("", "", 0);
/* listeners to be notified of events */
private final ArrayList<TreeModelListener> treeModelListeners =
new ArrayList<TreeModelListener>();
/**
* returns the dot-delimited variable path name, excluding the final
* component, represented by <code>treePath</code>
*
* @param treePath the path
*
* @return the dot-delimited variable path name
*/
public static String getPathName(TreePath treePath) {
Object[] path = treePath.getPath();
String result = "";
for (int i = 0; i < path.length - 1; ++i) {
String pathName = path[i].toString();
if (!pathName.equals("") &&
!pathName.equals("<Trick Variables>") &&
!pathName.equals("<Dynamic Allocations>")) {
result += path[i] + ".";
}
}
return result;
}
public TreePath getPath(String variableName) {
if (variableName == null || isEmpty()) {
return null;
}
SieTemplate node = root;
TreePath treePath = new TreePath(node);
String[] elements = variableName.split("\\.");
if (variableName.startsWith("trick_")) {
node = root.children.get(0);
treePath = treePath.pathByAddingChild(node);
}
outer:
for (int i = 0; i< elements.length - 1; ) {
String element = trimIndices(elements[i]);
for (int j = 0; j < getChildCount(node); ++j) {
SieTemplate child = getChild(node, j);
if (element.equals(trimIndices(child.toString()))) {
node = child;
treePath = treePath.pathByAddingChild(node);
++i;
continue outer;
}
}
break;
}
return treePath;
}
/**
* trims trailing indices, if any, from <code>variableName</code>
*
* @param variableName the name of the variable to trim
*
* @return the trimmed name
*/
private String trimIndices(String variableName) {
int end = variableName.indexOf('[');
return end == -1 ? variableName : variableName.substring(0, end);
}
@Override
public SieTemplate getChild(Object parent, int index) {
return ((SieTemplate)parent).children.get(index);
}
@Override
public int getChildCount(Object parent) {
return ((SieTemplate)parent).children.size();
}
@Override
public int getIndexOfChild(Object parent, Object child) {
return ((SieTemplate)parent).children.indexOf(child);
}
/**
* sets the root instances
*
* @param instances root instances
*
*/
public void setRootInstances(final Collection<SieTemplate> instances) {
root.children.clear();
if (instances != null && !instances.isEmpty()) {
SieTemplate trickInstances = new SieTemplate("<Trick Variables>", "", 0);
ArrayList<SieTemplate> staticAllocations = new ArrayList<SieTemplate>();
SieTemplate dynamicAllocations = new SieTemplate("<Dynamic Allocations>", "", 0);
root.children.add(trickInstances);
for (SieTemplate instance : instances) {
if (instance.parameter.startsWith("trick_")) {
trickInstances.children.add(instance);
}
else if (instance.dynamicAllocation) {
dynamicAllocations.children.add(instance);
}
else {
staticAllocations.add(instance);
}
}
if (!dynamicAllocations.children.isEmpty()) {
root.children.add(dynamicAllocations);
}
root.children.addAll(staticAllocations);
}
fireRootChangedEvent();
}
@Override
public SieTemplate getRoot() {
return root;
}
@Override
public boolean isLeaf(Object node) {
return ((SieTemplate)node).children.isEmpty();
}
/**
* returns whether or not this tree has any variables
*
* @return <code>true</code> if this tree contains variables
*/
public boolean isEmpty() {
return root.children.isEmpty();
}
/**
* notifies all listeners that the entire tree's structure has changed
*/
protected void fireRootChangedEvent() {
TreeModelEvent treeModelEvent = new TreeModelEvent(this, new Object[] {root});
for (TreeModelListener treeModelListener : treeModelListeners) {
treeModelListener.treeStructureChanged(treeModelEvent);
}
}
@Override
public void addTreeModelListener(TreeModelListener treeModelListener) {
treeModelListeners.add(treeModelListener);
}
@Override
public void removeTreeModelListener(TreeModelListener treeModelListener) {
treeModelListeners.remove(treeModelListener);
}
@Override
public void valueForPathChanged(TreePath treePath, Object newValue) {
throw new UnsupportedOperationException();
}
}
| 2,448 |
665 | <filename>testing/MLDB-2077_merge_single_ds.py<gh_stars>100-1000
#
# MLDB-2077_merge_single_ds.py
# <NAME>, 2016-12-07
# This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
#
from mldb import mldb, MldbUnitTest, ResponseException
class Mldb2077MergeSingleDs(MldbUnitTest): # noqa
@classmethod
def setUpClass(cls):
ds = mldb.create_dataset({'id' : 'ds', 'type' : 'sparse.mutable'})
ds.record_row('1', [['colA', 'A', 0]])
ds.commit()
def test_direct_query(self):
res = mldb.query("SELECT * FROM merge(ds)")
mldb.log(res)
self.assertTableResultEquals(res, [
['_rowName', 'colA'],
['1', 'A']
])
def test_query_on_materialized_ds(self):
mldb.put('/v1/datasets/mat', {
'type' : 'merged',
'params' : {
'datasets' : [{'id' : 'ds'}]
}
})
res = mldb.query("SELECT * FROM mat")
self.assertTableResultEquals(res, [
['_rowName', 'colA'],
['1', 'A']
])
if __name__ == '__main__':
mldb.run_tests()
| 592 |
60,067 | <reponame>Hacky-DH/pytorch
#include <utility>
class Relu : public NeuralNetOperator {
public:
Relu() : NeuralNetOperator(NNKind::Relu) {}
~Relu() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Relu);
private:
};
class Conv : public NeuralNetOperator {
public:
Conv(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1},
int group = 1,
vector<int> dilations = {1, 1})
: NeuralNetOperator(NNKind::Conv),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides),
group_(group),
dilations_(dilations) {}
~Conv() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Conv);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
int getGroup() const {
return group_;
}
vector<int> getDilations() const {
return dilations_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
void setGroup(int group) {
group_ = group;
}
void setDilations(vector<int> dilations) {
dilations_ = std::move(dilations);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
int group_;
vector<int> dilations_;
};
class ConvRelu : public NeuralNetOperator {
public:
ConvRelu(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1},
int group = 1,
vector<int> dilations = {1, 1})
: NeuralNetOperator(NNKind::ConvRelu),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides),
group_(group),
dilations_(dilations) {}
ConvRelu(const Conv& conv)
: NeuralNetOperator(NNKind::ConvRelu),
kernelShape_(conv.getKernelShape()),
pads_(conv.getPads()),
strides_(conv.getStrides()),
group_(conv.getGroup()),
dilations_(conv.getDilations()) {}
~ConvRelu() {}
NOMNIGRAPH_DEFINE_NN_RTTI(ConvRelu);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
int getGroup() const {
return group_;
}
vector<int> getDilations() const {
return dilations_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
void setGroup(int group) {
group_ = group;
}
void setDilations(vector<int> dilations) {
dilations_ = std::move(dilations);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
int group_;
vector<int> dilations_;
};
class ConvTranspose : public NeuralNetOperator {
public:
ConvTranspose(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1},
int group = 1,
vector<int> dilations = {1, 1})
: NeuralNetOperator(NNKind::ConvTranspose),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides),
group_(group),
dilations_(dilations) {}
~ConvTranspose() {}
NOMNIGRAPH_DEFINE_NN_RTTI(ConvTranspose);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
int getGroup() const {
return group_;
}
vector<int> getDilations() const {
return dilations_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
void setGroup(int group) {
group_ = group;
}
void setDilations(vector<int> dilations) {
dilations_ = std::move(dilations);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
int group_;
vector<int> dilations_;
};
class AveragePool : public NeuralNetOperator {
public:
AveragePool(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1})
: NeuralNetOperator(NNKind::AveragePool),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides) {}
~AveragePool() {}
NOMNIGRAPH_DEFINE_NN_RTTI(AveragePool);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
};
class AveragePoolRelu : public NeuralNetOperator {
public:
AveragePoolRelu(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1})
: NeuralNetOperator(NNKind::AveragePoolRelu),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides) {}
AveragePoolRelu(const AveragePool& averagePool)
: NeuralNetOperator(NNKind::AveragePoolRelu),
kernelShape_(averagePool.getKernelShape()),
pads_(averagePool.getPads()),
strides_(averagePool.getStrides()) {}
~AveragePoolRelu() {}
NOMNIGRAPH_DEFINE_NN_RTTI(AveragePoolRelu);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
};
class MaxPool : public NeuralNetOperator {
public:
MaxPool(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1})
: NeuralNetOperator(NNKind::MaxPool),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides) {}
~MaxPool() {}
NOMNIGRAPH_DEFINE_NN_RTTI(MaxPool);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
};
class MaxPoolRelu : public NeuralNetOperator {
public:
MaxPoolRelu(
vector<int> kernelShape,
vector<int> pads = {0, 0},
vector<int> strides = {1, 1})
: NeuralNetOperator(NNKind::MaxPoolRelu),
kernelShape_(kernelShape),
pads_(pads),
strides_(strides) {}
MaxPoolRelu(const MaxPool& maxPool)
: NeuralNetOperator(NNKind::MaxPoolRelu),
kernelShape_(maxPool.getKernelShape()),
pads_(maxPool.getPads()),
strides_(maxPool.getStrides()) {}
~MaxPoolRelu() {}
NOMNIGRAPH_DEFINE_NN_RTTI(MaxPoolRelu);
vector<int> getKernelShape() const {
return kernelShape_;
}
vector<int> getPads() const {
return pads_;
}
vector<int> getStrides() const {
return strides_;
}
void setKernelShape(vector<int> kernelShape) {
kernelShape_ = std::move(kernelShape);
}
void setPads(vector<int> pads) {
pads_ = std::move(pads);
}
void setStrides(vector<int> strides) {
strides_ = std::move(strides);
}
private:
vector<int> kernelShape_;
vector<int> pads_;
vector<int> strides_;
};
class Sum : public NeuralNetOperator {
public:
Sum() : NeuralNetOperator(NNKind::Sum) {}
~Sum() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Sum);
private:
};
class SumRelu : public NeuralNetOperator {
public:
SumRelu() : NeuralNetOperator(NNKind::SumRelu) {}
SumRelu(const Sum& sum) : NeuralNetOperator(NNKind::SumRelu) {}
~SumRelu() {}
NOMNIGRAPH_DEFINE_NN_RTTI(SumRelu);
private:
};
class Send : public NeuralNetOperator {
public:
Send(string destination)
: NeuralNetOperator(NNKind::Send), destination_(destination) {}
~Send() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Send);
string getDestination() const {
return destination_;
}
void setDestination(string destination) {
destination_ = std::move(destination);
}
private:
string destination_;
};
class Receive : public NeuralNetOperator {
public:
Receive(string source)
: NeuralNetOperator(NNKind::Receive), source_(source) {}
~Receive() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Receive);
string getSource() const {
return source_;
}
void setSource(string source) {
source_ = std::move(source);
}
private:
string source_;
};
class BatchNormalization : public NeuralNetOperator {
public:
BatchNormalization(
float epsilon = 1e-5f,
float momentum = 0.9f,
bool spatial = true,
bool isTest = false)
: NeuralNetOperator(NNKind::BatchNormalization),
epsilon_(epsilon),
momentum_(momentum),
spatial_(spatial),
isTest_(isTest) {}
~BatchNormalization() {}
NOMNIGRAPH_DEFINE_NN_RTTI(BatchNormalization);
float getEpsilon() const {
return epsilon_;
}
float getMomentum() const {
return momentum_;
}
bool getSpatial() const {
return spatial_;
}
bool getIsTest() const {
return isTest_;
}
void setEpsilon(float epsilon) {
epsilon_ = epsilon;
}
void setMomentum(float momentum) {
momentum_ = momentum;
}
void setSpatial(bool spatial) {
spatial_ = spatial;
}
void setIsTest(bool isTest) {
isTest_ = isTest;
}
private:
float epsilon_;
float momentum_;
bool spatial_;
bool isTest_;
};
class Clip : public NeuralNetOperator {
public:
Clip(float min, float max)
: NeuralNetOperator(NNKind::Clip), min_(min), max_(max) {}
~Clip() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Clip);
float getMin() const {
return min_;
}
float getMax() const {
return max_;
}
void setMin(float min) {
min_ = min;
}
void setMax(float max) {
max_ = max;
}
private:
float min_;
float max_;
};
class FC : public NeuralNetOperator {
public:
FC(int axis = 1, int axisW = 1)
: NeuralNetOperator(NNKind::FC), axis_(axis), axisW_(axisW) {}
~FC() {}
NOMNIGRAPH_DEFINE_NN_RTTI(FC);
int getAxis() const {
return axis_;
}
int getAxisW() const {
return axisW_;
}
void setAxis(int axis) {
axis_ = axis;
}
void setAxisW(int axisW) {
axisW_ = axisW;
}
private:
int axis_;
int axisW_;
};
class GivenTensorFill : public NeuralNetOperator {
public:
GivenTensorFill() : NeuralNetOperator(NNKind::GivenTensorFill) {}
~GivenTensorFill() {}
NOMNIGRAPH_DEFINE_NN_RTTI(GivenTensorFill);
private:
};
class Concat : public NeuralNetOperator {
public:
Concat(int axis = -1, bool addAxis = false)
: NeuralNetOperator(NNKind::Concat), axis_(axis), addAxis_(addAxis) {}
~Concat() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Concat);
int getAxis() const {
return axis_;
}
bool getAddAxis() const {
return addAxis_;
}
void setAxis(int axis) {
axis_ = axis;
}
void setAddAxis(bool addAxis) {
addAxis_ = addAxis;
}
private:
int axis_;
bool addAxis_;
};
class Softmax : public NeuralNetOperator {
public:
Softmax() : NeuralNetOperator(NNKind::Softmax) {}
~Softmax() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Softmax);
private:
};
class ChannelShuffle : public NeuralNetOperator {
public:
ChannelShuffle() : NeuralNetOperator(NNKind::ChannelShuffle) {}
~ChannelShuffle() {}
NOMNIGRAPH_DEFINE_NN_RTTI(ChannelShuffle);
private:
};
class Add : public NeuralNetOperator {
public:
Add(int broadcast = 0)
: NeuralNetOperator(NNKind::Add), broadcast_(broadcast) {}
~Add() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Add);
int getBroadcast() const {
return broadcast_;
}
void setBroadcast(int broadcast) {
broadcast_ = broadcast;
}
private:
int broadcast_;
};
class Reshape : public NeuralNetOperator {
public:
Reshape() : NeuralNetOperator(NNKind::Reshape) {}
~Reshape() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Reshape);
private:
};
class Flatten : public NeuralNetOperator {
public:
Flatten() : NeuralNetOperator(NNKind::Flatten) {}
~Flatten() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Flatten);
private:
};
class CopyToOpenCL : public NeuralNetOperator {
public:
CopyToOpenCL() : NeuralNetOperator(NNKind::CopyToOpenCL) {}
~CopyToOpenCL() {}
NOMNIGRAPH_DEFINE_NN_RTTI(CopyToOpenCL);
private:
};
class CopyFromOpenCL : public NeuralNetOperator {
public:
CopyFromOpenCL() : NeuralNetOperator(NNKind::CopyFromOpenCL) {}
~CopyFromOpenCL() {}
NOMNIGRAPH_DEFINE_NN_RTTI(CopyFromOpenCL);
private:
};
class NCHW2NHWC : public NeuralNetOperator {
public:
NCHW2NHWC() : NeuralNetOperator(NNKind::NCHW2NHWC) {}
~NCHW2NHWC() {}
NOMNIGRAPH_DEFINE_NN_RTTI(NCHW2NHWC);
private:
};
class NHWC2NCHW : public NeuralNetOperator {
public:
NHWC2NCHW() : NeuralNetOperator(NNKind::NHWC2NCHW) {}
~NHWC2NCHW() {}
NOMNIGRAPH_DEFINE_NN_RTTI(NHWC2NCHW);
private:
};
class Declare : public NeuralNetOperator {
public:
Declare() : NeuralNetOperator(NNKind::Declare) {}
~Declare() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Declare);
private:
};
class Export : public NeuralNetOperator {
public:
Export() : NeuralNetOperator(NNKind::Export) {}
~Export() {}
NOMNIGRAPH_DEFINE_NN_RTTI(Export);
private:
};
| 5,718 |
2,399 | <filename>Example/Pods/SJUIKit/SJUIKit/Base/SJBaseViewController.h<gh_stars>1000+
//
// SJBaseViewController.h
// SJUIKit_Example
//
// Created by 畅三江 on 2018/12/23.
// Copyright © 2018 <EMAIL>. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SJBaseProtocols.h"
NS_ASSUME_NONNULL_BEGIN
@interface SJBaseViewController : UIViewController
/// REQUIRES SUPER
- (void)viewDidLoad NS_REQUIRES_SUPER;
- (void)viewWillAppear:(BOOL)animated NS_REQUIRES_SUPER;
- (void)viewDidAppear:(BOOL)animated NS_REQUIRES_SUPER;
- (void)viewWillDisappear:(BOOL)animated NS_REQUIRES_SUPER;
- (void)viewDidDisappear:(BOOL)animated NS_REQUIRES_SUPER;
@end
@interface SJBaseViewController (HiddenNavigationBar)<SJHiddenNavigationBarProtocol>
/// Whether to hide the navigation bar.
/// Default value is NO.
@property (nonatomic) BOOL needsNavigationBarHidden;
@end
@interface SJBaseViewController (AppearState)<SJAppearProtocol>
/// ViewController appear state.
@property (nonatomic, readonly) SJAppearState appearState;
/// Get an Observer, that will be observe appear state of ViewController.
/// You don't have to remove it.
- (id<SJAppearStateObserver>)getAppearStateObserver;
@end
/// The following methods will only be executed once of SJBaseViewController.
/// You should not call them directly.
@interface SJBaseViewController (Once)
- (void)once_viewDidAppear_method NS_REQUIRES_SUPER;
@end
@interface SJBaseViewController (StatusBarManager)
@property (nonatomic, strong, readonly) id<SJStatusBarManager> statusBarManager;
@end
NS_ASSUME_NONNULL_END
| 538 |
8,747 | <reponame>DCNick3/esp-idf
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/** @file
* @brief Bluetooth Mesh Light Client Model APIs.
*/
#ifndef _ESP_BLE_MESH_LIGHTING_MODEL_API_H_
#define _ESP_BLE_MESH_LIGHTING_MODEL_API_H_
#include "esp_ble_mesh_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_CLI
*
* @brief Define a new Light Lightness Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light Lightness Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light Lightness Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_CLI
*
* @brief Define a new Light CTL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light CTL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light CTL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_CLI
*
* @brief Define a new Light HSL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light HSL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light HSL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_CLI
*
* @brief Define a new Light xyL Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light xyL Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light xyL Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_CLI, \
NULL, cli_pub, cli_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_CLI
*
* @brief Define a new Light LC Client Model.
*
* @note This API needs to be called for each element on which
* the application needs to have a Light LC Client Model.
*
* @param cli_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param cli_data Pointer to the unique struct esp_ble_mesh_client_t.
*
* @return New Light LC Client Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_CLI(cli_pub, cli_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_CLI, \
NULL, cli_pub, cli_data)
/**
* @brief Bluetooth Mesh Light Lightness Client Model Get and Set parameters structure.
*/
/** Parameters of Light Lightness Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness actual state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lightness_set_t;
/** Parameters of Light Lightness Linear Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness linear state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lightness_linear_set_t;
/** Parameter of Light Lightness Default Set */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
} esp_ble_mesh_light_lightness_default_set_t;
/** Parameters of Light Lightness Range Set */
typedef struct {
uint16_t range_min; /*!< Value of range min field of light lightness range state */
uint16_t range_max; /*!< Value of range max field of light lightness range state */
} esp_ble_mesh_light_lightness_range_set_t;
/** Parameters of Light CTL Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t ctl_lightness; /*!< Target value of light ctl lightness state */
uint16_t ctl_temperatrue; /*!< Target value of light ctl temperature state */
int16_t ctl_delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_ctl_set_t;
/** Parameters of Light CTL Temperature Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t ctl_temperatrue; /*!< Target value of light ctl temperature state */
int16_t ctl_delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_ctl_temperature_set_t;
/** Parameters of Light CTL Temperature Range Set */
typedef struct {
uint16_t range_min; /*!< Value of temperature range min field of light ctl temperature range state */
uint16_t range_max; /*!< Value of temperature range max field of light ctl temperature range state */
} esp_ble_mesh_light_ctl_temperature_range_set_t;
/** Parameters of Light CTL Default Set */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t temperature; /*!< Value of light temperature default state */
int16_t delta_uv; /*!< Value of light delta UV default state */
} esp_ble_mesh_light_ctl_default_set_t;
/** Parameters of Light HSL Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness; /*!< Target value of light hsl lightness state */
uint16_t hsl_hue; /*!< Target value of light hsl hue state */
uint16_t hsl_saturation; /*!< Target value of light hsl saturation state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_set_t;
/** Parameters of Light HSL Hue Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hue; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_hue_set_t;
/** Parameters of Light HSL Saturation Set */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t saturation; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_hsl_saturation_set_t;
/** Parameters of Light HSL Default Set */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t hue; /*!< Value of light hue default state */
uint16_t saturation; /*!< Value of light saturation default state */
} esp_ble_mesh_light_hsl_default_set_t;
/** Parameters of Light HSL Range Set */
typedef struct {
uint16_t hue_range_min; /*!< Value of hue range min field of light hsl hue range state */
uint16_t hue_range_max; /*!< Value of hue range max field of light hsl hue range state */
uint16_t saturation_range_min; /*!< Value of saturation range min field of light hsl saturation range state */
uint16_t saturation_range_max; /*!< Value of saturation range max field of light hsl saturation range state */
} esp_ble_mesh_light_hsl_range_set_t;
/** Parameters of Light xyL Set */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t xyl_lightness; /*!< The target value of the Light xyL Lightness state */
uint16_t xyl_x; /*!< The target value of the Light xyL x state */
uint16_t xyl_y; /*!< The target value of the Light xyL y state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_xyl_set_t;
/** Parameters of Light xyL Default Set */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
uint16_t xyl_x; /*!< The value of the Light xyL x Default state */
uint16_t xyl_y; /*!< The value of the Light xyL y Default state */
} esp_ble_mesh_light_xyl_default_set_t;
/** Parameters of Light xyL Range Set */
typedef struct {
uint16_t xyl_x_range_min; /*!< The value of the xyL x Range Min field of the Light xyL x Range state */
uint16_t xyl_x_range_max; /*!< The value of the xyL x Range Max field of the Light xyL x Range state */
uint16_t xyl_y_range_min; /*!< The value of the xyL y Range Min field of the Light xyL y Range state */
uint16_t xyl_y_range_max; /*!< The value of the xyL y Range Max field of the Light xyL y Range state */
} esp_ble_mesh_light_xyl_range_set_t;
/** Parameter of Light LC Mode Set */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Mode state */
} esp_ble_mesh_light_lc_mode_set_t;
/** Parameter of Light LC OM Set */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Occupancy Mode state */
} esp_ble_mesh_light_lc_om_set_t;
/** Parameters of Light LC Light OnOff Set */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint8_t light_onoff; /*!< The target value of the Light LC Light OnOff state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_light_lc_light_onoff_set_t;
/** Parameter of Light LC Property Get */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
} esp_ble_mesh_light_lc_property_get_t;
/** Parameters of Light LC Property Set */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
struct net_buf_simple *property_value; /*!< Raw value for the Light LC Property */
} esp_ble_mesh_light_lc_property_set_t;
/**
* @brief Lighting Client Model get message union
*/
typedef union {
esp_ble_mesh_light_lc_property_get_t lc_property_get; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_GET */
} esp_ble_mesh_light_client_get_state_t;
/**
* @brief Lighting Client Model set message union
*/
typedef union {
esp_ble_mesh_light_lightness_set_t lightness_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET_UNACK */
esp_ble_mesh_light_lightness_linear_set_t lightness_linear_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET_UNACK */
esp_ble_mesh_light_lightness_default_set_t lightness_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET_UNACK */
esp_ble_mesh_light_lightness_range_set_t lightness_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET_UNACK */
esp_ble_mesh_light_ctl_set_t ctl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET_UNACK */
esp_ble_mesh_light_ctl_temperature_set_t ctl_temperature_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET_UNACK */
esp_ble_mesh_light_ctl_temperature_range_set_t ctl_temperature_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACK */
esp_ble_mesh_light_ctl_default_set_t ctl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_hsl_set_t hsl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET_UNACK */
esp_ble_mesh_light_hsl_hue_set_t hsl_hue_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET_UNACK */
esp_ble_mesh_light_hsl_saturation_set_t hsl_saturation_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET_UNACK */
esp_ble_mesh_light_hsl_default_set_t hsl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_hsl_range_set_t hsl_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET_UNACK */
esp_ble_mesh_light_xyl_set_t xyl_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET_UNACK */
esp_ble_mesh_light_xyl_default_set_t xyl_default_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET_UNACK */
esp_ble_mesh_light_xyl_range_set_t xyl_range_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET_UNACK */
esp_ble_mesh_light_lc_mode_set_t lc_mode_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET_UNACK */
esp_ble_mesh_light_lc_om_set_t lc_om_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET_UNACK */
esp_ble_mesh_light_lc_light_onoff_set_t lc_light_onoff_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET_UNACK */
esp_ble_mesh_light_lc_property_set_t lc_property_set; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET & ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET_UNACK */
} esp_ble_mesh_light_client_set_state_t;
/**
* @brief Bluetooth Mesh Light Lightness Client Model Get and Set callback parameters structure.
*/
/** Parameters of Light Lightness Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_lightness; /*!< Current value of light lightness actual state */
uint16_t target_lightness; /*!< Target value of light lightness actual state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lightness_status_cb_t;
/** Parameters of Light Lightness Linear Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_lightness; /*!< Current value of light lightness linear state */
uint16_t target_lightness; /*!< Target value of light lightness linear state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lightness_linear_status_cb_t;
/** Parameter of Light Lightness Last Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Last state */
} esp_ble_mesh_light_lightness_last_status_cb_t;
/** Parameter of Light Lightness Default Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness default State */
} esp_ble_mesh_light_lightness_default_status_cb_t;
/** Parameters of Light Lightness Range Status */
typedef struct {
uint8_t status_code; /*!< Status Code for the request message */
uint16_t range_min; /*!< Value of range min field of light lightness range state */
uint16_t range_max; /*!< Value of range max field of light lightness range state */
} esp_ble_mesh_light_lightness_range_status_cb_t;
/** Parameters of Light CTL Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_ctl_lightness; /*!< Current value of light ctl lightness state */
uint16_t present_ctl_temperature; /*!< Current value of light ctl temperature state */
uint16_t target_ctl_lightness; /*!< Target value of light ctl lightness state (optional) */
uint16_t target_ctl_temperature; /*!< Target value of light ctl temperature state (C.1) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_ctl_status_cb_t;
/** Parameters of Light CTL Temperature Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_ctl_temperature; /*!< Current value of light ctl temperature state */
uint16_t present_ctl_delta_uv; /*!< Current value of light ctl delta UV state */
uint16_t target_ctl_temperature; /*!< Target value of light ctl temperature state (optional) */
uint16_t target_ctl_delta_uv; /*!< Target value of light ctl delta UV state (C.1) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_ctl_temperature_status_cb_t;
/** Parameters of Light CTL Temperature Range Status */
typedef struct {
uint8_t status_code; /*!< Status code for the request message */
uint16_t range_min; /*!< Value of temperature range min field of light ctl temperature range state */
uint16_t range_max; /*!< Value of temperature range max field of light ctl temperature range state */
} esp_ble_mesh_light_ctl_temperature_range_status_cb_t;
/** Parameters of Light CTL Default Status */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t temperature; /*!< Value of light temperature default state */
int16_t delta_uv; /*!< Value of light delta UV default state */
} esp_ble_mesh_light_ctl_default_status_cb_t;
/** Parameters of Light HSL Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness; /*!< Current value of light hsl lightness state */
uint16_t hsl_hue; /*!< Current value of light hsl hue state */
uint16_t hsl_saturation; /*!< Current value of light hsl saturation state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_hsl_status_cb_t;
/** Parameters of Light HSL Target Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hsl_lightness_target; /*!< Target value of light hsl lightness state */
uint16_t hsl_hue_target; /*!< Target value of light hsl hue state */
uint16_t hsl_saturation_target; /*!< Target value of light hsl saturation state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_hsl_target_status_cb_t;
/** Parameters of Light HSL Hue Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_hue; /*!< Current value of light hsl hue state */
uint16_t target_hue; /*!< Target value of light hsl hue state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_hsl_hue_status_cb_t;
/** Parameters of Light HSL Saturation Status */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t present_saturation; /*!< Current value of light hsl saturation state */
uint16_t target_saturation; /*!< Target value of light hsl saturation state (optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_hsl_saturation_status_cb_t;
/** Parameters of Light HSL Default Status */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t hue; /*!< Value of light hue default state */
uint16_t saturation; /*!< Value of light saturation default state */
} esp_ble_mesh_light_hsl_default_status_cb_t;
/** Parameters of Light HSL Range Status */
typedef struct {
uint8_t status_code; /*!< Status code for the request message */
uint16_t hue_range_min; /*!< Value of hue range min field of light hsl hue range state */
uint16_t hue_range_max; /*!< Value of hue range max field of light hsl hue range state */
uint16_t saturation_range_min; /*!< Value of saturation range min field of light hsl saturation range state */
uint16_t saturation_range_max; /*!< Value of saturation range max field of light hsl saturation range state */
} esp_ble_mesh_light_hsl_range_status_cb_t;
/** Parameters of Light xyL Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t xyl_lightness; /*!< The present value of the Light xyL Lightness state */
uint16_t xyl_x; /*!< The present value of the Light xyL x state */
uint16_t xyl_y; /*!< The present value of the Light xyL y state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_xyl_status_cb_t;
/** Parameters of Light xyL Target Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t target_xyl_lightness; /*!< The target value of the Light xyL Lightness state */
uint16_t target_xyl_x; /*!< The target value of the Light xyL x state */
uint16_t target_xyl_y; /*!< The target value of the Light xyL y state */
uint8_t remain_time; /*!< Time to complete state transition (optional) */
} esp_ble_mesh_light_xyl_target_status_cb_t;
/** Parameters of Light xyL Default Status */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
uint16_t xyl_x; /*!< The value of the Light xyL x Default state */
uint16_t xyl_y; /*!< The value of the Light xyL y Default state */
} esp_ble_mesh_light_xyl_default_status_cb_t;
/** Parameters of Light xyL Range Status */
typedef struct {
uint8_t status_code; /*!< Status Code for the requesting message */
uint16_t xyl_x_range_min; /*!< The value of the xyL x Range Min field of the Light xyL x Range state */
uint16_t xyl_x_range_max; /*!< The value of the xyL x Range Max field of the Light xyL x Range state */
uint16_t xyl_y_range_min; /*!< The value of the xyL y Range Min field of the Light xyL y Range state */
uint16_t xyl_y_range_max; /*!< The value of the xyL y Range Max field of the Light xyL y Range state */
} esp_ble_mesh_light_xyl_range_status_cb_t;
/** Parameter of Light LC Mode Status */
typedef struct {
uint8_t mode; /*!< The present value of the Light LC Mode state */
} esp_ble_mesh_light_lc_mode_status_cb_t;
/** Parameter of Light LC OM Status */
typedef struct {
uint8_t mode; /*!< The present value of the Light LC Occupancy Mode state */
} esp_ble_mesh_light_lc_om_status_cb_t;
/** Parameters of Light LC Light OnOff Status */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint8_t present_light_onoff; /*!< The present value of the Light LC Light OnOff state */
uint8_t target_light_onoff; /*!< The target value of the Light LC Light OnOff state (Optional) */
uint8_t remain_time; /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_light_lc_light_onoff_status_cb_t;
/** Parameters of Light LC Property Status */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
struct net_buf_simple *property_value; /*!< Raw value for the Light LC Property */
} esp_ble_mesh_light_lc_property_status_cb_t;
/**
* @brief Lighting Client Model received message union
*/
typedef union {
esp_ble_mesh_light_lightness_status_cb_t lightness_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_STATUS */
esp_ble_mesh_light_lightness_linear_status_cb_t lightness_linear_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_STATUS */
esp_ble_mesh_light_lightness_last_status_cb_t lightness_last_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LAST_STATUS */
esp_ble_mesh_light_lightness_default_status_cb_t lightness_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_STATUS */
esp_ble_mesh_light_lightness_range_status_cb_t lightness_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_STATUS */
esp_ble_mesh_light_ctl_status_cb_t ctl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_STATUS */
esp_ble_mesh_light_ctl_temperature_status_cb_t ctl_temperature_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_STATUS */
esp_ble_mesh_light_ctl_temperature_range_status_cb_t ctl_temperature_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_STATUS */
esp_ble_mesh_light_ctl_default_status_cb_t ctl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_STATUS */
esp_ble_mesh_light_hsl_status_cb_t hsl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_STATUS */
esp_ble_mesh_light_hsl_target_status_cb_t hsl_target_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_TARGET_STATUS */
esp_ble_mesh_light_hsl_hue_status_cb_t hsl_hue_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_STATUS */
esp_ble_mesh_light_hsl_saturation_status_cb_t hsl_saturation_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_STATUS */
esp_ble_mesh_light_hsl_default_status_cb_t hsl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_STATUS */
esp_ble_mesh_light_hsl_range_status_cb_t hsl_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_STATUS */
esp_ble_mesh_light_xyl_status_cb_t xyl_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_STATUS */
esp_ble_mesh_light_xyl_target_status_cb_t xyl_target_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_TARGET_STATUS */
esp_ble_mesh_light_xyl_default_status_cb_t xyl_default_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_STATUS */
esp_ble_mesh_light_xyl_range_status_cb_t xyl_range_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_STATUS */
esp_ble_mesh_light_lc_mode_status_cb_t lc_mode_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_STATUS */
esp_ble_mesh_light_lc_om_status_cb_t lc_om_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_STATUS */
esp_ble_mesh_light_lc_light_onoff_status_cb_t lc_light_onoff_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_STATUS */
esp_ble_mesh_light_lc_property_status_cb_t lc_property_status; /*!< For ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_STATUS */
} esp_ble_mesh_light_client_status_cb_t;
/** Lighting Client Model callback parameters */
typedef struct {
int error_code; /*!< Appropriate error code */
esp_ble_mesh_client_common_param_t *params; /*!< The client common parameters. */
esp_ble_mesh_light_client_status_cb_t status_cb; /*!< The light status message callback values */
} esp_ble_mesh_light_client_cb_param_t;
/** This enum value is the event of Lighting Client Model */
typedef enum {
ESP_BLE_MESH_LIGHT_CLIENT_GET_STATE_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_SET_STATE_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_PUBLISH_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_TIMEOUT_EVT,
ESP_BLE_MESH_LIGHT_CLIENT_EVT_MAX,
} esp_ble_mesh_light_client_cb_event_t;
/**
* @brief Bluetooth Mesh Light Client Model function.
*/
/**
* @brief Lighting Client Model callback function type
* @param event: Event type
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_light_client_cb_t)(esp_ble_mesh_light_client_cb_event_t event,
esp_ble_mesh_light_client_cb_param_t *param);
/**
* @brief Register BLE Mesh Light Client Model callback.
*
* @param[in] callback: pointer to the callback function.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_register_light_client_callback(esp_ble_mesh_light_client_cb_t callback);
/**
* @brief Get the value of Light Server Model states using the Light Client Model get messages.
*
* @note If you want to know the opcodes and corresponding meanings accepted by this API,
* please refer to esp_ble_mesh_light_message_opcode_t in esp_ble_mesh_defs.h
*
* @param[in] params: Pointer to BLE Mesh common client parameters.
* @param[in] get_state: Pointer of light get message value.
* Shall not be set to NULL.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_get_state_t *get_state);
/**
* @brief Set the value of Light Server Model states using the Light Client Model set messages.
*
* @note If you want to know the opcodes and corresponding meanings accepted by this API,
* please refer to esp_ble_mesh_light_message_opcode_t in esp_ble_mesh_defs.h
*
* @param[in] params: Pointer to BLE Mesh common client parameters.
* @param[in] set_state: Pointer of light set message value.
* Shall not be set to NULL.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t *params,
esp_ble_mesh_light_client_set_state_t *set_state);
/**
* @brief Lighting Server Models related context.
*/
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SRV
*
* @brief Define a new Light Lightness Server Model.
*
* @note 1. The Light Lightness Server model extends the Generic Power OnOff
* Server model and the Generic Level Server model. When this model
* is present on an Element, the corresponding Light Lightness Setup
* Server model shall also be present.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lightness_srv_t.
*
* @return New Light Lightness Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SETUP_SRV
*
* @brief Define a new Light Lightness Setup Server Model.
*
* @note 1. The Light Lightness Setup Server model extends the Light Lightness
* Server model and the Generic Power OnOff Setup Server model.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lightness_setup_srv_t.
*
* @return New Light Lightness Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LIGHTNESS_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_SRV
*
* @brief Define a new Light CTL Server Model.
*
* @note 1. The Light CTL Server model extends the Light Lightness Server model.
* When this model is present on an Element, the corresponding Light
* CTL Temperature Server model and the corresponding Light CTL Setup
* Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. The model requires two elements: the main element and the Temperature
* element. The Temperature element contains the corresponding Light CTL
* Temperature Server model and an instance of a Generic Level state
* bound to the Light CTL Temperature state on the Temperature element.
* The Light CTL Temperature state on the Temperature element is bound to
* the Light CTL state on the main element.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_srv_t.
*
* @return New Light CTL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_SETUP_SRV
*
* @brief Define a new Light CTL Setup Server Model.
*
* @note 1. The Light CTL Setup Server model extends the Light CTL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_setup_srv_t.
*
* @return New Light CTL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_CTL_TEMP_SRV
*
* @brief Define a new Light CTL Temperature Server Model.
*
* @note 1. The Light CTL Temperature Server model extends the Generic Level
* Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_ctl_temp_srv_t.
*
* @return New Light CTL Temperature Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_CTL_TEMP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SRV
*
* @brief Define a new Light HSL Server Model.
*
* @note 1. The Light HSL Server model extends the Light Lightness Server model. When
* this model is present on an Element, the corresponding Light HSL Hue
* Server model and the corresponding Light HSL Saturation Server model and
* the corresponding Light HSL Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. The model requires three elements: the main element and the Hue element
* and the Saturation element. The Hue element contains the corresponding
* Light HSL Hue Server model and an instance of a Generic Level state bound
* to the Light HSL Hue state on the Hue element. The Saturation element
* contains the corresponding Light HSL Saturation Server model and an
* instance of a Generic Level state bound to the Light HSL Saturation state
* on the Saturation element. The Light HSL Hue state on the Hue element is
* bound to the Light HSL state on the main element and the Light HSL
* Saturation state on the Saturation element is bound to the Light HSL state
* on the main element.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_srv_t.
*
* @return New Light HSL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SETUP_SRV
*
* @brief Define a new Light HSL Setup Server Model.
*
* @note 1. The Light HSL Setup Server model extends the Light HSL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_setup_srv_t.
*
* @return New Light HSL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_HUE_SRV
*
* @brief Define a new Light HSL Hue Server Model.
*
* @note 1. The Light HSL Hue Server model extends the Generic Level Server model.
* This model is associated with the Light HSL Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_hue_srv_t.
*
* @return New Light HSL Hue Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_HUE_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_HSL_SAT_SRV
*
* @brief Define a new Light HSL Saturation Server Model.
*
* @note 1. The Light HSL Saturation Server model extends the Generic Level Server
* model. This model is associated with the Light HSL Server model.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_hsl_sat_srv_t.
*
* @return New Light HSL Saturation Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_HSL_SAT_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_SRV
*
* @brief Define a new Light xyL Server Model.
*
* @note 1. The Light xyL Server model extends the Light Lightness Server model.
* When this model is present on an Element, the corresponding Light xyL
* Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_xyl_srv_t.
*
* @return New Light xyL Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_XYL_SETUP_SRV
*
* @brief Define a new Light xyL Setup Server Model.
*
* @note 1. The Light xyL Setup Server model extends the Light xyL Server and
* the Light Lightness Setup Server.
* 2. This model shall support model subscription.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_xyl_setup_srv_t.
*
* @return New Light xyL Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_XYL_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_SRV
*
* @brief Define a new Light LC Server Model.
*
* @note 1. The Light LC (Lightness Control) Server model extends the Light
* Lightness Server model and the Generic OnOff Server model. When
* this model is present on an Element, the corresponding Light LC
* Setup Server model shall also be present.
* 2. This model shall support model publication and model subscription.
* 3. This model may be used to represent an element that is a client to
* a Sensor Server model and controls the Light Lightness Actual state
* via defined state bindings.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lc_srv_t.
*
* @return New Light LC Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SRV, \
NULL, srv_pub, srv_data)
/** @def ESP_BLE_MESH_MODEL_LIGHT_LC_SETUP_SRV
*
* @brief Define a new Light LC Setup Server Model.
*
* @note 1. The Light LC (Lightness Control) Setup model extends the Light LC
* Server model.
* 2. This model shall support model publication and model subscription.
* 3. This model may be used to configure setup parameters for the Light
* LC Server model.
*
* @param srv_pub Pointer to the unique struct esp_ble_mesh_model_pub_t.
* @param srv_data Pointer to the unique struct esp_ble_mesh_light_lc_setup_srv_t.
*
* @return New Light LC Setup Server Model instance.
*/
#define ESP_BLE_MESH_MODEL_LIGHT_LC_SETUP_SRV(srv_pub, srv_data) \
ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SETUP_SRV, \
NULL, srv_pub, srv_data)
/** Parameters of Light Lightness state */
typedef struct {
uint16_t lightness_linear; /*!< The present value of Light Lightness Linear state */
uint16_t target_lightness_linear; /*!< The target value of Light Lightness Linear state */
uint16_t lightness_actual; /*!< The present value of Light Lightness Actual state */
uint16_t target_lightness_actual; /*!< The target value of Light Lightness Actual state */
uint16_t lightness_last; /*!< The value of Light Lightness Last state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint8_t status_code; /*!< The status code of setting Light Lightness Range state */
uint16_t lightness_range_min; /*!< The minimum value of Light Lightness Range state */
uint16_t lightness_range_max; /*!< The maximum value of Light Lightness Range state */
} esp_ble_mesh_light_lightness_state_t;
/** User data of Light Lightness Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting Lightness Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_lightness_state_t *state; /*!< Parameters of the Light Lightness state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t actual_transition; /*!< Parameters of state transition */
esp_ble_mesh_state_transition_t linear_transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness_actual; /*!< Delta change value of lightness actual state transition */
int32_t tt_delta_lightness_linear; /*!< Delta change value of lightness linear state transition */
} esp_ble_mesh_light_lightness_srv_t;
/** User data of Light Lightness Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting Lightness Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_lightness_state_t *state; /*!< Parameters of the Light Lightness state */
} esp_ble_mesh_light_lightness_setup_srv_t;
/** Parameters of Light CTL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light CTL Lightness state */
uint16_t target_lightness; /*!< The target value of Light CTL Lightness state */
uint16_t temperature; /*!< The present value of Light CTL Temperature state */
uint16_t target_temperature; /*!< The target value of Light CTL Temperature state */
int16_t delta_uv; /*!< The present value of Light CTL Delta UV state */
int16_t target_delta_uv; /*!< The target value of Light CTL Delta UV state */
uint8_t status_code; /*!< The statue code of setting Light CTL Temperature Range state */
uint16_t temperature_range_min; /*!< The minimum value of Light CTL Temperature Range state */
uint16_t temperature_range_max; /*!< The maximum value of Light CTL Temperature Range state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t temperature_default; /*!< The value of Light CTL Temperature Default state */
int16_t delta_uv_default; /*!< The value of Light CTL Delta UV Default state */
} esp_ble_mesh_light_ctl_state_t;
/** User data of Light CTL Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness; /*!< Delta change value of lightness state transition */
int32_t tt_delta_temperature; /*!< Delta change value of temperature state transition */
int32_t tt_delta_delta_uv; /*!< Delta change value of delta uv state transition */
} esp_ble_mesh_light_ctl_srv_t;
/** User data of Light CTL Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
} esp_ble_mesh_light_ctl_setup_srv_t;
/** User data of Light CTL Temperature Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting CTL Temperature Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_ctl_state_t *state; /*!< Parameters of the Light CTL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_temperature; /*!< Delta change value of temperature state transition */
int32_t tt_delta_delta_uv; /*!< Delta change value of delta uv state transition */
} esp_ble_mesh_light_ctl_temp_srv_t;
/** Parameters of Light HSL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light HSL Lightness state */
uint16_t target_lightness; /*!< The target value of Light HSL Lightness state */
uint16_t hue; /*!< The present value of Light HSL Hue state */
uint16_t target_hue; /*!< The target value of Light HSL Hue state */
uint16_t saturation; /*!< The present value of Light HSL Saturation state */
uint16_t target_saturation; /*!< The target value of Light HSL Saturation state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t hue_default; /*!< The value of Light HSL Hue Default state */
uint16_t saturation_default; /*!< The value of Light HSL Saturation Default state */
uint8_t status_code; /*!< The status code of setting Light HSL Hue & Saturation Range state */
uint16_t hue_range_min; /*!< The minimum value of Light HSL Hue Range state */
uint16_t hue_range_max; /*!< The maximum value of Light HSL Hue Range state */
uint16_t saturation_range_min; /*!< The minimum value of Light HSL Saturation state */
uint16_t saturation_range_max; /*!< The maximum value of Light HSL Saturation state */
} esp_ble_mesh_light_hsl_state_t;
/** User data of Light HSL Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness; /*!< Delta change value of lightness state transition */
int32_t tt_delta_hue; /*!< Delta change value of hue state transition */
int32_t tt_delta_saturation; /*!< Delta change value of saturation state transition */
} esp_ble_mesh_light_hsl_srv_t;
/** User data of Light HSL Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
} esp_ble_mesh_light_hsl_setup_srv_t;
/** User data of Light HSL Hue Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Hue Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_hue; /*!< Delta change value of hue state transition */
} esp_ble_mesh_light_hsl_hue_srv_t;
/** User data of Light HSL Saturation Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting HSL Saturation Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_hsl_state_t *state; /*!< Parameters of the Light HSL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_saturation; /*!< Delta change value of saturation state transition */
} esp_ble_mesh_light_hsl_sat_srv_t;
/** Parameters of Light xyL state */
typedef struct {
uint16_t lightness; /*!< The present value of Light xyL Lightness state */
uint16_t target_lightness; /*!< The target value of Light xyL Lightness state */
uint16_t x; /*!< The present value of Light xyL x state */
uint16_t target_x; /*!< The target value of Light xyL x state */
uint16_t y; /*!< The present value of Light xyL y state */
uint16_t target_y; /*!< The target value of Light xyL y state */
uint16_t lightness_default; /*!< The value of Light Lightness Default state */
uint16_t x_default; /*!< The value of Light xyL x Default state */
uint16_t y_default; /*!< The value of Light xyL y Default state */
uint8_t status_code; /*!< The status code of setting Light xyL x & y Range state */
uint16_t x_range_min; /*!< The minimum value of Light xyL x Range state */
uint16_t x_range_max; /*!< The maximum value of Light xyL x Range state */
uint16_t y_range_min; /*!< The minimum value of Light xyL y Range state */
uint16_t y_range_max; /*!< The maximum value of Light xyL y Range state */
} esp_ble_mesh_light_xyl_state_t;
/** User data of Light xyL Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting xyL Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_xyl_state_t *state; /*!< Parameters of the Light xyL state */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
int32_t tt_delta_lightness; /*!< Delta change value of lightness state transition */
int32_t tt_delta_x; /*!< Delta change value of x state transition */
int32_t tt_delta_y; /*!< Delta change value of y state transition */
} esp_ble_mesh_light_xyl_srv_t;
/** User data of Light xyL Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting xyL Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_xyl_state_t *state; /*!< Parameters of the Light xyL state */
} esp_ble_mesh_light_xyl_setup_srv_t;
/** Parameters of Light LC states */
typedef struct {
/**
* 0b0 The controller is turned off.
* - The binding with the Light Lightness state is disabled.
* 0b1 The controller is turned on.
* - The binding with the Light Lightness state is enabled.
*/
uint32_t mode : 1, /*!< The value of Light LC Mode state */
occupancy_mode : 1, /*!< The value of Light LC Occupancy Mode state */
light_onoff : 1, /*!< The present value of Light LC Light OnOff state */
target_light_onoff : 1, /*!< The target value of Light LC Light OnOff state */
occupancy : 1, /*!< The value of Light LC Occupancy state */
ambient_luxlevel : 24; /*!< The value of Light LC Ambient LuxLevel state */
/**
* 1. Light LC Linear Output = max((Lightness Out)^2/65535, Regulator Output)
* 2. If the Light LC Mode state is set to 0b1, the binding is enabled and upon
* a change of the Light LC Linear Output state, the following operation
* shall be performed:
* Light Lightness Linear = Light LC Linear Output
* 3. If the Light LC Mode state is set to 0b0, the binding is disabled (i.e.,
* upon a change of the Light LC Linear Output state, no operation on the
* Light Lightness Linear state is performed).
*/
uint16_t linear_output; /*!< The value of Light LC Linear Output state */
} esp_ble_mesh_light_lc_state_t;
/**
* Parameters of Light Property states.
* The Light LC Property states are read / write states that determine the
* configuration of a Light Lightness Controller. Each state is represented
* by a device property and is controlled by Light LC Property messages.
*/
typedef struct {
/**
* A timing state that determines the delay for changing the Light LC
* Occupancy state upon receiving a Sensor Status message from an
* occupancy sensor.
*/
uint32_t time_occupancy_delay; /*!< The value of Light LC Time Occupancy Delay state */
/**
* A timing state that determines the time the controlled lights fade
* to the level determined by the Light LC Lightness On state.
*/
uint32_t time_fade_on; /*!< The value of Light LC Time Fade On state */
/**
* A timing state that determines the time the controlled lights stay
* at the level determined by the Light LC Lightness On state.
*/
uint32_t time_run_on; /*!< The value of Light LC Time Run On state */
/**
* A timing state that determines the time the controlled lights fade
* from the level determined by the Light LC Lightness On state to the
* level determined by the Light Lightness Prolong state.
*/
uint32_t time_fade; /*!< The value of Light LC Time Fade state */
/**
* A timing state that determines the time the controlled lights stay at
* the level determined by the Light LC Lightness Prolong state.
*/
uint32_t time_prolong; /*!< The value of Light LC Time Prolong state */
/**
* A timing state that determines the time the controlled lights fade from
* the level determined by the Light LC Lightness Prolong state to the level
* determined by the Light LC Lightness Standby state when the transition is
* automatic.
*/
uint32_t time_fade_standby_auto; /*!< The value of Light LC Time Fade Standby Auto state */
/**
* A timing state that determines the time the controlled lights fade from
* the level determined by the Light LC Lightness Prolong state to the level
* determined by the Light LC Lightness Standby state when the transition is
* triggered by a change in the Light LC Light OnOff state.
*/
uint32_t time_fade_standby_manual; /*!< The value of Light LC Time Fade Standby Manual state */
/**
* A lightness state that determines the perceptive light lightness at the
* Occupancy and Run internal controller states.
*/
uint16_t lightness_on; /*!< The value of Light LC Lightness On state */
/**
* A lightness state that determines the light lightness at the Prolong
* internal controller state.
*/
uint16_t lightness_prolong; /*!< The value of Light LC Lightness Prolong state */
/**
* A lightness state that determines the light lightness at the Standby
* internal controller state.
*/
uint16_t lightness_standby; /*!< The value of Light LC Lightness Standby state */
/**
* A uint16 state representing the Ambient LuxLevel level that determines
* if the controller transitions from the Light Control Standby state.
*/
uint16_t ambient_luxlevel_on; /*!< The value of Light LC Ambient LuxLevel On state */
/**
* A uint16 state representing the required Ambient LuxLevel level in the
* Prolong state.
*/
uint16_t ambient_luxlevel_prolong; /*!< The value of Light LC Ambient LuxLevel Prolong state */
/**
* A uint16 state representing the required Ambient LuxLevel level in the
* Standby state.
*/
uint16_t ambient_luxlevel_standby; /*!< The value of Light LC Ambient LuxLevel Standby state */
/**
* A float32 state representing the integral coefficient that determines the
* integral part of the equation defining the output of the Light LC PI
* Feedback Regulator, when Light LC Ambient LuxLevel is less than LuxLevel
* Out. Valid range: 0.0 ~ 1000.0. The default value is 250.0.
*/
float regulator_kiu; /*!< The value of Light LC Regulator Kiu state */
/**
* A float32 state representing the integral coefficient that determines the
* integral part of the equation defining the output of the Light LC PI
* Feedback Regulator, when Light LC Ambient LuxLevel is greater than or equal
* to the value of the LuxLevel Out state. Valid range: 0.0 ~ 1000.0. The
* default value is 25.0.
*/
float regulator_kid; /*!< The value of Light LC Regulator Kid state */
/**
* A float32 state representing the proportional coefficient that determines
* the proportional part of the equation defining the output of the Light LC
* PI Feedback Regulator, when Light LC Ambient LuxLevel is less than the value
* of the LuxLevel Out state. Valid range: 0.0 ~ 1000.0. The default value is 80.0.
*/
float regulator_kpu; /*!< The value of Light LC Regulator Kpu state */
/**
* A float32 state representing the proportional coefficient that determines
* the proportional part of the equation defining the output of the Light LC PI
* Feedback Regulator, when Light LC Ambient LuxLevel is greater than or equal
* to the value of the LuxLevel Out state. Valid range: 0.0 ~ 1000.0. The default
* value is 80.0.
*/
float regulator_kpd; /*!< The value of Light LC Regulator Kpd state */
/**
* A int8 state representing the percentage accuracy of the Light LC PI Feedback
* Regulator. Valid range: 0.0 ~ 100.0. The default value is 2.0.
*/
int8_t regulator_accuracy; /*!< The value of Light LC Regulator Accuracy state */
/**
* If the message Raw field contains a Raw Value for the Time Since Motion
* Sensed device property, which represents a value less than or equal to
* the value of the Light LC Occupancy Delay state, it shall delay setting
* the Light LC Occupancy state to 0b1 by the difference between the value
* of the Light LC Occupancy Delay state and the received Time Since Motion
* value.
*/
uint32_t set_occupancy_to_1_delay; /*!< The value of the difference between value of the
Light LC Occupancy Delay state and the received
Time Since Motion value */
} esp_ble_mesh_light_lc_property_state_t;
/** This enum value is the Light LC State Machine states */
typedef enum {
ESP_BLE_MESH_LC_OFF,
ESP_BLE_MESH_LC_STANDBY,
ESP_BLE_MESH_LC_FADE_ON,
ESP_BLE_MESH_LC_RUN,
ESP_BLE_MESH_LC_FADE,
ESP_BLE_MESH_LC_PROLONG,
ESP_BLE_MESH_LC_FADE_STANDBY_AUTO,
ESP_BLE_MESH_LC_FADE_STANDBY_MANUAL,
} esp_ble_mesh_lc_state_t;
/** Parameters of Light LC state machine */
typedef struct {
/**
* The Fade On, Fade, Fade Standby Auto, and Fade Standby Manual states are
* transition states that define the transition of the Lightness Out and
* LuxLevel Out states. This transition can be started as a result of the
* Light LC State Machine change or as a result of receiving the Light LC
* Light OnOff Set or Light LC Light Set Unacknowledged message.
*/
struct {
uint8_t fade_on; /*!< The value of transition time of Light LC Time Fade On */
uint8_t fade; /*!< The value of transition time of Light LC Time Fade */
uint8_t fade_standby_auto; /*!< The value of transition time of Light LC Time Fade Standby Auto */
uint8_t fade_standby_manual; /*!< The value of transition time of Light LC Time Fade Standby Manual */
} trans_time; /*!< The value of transition time */
esp_ble_mesh_lc_state_t state; /*!< The value of Light LC state machine state */
struct k_delayed_work timer; /*!< Timer of Light LC state machine */
} esp_ble_mesh_light_lc_state_machine_t;
/** Parameters of Light Lightness controller */
typedef struct {
esp_ble_mesh_light_lc_state_t state; /*!< Parameters of Light LC state */
esp_ble_mesh_light_lc_property_state_t prop_state; /*!< Parameters of Light LC Property state */
esp_ble_mesh_light_lc_state_machine_t state_machine; /*!< Parameters of Light LC state machine */
} esp_ble_mesh_light_control_t;
/** User data of Light LC Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting LC Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_control_t *lc; /*!< Parameters of the Light controller */
esp_ble_mesh_last_msg_info_t last; /*!< Parameters of the last received set message */
esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
} esp_ble_mesh_light_lc_srv_t;
/** User data of Light LC Setup Server Model */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to the Lighting LC Setup Server Model. Initialized internally. */
esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl; /*!< Response control of the server model received messages */
esp_ble_mesh_light_control_t *lc; /*!< Parameters of the Light controller */
} esp_ble_mesh_light_lc_setup_srv_t;
/** Parameter of Light Lightness Actual state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light Lightness Actual state */
} esp_ble_mesh_state_change_light_lightness_set_t;
/** Parameter of Light Lightness Linear state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light Lightness Linear state */
} esp_ble_mesh_state_change_light_lightness_linear_set_t;
/** Parameter of Light Lightness Default state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light Lightness Default state */
} esp_ble_mesh_state_change_light_lightness_default_set_t;
/** Parameters of Light Lightness Range state change event */
typedef struct {
uint16_t range_min; /*!< The minimum value of Light Lightness Range state */
uint16_t range_max; /*!< The maximum value of Light Lightness Range state */
} esp_ble_mesh_state_change_light_lightness_range_set_t;
/** Parameters of Light CTL state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light CTL Lightness state */
uint16_t temperature; /*!< The value of Light CTL Temperature state */
int16_t delta_uv; /*!< The value of Light CTL Delta UV state */
} esp_ble_mesh_state_change_light_ctl_set_t;
/** Parameters of Light CTL Temperature state change event */
typedef struct {
uint16_t temperature; /*!< The value of Light CTL Temperature state */
int16_t delta_uv; /*!< The value of Light CTL Delta UV state */
} esp_ble_mesh_state_change_light_ctl_temperature_set_t;
/** Parameters of Light CTL Temperature Range state change event */
typedef struct {
uint16_t range_min; /*!< The minimum value of Light CTL Temperature Range state */
uint16_t range_max; /*!< The maximum value of Light CTL Temperature Range state */
} esp_ble_mesh_state_change_light_ctl_temperature_range_set_t;
/** Parameters of Light CTL Default state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light Lightness Default state */
uint16_t temperature; /*!< The value of Light CTL Temperature Default state */
int16_t delta_uv; /*!< The value of Light CTL Delta UV Default state */
} esp_ble_mesh_state_change_light_ctl_default_set_t;
/** Parameters of Light HSL state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light HSL Lightness state */
uint16_t hue; /*!< The value of Light HSL Hue state */
uint16_t saturation; /*!< The value of Light HSL Saturation state */
} esp_ble_mesh_state_change_light_hsl_set_t;
/** Parameter of Light HSL Hue state change event */
typedef struct {
uint16_t hue; /*!< The value of Light HSL Hue state */
} esp_ble_mesh_state_change_light_hsl_hue_set_t;
/** Parameter of Light HSL Saturation state change event */
typedef struct {
uint16_t saturation; /*!< The value of Light HSL Saturation state */
} esp_ble_mesh_state_change_light_hsl_saturation_set_t;
/** Parameters of Light HSL Default state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light HSL Lightness Default state */
uint16_t hue; /*!< The value of Light HSL Hue Default state */
uint16_t saturation; /*!< The value of Light HSL Saturation Default state */
} esp_ble_mesh_state_change_light_hsl_default_set_t;
/** Parameters of Light HSL Range state change event */
typedef struct {
uint16_t hue_range_min; /*!< The minimum hue value of Light HSL Range state */
uint16_t hue_range_max; /*!< The maximum hue value of Light HSL Range state */
uint16_t saturation_range_min; /*!< The minimum saturation value of Light HSL Range state */
uint16_t saturation_range_max; /*!< The maximum saturation value of Light HSL Range state */
} esp_ble_mesh_state_change_light_hsl_range_set_t;
/** Parameters of Light xyL state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light xyL Lightness state */
uint16_t x; /*!< The value of Light xyL x state */
uint16_t y; /*!< The value of Light xyL y state */
} esp_ble_mesh_state_change_light_xyl_set_t;
/** Parameters of Light xyL Default state change event */
typedef struct {
uint16_t lightness; /*!< The value of Light Lightness Default state */
uint16_t x; /*!< The value of Light xyL x Default state */
uint16_t y; /*!< The value of Light xyL y Default state */
} esp_ble_mesh_state_change_light_xyl_default_set_t;
/** Parameters of Light xyL Range state change event */
typedef struct {
uint16_t x_range_min; /*!< The minimum value of Light xyL x Range state */
uint16_t x_range_max; /*!< The maximum value of Light xyL x Range state */
uint16_t y_range_min; /*!< The minimum value of Light xyL y Range state */
uint16_t y_range_max; /*!< The maximum value of Light xyL y Range state */
} esp_ble_mesh_state_change_light_xyl_range_set_t;
/** Parameter of Light LC Mode state change event */
typedef struct {
uint8_t mode; /*!< The value of Light LC Mode state */
} esp_ble_mesh_state_change_light_lc_mode_set_t;
/** Parameter of Light LC Occupancy Mode state change event */
typedef struct {
uint8_t mode; /*!< The value of Light LC Occupancy Mode state */
} esp_ble_mesh_state_change_light_lc_om_set_t;
/** Parameter of Light LC Light OnOff state change event */
typedef struct {
uint8_t onoff; /*!< The value of Light LC Light OnOff state */
} esp_ble_mesh_state_change_light_lc_light_onoff_set_t;
/** Parameters of Light LC Property state change event */
typedef struct {
uint16_t property_id; /*!< The property id of Light LC Property state */
struct net_buf_simple *property_value; /*!< The property value of Light LC Property state */
} esp_ble_mesh_state_change_light_lc_property_set_t;
/** Parameters of Sensor Status state change event */
typedef struct {
uint16_t property_id; /*!< The value of Sensor Property ID */
/** Parameters of Sensor Status related state */
union {
uint8_t occupancy; /*!< The value of Light LC Occupancy state */
uint32_t set_occupancy_to_1_delay; /*!< The value of Light LC Set Occupancy to 1 Delay state */
uint32_t ambient_luxlevel; /*!< The value of Light LC Ambient Luxlevel state */
} state;
} esp_ble_mesh_state_change_sensor_status_t;
/**
* @brief Lighting Server Model state change value union
*/
typedef union {
/**
* The recv_op in ctx can be used to decide which state is changed.
*/
esp_ble_mesh_state_change_light_lightness_set_t lightness_set; /*!< Light Lightness Set */
esp_ble_mesh_state_change_light_lightness_linear_set_t lightness_linear_set; /*!< Light Lightness Linear Set */
esp_ble_mesh_state_change_light_lightness_default_set_t lightness_default_set; /*!< Light Lightness Default Set */
esp_ble_mesh_state_change_light_lightness_range_set_t lightness_range_set; /*!< Light Lightness Range Set */
esp_ble_mesh_state_change_light_ctl_set_t ctl_set; /*!< Light CTL Set */
esp_ble_mesh_state_change_light_ctl_temperature_set_t ctl_temp_set; /*!< Light CTL Temperature Set */
esp_ble_mesh_state_change_light_ctl_temperature_range_set_t ctl_temp_range_set; /*!< Light CTL Temperature Range Set */
esp_ble_mesh_state_change_light_ctl_default_set_t ctl_default_set; /*!< Light CTL Default Set */
esp_ble_mesh_state_change_light_hsl_set_t hsl_set; /*!< Light HSL Set */
esp_ble_mesh_state_change_light_hsl_hue_set_t hsl_hue_set; /*!< Light HSL Hue Set */
esp_ble_mesh_state_change_light_hsl_saturation_set_t hsl_saturation_set; /*!< Light HSL Saturation Set */
esp_ble_mesh_state_change_light_hsl_default_set_t hsl_default_set; /*!< Light HSL Default Set */
esp_ble_mesh_state_change_light_hsl_range_set_t hsl_range_set; /*!< Light HSL Range Set */
esp_ble_mesh_state_change_light_xyl_set_t xyl_set; /*!< Light xyL Set */
esp_ble_mesh_state_change_light_xyl_default_set_t xyl_default_set; /*!< Light xyL Default Set */
esp_ble_mesh_state_change_light_xyl_range_set_t xyl_range_set; /*!< Light xyL Range Set */
esp_ble_mesh_state_change_light_lc_mode_set_t lc_mode_set; /*!< Light LC Mode Set */
esp_ble_mesh_state_change_light_lc_om_set_t lc_om_set; /*!< Light LC Occupancy Mode Set */
esp_ble_mesh_state_change_light_lc_light_onoff_set_t lc_light_onoff_set; /*!< Light LC Light OnOff Set */
esp_ble_mesh_state_change_light_lc_property_set_t lc_property_set; /*!< Light LC Property Set */
esp_ble_mesh_state_change_sensor_status_t sensor_status; /*!< Sensor Status */
} esp_ble_mesh_lighting_server_state_change_t;
/** Context of the received Light LC Property Get message */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
} esp_ble_mesh_server_recv_light_lc_property_get_t;
/**
* @brief Lighting Server Model received get message union
*/
typedef union {
esp_ble_mesh_server_recv_light_lc_property_get_t lc_property; /*!< Light LC Property Get */
} esp_ble_mesh_lighting_server_recv_get_msg_t;
/** Context of the received Light Lightness Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness actual state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_lightness_set_t;
/** Context of the received Light Lightness Linear Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light lightness linear state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_lightness_linear_set_t;
/** Context of the received Light Lightness Default Set message */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
} esp_ble_mesh_server_recv_light_lightness_default_set_t;
/** Context of the received Light Lightness Range Set message */
typedef struct {
uint16_t range_min; /*!< Value of range min field of light lightness range state */
uint16_t range_max; /*!< Value of range max field of light lightness range state */
} esp_ble_mesh_server_recv_light_lightness_range_set_t;
/** Context of the received Light CTL Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light ctl lightness state */
uint16_t temperature; /*!< Target value of light ctl temperature state */
int16_t delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_ctl_set_t;
/** Context of the received Light CTL Temperature Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t temperature; /*!< Target value of light ctl temperature state */
int16_t delta_uv; /*!< Target value of light ctl delta UV state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_ctl_temperature_set_t;
/** Context of the received Light CTL Temperature Range Set message */
typedef struct {
uint16_t range_min; /*!< Value of temperature range min field of light ctl temperature range state */
uint16_t range_max; /*!< Value of temperature range max field of light ctl temperature range state */
} esp_ble_mesh_server_recv_light_ctl_temperature_range_set_t;
/** Context of the received Light CTL Default Set message */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t temperature; /*!< Value of light temperature default state */
int16_t delta_uv; /*!< Value of light delta UV default state */
} esp_ble_mesh_server_recv_light_ctl_default_set_t;
/** Context of the received Light HSL Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t lightness; /*!< Target value of light hsl lightness state */
uint16_t hue; /*!< Target value of light hsl hue state */
uint16_t saturation; /*!< Target value of light hsl saturation state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_hsl_set_t;
/** Context of the received Light HSL Hue Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t hue; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_hsl_hue_set_t;
/** Context of the received Light HSL Saturation Set message */
typedef struct {
bool op_en; /*!< Indicate if optional parameters are included */
uint16_t saturation; /*!< Target value of light hsl hue state */
uint8_t tid; /*!< Transaction ID */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_hsl_saturation_set_t;
/** Context of the received Light HSL Default Set message */
typedef struct {
uint16_t lightness; /*!< Value of light lightness default state */
uint16_t hue; /*!< Value of light hue default state */
uint16_t saturation; /*!< Value of light saturation default state */
} esp_ble_mesh_server_recv_light_hsl_default_set_t;
/** Context of the received Light HSL Range Set message */
typedef struct {
uint16_t hue_range_min; /*!< Value of hue range min field of light hsl hue range state */
uint16_t hue_range_max; /*!< Value of hue range max field of light hsl hue range state */
uint16_t saturation_range_min; /*!< Value of saturation range min field of light hsl saturation range state */
uint16_t saturation_range_max; /*!< Value of saturation range max field of light hsl saturation range state */
} esp_ble_mesh_server_recv_light_hsl_range_set_t;
/** Context of the received Light xyL Set message */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint16_t lightness; /*!< The target value of the Light xyL Lightness state */
uint16_t x; /*!< The target value of the Light xyL x state */
uint16_t y; /*!< The target value of the Light xyL y state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_xyl_set_t;
/** Context of the received Light xyL Default Set message */
typedef struct {
uint16_t lightness; /*!< The value of the Light Lightness Default state */
uint16_t x; /*!< The value of the Light xyL x Default state */
uint16_t y; /*!< The value of the Light xyL y Default state */
} esp_ble_mesh_server_recv_light_xyl_default_set_t;
/** Context of the received Light xyl Range Set message */
typedef struct {
uint16_t x_range_min; /*!< The value of the xyL x Range Min field of the Light xyL x Range state */
uint16_t x_range_max; /*!< The value of the xyL x Range Max field of the Light xyL x Range state */
uint16_t y_range_min; /*!< The value of the xyL y Range Min field of the Light xyL y Range state */
uint16_t y_range_max; /*!< The value of the xyL y Range Max field of the Light xyL y Range state */
} esp_ble_mesh_server_recv_light_xyl_range_set_t;
/** Context of the received Light LC Mode Set message */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Mode state */
} esp_ble_mesh_server_recv_light_lc_mode_set_t;
/** Context of the received Light OM Set message */
typedef struct {
uint8_t mode; /*!< The target value of the Light LC Occupancy Mode state */
} esp_ble_mesh_server_recv_light_lc_om_set_t;
/** Context of the received Light LC Light OnOff Set message */
typedef struct {
bool op_en; /*!< Indicate whether optional parameters included */
uint8_t light_onoff; /*!< The target value of the Light LC Light OnOff state */
uint8_t tid; /*!< Transaction Identifier */
uint8_t trans_time; /*!< Time to complete state transition (optional) */
uint8_t delay; /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_light_lc_light_onoff_set_t;
/** Context of the received Light LC Property Set message */
typedef struct {
uint16_t property_id; /*!< Property ID identifying a Light LC Property */
struct net_buf_simple *property_value; /*!< Raw value for the Light LC Property */
} esp_ble_mesh_server_recv_light_lc_property_set_t;
/**
* @brief Lighting Server Model received set message union
*/
typedef union {
esp_ble_mesh_server_recv_light_lightness_set_t lightness; /*!< Light Lightness Set/Light Lightness Set Unack */
esp_ble_mesh_server_recv_light_lightness_linear_set_t lightness_linear; /*!< Light Lightness Linear Set/Light Lightness Linear Set Unack */
esp_ble_mesh_server_recv_light_lightness_default_set_t lightness_default; /*!< Light Lightness Default Set/Light Lightness Default Set Unack */
esp_ble_mesh_server_recv_light_lightness_range_set_t lightness_range; /*!< Light Lightness Range Set/Light Lightness Range Set Unack */
esp_ble_mesh_server_recv_light_ctl_set_t ctl; /*!< Light CTL Set/Light CTL Set Unack */
esp_ble_mesh_server_recv_light_ctl_temperature_set_t ctl_temp; /*!< Light CTL Temperature Set/Light CTL Temperature Set Unack */
esp_ble_mesh_server_recv_light_ctl_temperature_range_set_t ctl_temp_range; /*!< Light CTL Temperature Range Set/Light CTL Temperature Range Set Unack */
esp_ble_mesh_server_recv_light_ctl_default_set_t ctl_default; /*!< Light CTL Default Set/Light CTL Default Set Unack */
esp_ble_mesh_server_recv_light_hsl_set_t hsl; /*!< Light HSL Set/Light HSL Set Unack */
esp_ble_mesh_server_recv_light_hsl_hue_set_t hsl_hue; /*!< Light HSL Hue Set/Light HSL Hue Set Unack */
esp_ble_mesh_server_recv_light_hsl_saturation_set_t hsl_saturation; /*!< Light HSL Saturation Set/Light HSL Saturation Set Unack */
esp_ble_mesh_server_recv_light_hsl_default_set_t hsl_default; /*!< Light HSL Default Set/Light HSL Default Set Unack */
esp_ble_mesh_server_recv_light_hsl_range_set_t hsl_range; /*!< Light HSL Range Set/Light HSL Range Set Unack */
esp_ble_mesh_server_recv_light_xyl_set_t xyl; /*!< Light xyL Set/Light xyL Set Unack */
esp_ble_mesh_server_recv_light_xyl_default_set_t xyl_default; /*!< Light xyL Default Set/Light xyL Default Set Unack */
esp_ble_mesh_server_recv_light_xyl_range_set_t xyl_range; /*!< Light xyL Range Set/Light xyL Range Set Unack */
esp_ble_mesh_server_recv_light_lc_mode_set_t lc_mode; /*!< Light LC Mode Set/Light LC Mode Set Unack */
esp_ble_mesh_server_recv_light_lc_om_set_t lc_om; /*!< Light LC OM Set/Light LC OM Set Unack */
esp_ble_mesh_server_recv_light_lc_light_onoff_set_t lc_light_onoff; /*!< Light LC Light OnOff Set/Light LC Light OnOff Set Unack */
esp_ble_mesh_server_recv_light_lc_property_set_t lc_property; /*!< Light LC Property Set/Light LC Property Set Unack */
} esp_ble_mesh_lighting_server_recv_set_msg_t;
/** Context of the received Sensor Status message */
typedef struct {
struct net_buf_simple *data; /*!< Value of sensor data state (optional) */
} esp_ble_mesh_server_recv_sensor_status_t;
/**
* @brief Lighting Server Model received status message union
*/
typedef union {
esp_ble_mesh_server_recv_sensor_status_t sensor_status; /*!< Sensor Status */
} esp_ble_mesh_lighting_server_recv_status_msg_t;
/**
* @brief Lighting Server Model callback value union
*/
typedef union {
esp_ble_mesh_lighting_server_state_change_t state_change; /*!< ESP_BLE_MESH_LIGHTING_SERVER_STATE_CHANGE_EVT */
esp_ble_mesh_lighting_server_recv_get_msg_t get; /*!< ESP_BLE_MESH_LIGHTING_SERVER_RECV_GET_MSG_EVT */
esp_ble_mesh_lighting_server_recv_set_msg_t set; /*!< ESP_BLE_MESH_LIGHTING_SERVER_RECV_SET_MSG_EVT */
esp_ble_mesh_lighting_server_recv_status_msg_t status; /*!< ESP_BLE_MESH_LIGHTING_SERVER_RECV_STATUS_MSG_EVT */
} esp_ble_mesh_lighting_server_cb_value_t;
/** Lighting Server Model callback parameters */
typedef struct {
esp_ble_mesh_model_t *model; /*!< Pointer to Lighting Server Models */
esp_ble_mesh_msg_ctx_t ctx; /*!< Context of the received messages */
esp_ble_mesh_lighting_server_cb_value_t value; /*!< Value of the received Lighting Messages */
} esp_ble_mesh_lighting_server_cb_param_t;
/** This enum value is the event of Lighting Server Model */
typedef enum {
/**
* 1. When get_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, no event will be
* callback to the application layer when Lighting Get messages are received.
* 2. When set_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, this event will
* be callback to the application layer when Lighting Set/Set Unack messages
* are received.
*/
ESP_BLE_MESH_LIGHTING_SERVER_STATE_CHANGE_EVT,
/**
* When get_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, this event will be
* callback to the application layer when Lighting Get messages are received.
*/
ESP_BLE_MESH_LIGHTING_SERVER_RECV_GET_MSG_EVT,
/**
* When set_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, this event will be
* callback to the application layer when Lighting Set/Set Unack messages are received.
*/
ESP_BLE_MESH_LIGHTING_SERVER_RECV_SET_MSG_EVT,
/**
* When status_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, this event will
* be callback to the application layer when Sensor Status message is received.
*/
ESP_BLE_MESH_LIGHTING_SERVER_RECV_STATUS_MSG_EVT,
ESP_BLE_MESH_LIGHTING_SERVER_EVT_MAX,
} esp_ble_mesh_lighting_server_cb_event_t;
/**
* @brief Bluetooth Mesh Lighting Server Model function.
*/
/**
* @brief Lighting Server Model callback function type
* @param event: Event type
* @param param: Pointer to callback parameter
*/
typedef void (* esp_ble_mesh_lighting_server_cb_t)(esp_ble_mesh_lighting_server_cb_event_t event,
esp_ble_mesh_lighting_server_cb_param_t *param);
/**
* @brief Register BLE Mesh Lighting Server Model callback.
*
* @param[in] callback: Pointer to the callback function.
*
* @return ESP_OK on success or error code otherwise.
*
*/
esp_err_t esp_ble_mesh_register_lighting_server_callback(esp_ble_mesh_lighting_server_cb_t callback);
#ifdef __cplusplus
}
#endif
#endif /* _ESP_BLE_MESH_LIGHTING_MODEL_API_H_ */
| 37,470 |
892 | {
"schema_version": "1.2.0",
"id": "GHSA-66mv-q8r2-hj8w",
"modified": "2022-05-13T01:46:48Z",
"published": "2022-05-13T01:46:48Z",
"aliases": [
"CVE-2017-6928"
],
"details": "Drupal core 7.x versions before 7.57 when using Drupal's private file system, Drupal will check to make sure a user has access to a file before allowing the user to view or download it. This check fails under certain conditions in which one module is trying to grant access to the file and another is trying to deny it, leading to an access bypass vulnerability. This vulnerability is mitigated by the fact that it only occurs for unusual site configurations.",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
],
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-6928"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2018/02/msg00030.html"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2018/dsa-4123"
},
{
"type": "WEB",
"url": "https://www.drupal.org/sa-core-2018-001"
}
],
"database_specific": {
"cwe_ids": [
"CWE-732"
],
"severity": "MODERATE",
"github_reviewed": false
}
} | 585 |
679 | <reponame>Grosskopf/openoffice<filename>main/sc/source/core/data/markdata.cxx<gh_stars>100-1000
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
// INCLUDE ---------------------------------------------------------------
#include <tools/debug.hxx>
#include "markdata.hxx"
#include "markarr.hxx"
#include "rangelst.hxx"
// STATIC DATA -----------------------------------------------------------
//------------------------------------------------------------------------
ScMarkData::ScMarkData() :
pMultiSel( NULL )
{
for (SCTAB i=0; i<=MAXTAB; i++)
bTabMarked[i] = sal_False;
ResetMark();
}
ScMarkData::ScMarkData(const ScMarkData& rData) :
aMarkRange( rData.aMarkRange ),
aMultiRange( rData.aMultiRange ),
pMultiSel( NULL )
{
bMarked = rData.bMarked;
bMultiMarked = rData.bMultiMarked;
bMarking = rData.bMarking;
bMarkIsNeg = rData.bMarkIsNeg;
for (SCTAB i=0; i<=MAXTAB; i++)
bTabMarked[i] = rData.bTabMarked[i];
if (rData.pMultiSel)
{
pMultiSel = new ScMarkArray[MAXCOLCOUNT];
for (SCCOL j=0; j<MAXCOLCOUNT; j++)
rData.pMultiSel[j].CopyMarksTo( pMultiSel[j] );
}
}
ScMarkData& ScMarkData::operator=(const ScMarkData& rData)
{
if ( &rData == this )
return *this;
delete[] pMultiSel;
pMultiSel = NULL;
aMarkRange = rData.aMarkRange;
aMultiRange = rData.aMultiRange;
bMarked = rData.bMarked;
bMultiMarked = rData.bMultiMarked;
bMarking = rData.bMarking;
bMarkIsNeg = rData.bMarkIsNeg;
for (SCTAB i=0; i<=MAXTAB; i++)
bTabMarked[i] = rData.bTabMarked[i];
if (rData.pMultiSel)
{
pMultiSel = new ScMarkArray[MAXCOLCOUNT];
for (SCCOL j=0; j<MAXCOLCOUNT; j++)
rData.pMultiSel[j].CopyMarksTo( pMultiSel[j] );
}
return *this;
}
ScMarkData::~ScMarkData()
{
delete[] pMultiSel;
}
void ScMarkData::ResetMark()
{
delete[] pMultiSel;
pMultiSel = NULL;
bMarked = bMultiMarked = sal_False;
bMarking = bMarkIsNeg = sal_False;
}
void ScMarkData::SetMarkArea( const ScRange& rRange )
{
aMarkRange = rRange;
aMarkRange.Justify();
if ( !bMarked )
{
// #77987# Upon creation of a document ScFormatShell GetTextAttrState
// may query (default) attributes although no sheet is marked yet.
// => mark that one.
if ( !GetSelectCount() )
bTabMarked[ aMarkRange.aStart.Tab() ] = sal_True;
bMarked = sal_True;
}
}
void ScMarkData::GetMarkArea( ScRange& rRange ) const
{
rRange = aMarkRange; //! inline ?
}
void ScMarkData::GetMultiMarkArea( ScRange& rRange ) const
{
rRange = aMultiRange;
}
void ScMarkData::SetMultiMarkArea( const ScRange& rRange, sal_Bool bMark )
{
if (!pMultiSel)
{
pMultiSel = new ScMarkArray[MAXCOL+1];
// if simple mark range is set, copy to multi marks
if ( bMarked && !bMarkIsNeg )
{
bMarked = sal_False;
SetMultiMarkArea( aMarkRange, sal_True );
}
}
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
SCROW nEndRow = rRange.aEnd.Row();
PutInOrder( nStartRow, nEndRow );
PutInOrder( nStartCol, nEndCol );
SCCOL nCol;
for (nCol=nStartCol; nCol<=nEndCol; nCol++)
pMultiSel[nCol].SetMarkArea( nStartRow, nEndRow, bMark );
if ( bMultiMarked ) // aMultiRange updaten
{
if ( nStartCol < aMultiRange.aStart.Col() )
aMultiRange.aStart.SetCol( nStartCol );
if ( nStartRow < aMultiRange.aStart.Row() )
aMultiRange.aStart.SetRow( nStartRow );
if ( nEndCol > aMultiRange.aEnd.Col() )
aMultiRange.aEnd.SetCol( nEndCol );
if ( nEndRow > aMultiRange.aEnd.Row() )
aMultiRange.aEnd.SetRow( nEndRow );
}
else
{
aMultiRange = rRange; // neu
bMultiMarked = sal_True;
}
}
void ScMarkData::SetAreaTab( SCTAB nTab )
{
aMarkRange.aStart.SetTab(nTab);
aMarkRange.aEnd.SetTab(nTab);
aMultiRange.aStart.SetTab(nTab);
aMultiRange.aEnd.SetTab(nTab);
}
void ScMarkData::SelectOneTable( SCTAB nTab )
{
for (SCTAB i=0; i<=MAXTAB; i++)
bTabMarked[i] = ( nTab == i );
}
SCTAB ScMarkData::GetSelectCount() const
{
SCTAB nCount = 0;
for (SCTAB i=0; i<=MAXTAB; i++)
if (bTabMarked[i])
++nCount;
return nCount;
}
SCTAB ScMarkData::GetFirstSelected() const
{
for (SCTAB i=0; i<=MAXTAB; i++)
if (bTabMarked[i])
return i;
DBG_ERROR("GetFirstSelected: keine markiert");
return 0;
}
void ScMarkData::MarkToMulti()
{
if ( bMarked && !bMarking )
{
SetMultiMarkArea( aMarkRange, !bMarkIsNeg );
bMarked = sal_False;
// check if all multi mark ranges have been removed
if ( bMarkIsNeg && !HasAnyMultiMarks() )
ResetMark();
}
}
void ScMarkData::MarkToSimple()
{
if ( bMarking )
return;
if ( bMultiMarked && bMarked )
MarkToMulti(); // may result in bMarked and bMultiMarked reset
if ( bMultiMarked )
{
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
ScRange aNew = aMultiRange;
sal_Bool bOk = sal_False;
SCCOL nStartCol = aNew.aStart.Col();
SCCOL nEndCol = aNew.aEnd.Col();
while ( nStartCol < nEndCol && !pMultiSel[nStartCol].HasMarks() )
++nStartCol;
while ( nStartCol < nEndCol && !pMultiSel[nEndCol].HasMarks() )
--nEndCol;
// Zeilen werden nur aus MarkArray genommen
SCROW nStartRow, nEndRow;
if ( pMultiSel[nStartCol].HasOneMark( nStartRow, nEndRow ) )
{
bOk = sal_True;
SCROW nCmpStart, nCmpEnd;
for (SCCOL nCol=nStartCol+1; nCol<=nEndCol && bOk; nCol++)
if ( !pMultiSel[nCol].HasOneMark( nCmpStart, nCmpEnd )
|| nCmpStart != nStartRow || nCmpEnd != nEndRow )
bOk = sal_False;
}
if (bOk)
{
aNew.aStart.SetCol(nStartCol);
aNew.aStart.SetRow(nStartRow);
aNew.aEnd.SetCol(nEndCol);
aNew.aEnd.SetRow(nEndRow);
ResetMark();
aMarkRange = aNew;
bMarked = sal_True;
bMarkIsNeg = sal_False;
}
}
}
sal_Bool ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple ) const
{
if ( bMarked && !bNoSimple && !bMarkIsNeg )
if ( aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol &&
aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow )
return sal_True;
if (bMultiMarked)
{
//! hier auf negative Markierung testen ?
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
return pMultiSel[nCol].GetMark( nRow );
}
return sal_False;
}
sal_Bool ScMarkData::IsColumnMarked( SCCOL nCol ) const
{
// bMarkIsNeg inzwischen auch fuer Spaltenkoepfe
//! GetMarkColumnRanges fuer komplett markierte Spalten
if ( bMarked && !bMarkIsNeg &&
aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol &&
aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == MAXROW )
return sal_True;
if ( bMultiMarked && pMultiSel[nCol].IsAllMarked(0,MAXROW) )
return sal_True;
return sal_False;
}
sal_Bool ScMarkData::IsRowMarked( SCROW nRow ) const
{
// bMarkIsNeg inzwischen auch fuer Zeilenkoepfe
//! GetMarkRowRanges fuer komplett markierte Zeilen
if ( bMarked && !bMarkIsNeg &&
aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == MAXCOL &&
aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow )
return sal_True;
if ( bMultiMarked )
{
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
for (SCCOL nCol=0; nCol<=MAXCOL; nCol++)
if (!pMultiSel[nCol].GetMark(nRow))
return sal_False;
return sal_True;
}
return sal_False;
}
void ScMarkData::MarkFromRangeList( const ScRangeList& rList, sal_Bool bReset )
{
if (bReset)
{
for (SCTAB i=0; i<=MAXTAB; i++)
bTabMarked[i] = sal_False; // Tabellen sind nicht in ResetMark
ResetMark();
}
sal_uLong nCount = rList.Count();
if ( nCount == 1 && !bMarked && !bMultiMarked )
{
ScRange aRange = *rList.GetObject(0);
SetMarkArea( aRange );
SelectTable( aRange.aStart.Tab(), sal_True );
}
else
{
for (sal_uLong i=0; i<nCount; i++)
{
ScRange aRange = *rList.GetObject(i);
SetMultiMarkArea( aRange, sal_True );
SelectTable( aRange.aStart.Tab(), sal_True );
}
}
}
void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, sal_Bool bClear ) const
{
if (!pList)
return;
if (bClear)
pList->RemoveAll();
//! bei mehreren selektierten Tabellen mehrere Ranges eintragen !!!
if ( bMultiMarked )
{
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
SCTAB nTab = aMultiRange.aStart.Tab();
SCCOL nStartCol = aMultiRange.aStart.Col();
SCCOL nEndCol = aMultiRange.aEnd.Col();
for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
if (pMultiSel[nCol].HasMarks())
{
SCROW nTop, nBottom;
ScRange aRange( nCol, 0, nTab );
ScMarkArrayIter aMarkIter( &pMultiSel[nCol] );
while ( aMarkIter.Next( nTop, nBottom ) )
{
aRange.aStart.SetRow( nTop );
aRange.aEnd.SetRow( nBottom );
pList->Join( aRange );
}
}
}
if ( bMarked )
pList->Append( aMarkRange );
}
void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const
{
if (!pList)
return;
ScRangeList aOldList(*pList);
pList->RemoveAll(); //! oder die vorhandenen unten weglassen
for (SCTAB nTab=0; nTab<=MAXTAB; nTab++)
if (bTabMarked[nTab])
{
sal_uLong nCount = aOldList.Count();
for (sal_uLong i=0; i<nCount; i++)
{
ScRange aRange = *aOldList.GetObject(i);
aRange.aStart.SetTab(nTab);
aRange.aEnd.SetTab(nTab);
pList->Append( aRange );
}
}
}
SCCOLROW ScMarkData::GetMarkColumnRanges( SCCOLROW* pRanges )
{
if (bMarked)
MarkToMulti();
if (!bMultiMarked)
return 0;
DBG_ASSERT(pMultiSel, "bMultiMarked, but pMultiSel == 0");
const SCCOLROW nMultiStart = aMultiRange.aStart.Col();
const SCCOLROW nMultiEnd = aMultiRange.aEnd.Col();
if (nMultiStart == 0 && nMultiEnd == MAXCOL)
{
// One or more entire rows.
pRanges[0] = 0;
pRanges[1] = MAXCOL;
return 1;
}
SCCOLROW nRangeCnt = 0;
SCCOLROW nStart = nMultiStart;
while (nStart <= nMultiEnd)
{
while (nStart < nMultiEnd && !pMultiSel[nStart].HasMarks())
++nStart;
if (pMultiSel[nStart].HasMarks())
{
SCCOLROW nEnd = nStart;
while (nEnd < nMultiEnd && pMultiSel[nEnd].HasMarks())
++nEnd;
if (!pMultiSel[nEnd].HasMarks())
--nEnd;
pRanges[2*nRangeCnt ] = nStart;
pRanges[2*nRangeCnt+1] = nEnd;
++nRangeCnt;
nStart = nEnd+1;
}
else
nStart = nMultiEnd+1;
}
return nRangeCnt;
}
SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges )
{
if (bMarked)
MarkToMulti();
if (!bMultiMarked)
return 0;
DBG_ASSERT(pMultiSel, "bMultiMarked, but pMultiSel == 0");
// Which rows are marked?
// Optimized to not loop over MAXCOL*MAXROW as worst case, i.e. Ctrl+A
const SCCOLROW nMultiStart = aMultiRange.aStart.Row();
const SCCOLROW nMultiEnd = aMultiRange.aEnd.Row();
sal_Bool* bRowMarked = new sal_Bool[MAXROWCOUNT];
memset( bRowMarked, 0, sizeof(sal_Bool) * MAXROWCOUNT);
SCROW nRow;
SCCOL nCol;
SCROW nTop = -1, nBottom = -1;
for (nCol = aMultiRange.aStart.Col(); nCol <= aMultiRange.aEnd.Col(); ++nCol)
{
ScMarkArrayIter aMarkIter( &pMultiSel[nCol] );
while (aMarkIter.Next( nTop, nBottom ))
for (nRow=nTop; nRow<=nBottom; nRow++)
bRowMarked[nRow] = sal_True;
if (nTop == nMultiStart && nBottom == nMultiEnd)
break; // for, all relevant rows marked
}
if (nTop == nMultiStart && nBottom == nMultiEnd)
{
pRanges[0] = nTop;
pRanges[1] = nBottom;
delete[] bRowMarked;
return 1;
}
// Combine to ranges of rows.
SCCOLROW nRangeCnt = 0;
SCCOLROW nStart = nMultiStart;
while (nStart <= nMultiEnd)
{
while (nStart < nMultiEnd && !bRowMarked[nStart])
++nStart;
if (bRowMarked[nStart])
{
SCCOLROW nEnd = nStart;
while (nEnd < nMultiEnd && bRowMarked[nEnd])
++nEnd;
if (!bRowMarked[nEnd])
--nEnd;
pRanges[2*nRangeCnt ] = nStart;
pRanges[2*nRangeCnt+1] = nEnd;
++nRangeCnt;
nStart = nEnd+1;
}
else
nStart = nMultiEnd+1;
}
delete[] bRowMarked;
return nRangeCnt;
}
sal_Bool ScMarkData::IsAllMarked( const ScRange& rRange ) const
{
if ( !bMultiMarked )
return sal_False;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
SCROW nEndRow = rRange.aEnd.Row();
sal_Bool bOk = sal_True;
for (SCCOL nCol=nStartCol; nCol<=nEndCol && bOk; nCol++)
if ( !pMultiSel[nCol].IsAllMarked( nStartRow, nEndRow ) )
bOk = sal_False;
return bOk;
}
SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, sal_Bool bUp ) const
{
if ( !bMultiMarked )
return nRow;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
return pMultiSel[nCol].GetNextMarked( nRow, bUp );
}
sal_Bool ScMarkData::HasMultiMarks( SCCOL nCol ) const
{
if ( !bMultiMarked )
return sal_False;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
return pMultiSel[nCol].HasMarks();
}
sal_Bool ScMarkData::HasAnyMultiMarks() const
{
if ( !bMultiMarked )
return sal_False;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
for (SCCOL nCol=0; nCol<=MAXCOL; nCol++)
if ( pMultiSel[nCol].HasMarks() )
return sal_True;
return sal_False; // nix
}
void ScMarkData::InsertTab( SCTAB nTab )
{
for (SCTAB i=MAXTAB; i>nTab; i--)
bTabMarked[i] = bTabMarked[i-1];
bTabMarked[nTab] = sal_False;
}
void ScMarkData::DeleteTab( SCTAB nTab )
{
for (SCTAB i=nTab; i<MAXTAB; i++)
bTabMarked[i] = bTabMarked[i+1];
bTabMarked[MAXTAB] = sal_False;
}
| 6,401 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.