code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
|---|---|---|---|---|---|
package name.abhijitsarkar.scala.scalaimpatient.types
import name.abhijitsarkar.scala.scalaimpatient.UnitSpec
class BugSpec extends UnitSpec {
"Making the bug move 4 units followed by 6 units" should "yield current position 10" in {
val bugsy = new Bug()
bugsy.move(4).move(6).currentPosition should be(10)
}
"Making the bug move 4 units and then turning around" should "yield current position 0" in {
val bugsy = new Bug()
bugsy.move(4).turn().currentPosition should be(0)
}
"Bug" should "support fluent style calls to move, show and turn" in {
val bugsy = new Bug()
bugsy move 4 and Show and ThenBugsy move 6 and Show turn Around move 5 and Show
}
}
|
abhijitsarkar/scala-impatient
|
src/test/scala/name/abhijitsarkar/scala/scalaimpatient/types/BugSpec.scala
|
Scala
|
gpl-3.0
| 700
|
\hypertarget{classgmock__output__test_1_1GMockOutputTest}{}\section{gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test Class Reference}
\label{classgmock__output__test_1_1GMockOutputTest}\index{gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test@{gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test}}
Inheritance diagram for gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=263pt]{classgmock__output__test_1_1GMockOutputTest__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=263pt]{classgmock__output__test_1_1GMockOutputTest__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
def \hyperlink{classgmock__output__test_1_1GMockOutputTest_a661e7846690f48328fd9e0834fde9980}{test\+Output} (self)
\end{DoxyCompactItemize}
\subsection{Member Function Documentation}
\index{gmock\+\_\+output\+\_\+test\+::\+G\+Mock\+Output\+Test@{gmock\+\_\+output\+\_\+test\+::\+G\+Mock\+Output\+Test}!test\+Output@{test\+Output}}
\index{test\+Output@{test\+Output}!gmock\+\_\+output\+\_\+test\+::\+G\+Mock\+Output\+Test@{gmock\+\_\+output\+\_\+test\+::\+G\+Mock\+Output\+Test}}
\subsubsection[{\texorpdfstring{test\+Output(self)}{testOutput(self)}}]{\setlength{\rightskip}{0pt plus 5cm}def gmock\+\_\+output\+\_\+test.\+G\+Mock\+Output\+Test.\+test\+Output (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}\hypertarget{classgmock__output__test_1_1GMockOutputTest_a661e7846690f48328fd9e0834fde9980}{}\label{classgmock__output__test_1_1GMockOutputTest_a661e7846690f48328fd9e0834fde9980}
\begin{DoxyCode}
157 \textcolor{keyword}{def }testOutput(self):
158 (output, leaky\_tests) = \hyperlink{namespacegmock__output__test_a1796bc395fbfb8873992e3f84378e4bf}{GetNormalizedCommandOutputAndLeakyTests}(
COMMAND)
159 golden\_file = open(GOLDEN\_PATH, \textcolor{stringliteral}{'rb'})
160 golden = golden\_file.read()
161 golden\_file.close()
162
163 \textcolor{comment}{# The normalized output should match the golden file.}
164 self.assertEquals(golden, output)
165
166 \textcolor{comment}{# The raw output should contain 2 leaked mock object errors for}
167 \textcolor{comment}{# test GMockOutputTest.CatchesLeakedMocks.}
168 self.assertEquals([\textcolor{stringliteral}{'GMockOutputTest.CatchesLeakedMocks'},
169 \textcolor{stringliteral}{'GMockOutputTest.CatchesLeakedMocks'}],
170 leaky\_tests)
171
172
\end{DoxyCode}
The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
vendor/googletest/googlemock/test/\hyperlink{gmock__output__test_8py}{gmock\+\_\+output\+\_\+test.\+py}\end{DoxyCompactItemize}
|
SonamYeshe/AStarPathPlanning
|
docs/latex/classgmock__output__test_1_1GMockOutputTest.tex
|
TeX
|
gpl-3.0
| 2,950
|
/*
Neutrino-GUI - DBoxII-Project
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2012-2013 Stefan Seyfried
License: GPL
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "infoviewer_bb.h"
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysinfo.h>
#include <sys/vfs.h>
#include <sys/timeb.h>
#include <sys/param.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <global.h>
#include <neutrino.h>
#include <gui/infoviewer.h>
#include <gui/bouquetlist.h>
#include <gui/widget/icons.h>
#include <gui/widget/hintbox.h>
#include <gui/customcolor.h>
#include <gui/pictureviewer.h>
#include <gui/movieplayer.h>
#include <system/helpers.h>
#include <system/hddstat.h>
#include <daemonc/remotecontrol.h>
#include <driver/radiotext.h>
#include <driver/volume.h>
#include <zapit/femanager.h>
#include <zapit/zapit.h>
#include <video.h>
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern cVideo * videoDecoder;
#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_INFOBAR_SHADOW_PLUS_1)
CInfoViewerBB::CInfoViewerBB()
{
frameBuffer = CFrameBuffer::getInstance();
is_visible = false;
scrambledErr = false;
scrambledErrSave = false;
scrambledNoSig = false;
scrambledNoSigSave = false;
scrambledT = 0;
#if 0
if(!scrambledT) {
pthread_create(&scrambledT, NULL, scrambledThread, (void*) this) ;
pthread_detach(scrambledT);
}
#endif
hddscale = NULL;
sysscale = NULL;
bbIconInfo[0].x = 0;
bbIconInfo[0].h = 0;
BBarY = 0;
BBarFontY = 0;
hddscale = NULL;
sysscale = NULL;
Init();
}
void CInfoViewerBB::Init()
{
hddwidth = 0;
bbIconMaxH = 0;
bbButtonMaxH = 0;
bbIconMinX = 0;
bbButtonMaxX = 0;
fta = true;
minX = 0;
for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
tmp_bbButtonInfoText[i] = "";
bbButtonInfo[i].x = -1;
}
InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 5;
setBBOffset();
changePB();
}
CInfoViewerBB::~CInfoViewerBB()
{
if(scrambledT) {
pthread_cancel(scrambledT);
scrambledT = 0;
}
if (hddscale)
delete hddscale;
if (sysscale)
delete sysscale;
}
CInfoViewerBB* CInfoViewerBB::getInstance()
{
static CInfoViewerBB* InfoViewerBB = NULL;
if(!InfoViewerBB) {
InfoViewerBB = new CInfoViewerBB();
}
return InfoViewerBB;
}
bool CInfoViewerBB::checkBBIcon(const char * const icon, int *w, int *h)
{
frameBuffer->getIconSize(icon, w, h);
if ((*w != 0) && (*h != 0))
return true;
return false;
}
void CInfoViewerBB::getBBIconInfo()
{
bbIconMaxH = 0;
BBarY = g_InfoViewer->BoxEndY + bottom_bar_offset;
BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) / 2; /* center in buttonbar */
bbIconMinX = g_InfoViewer->BoxEndX - 8; //should be 10px, but 2px will be reduced for each icon
CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();
for (int i = 0; i < CInfoViewerBB::ICON_MAX; i++) {
int w = 0, h = 0;
bool iconView = false;
switch (i) {
case CInfoViewerBB::ICON_SUBT: //no radio
if (neutrino->getMode() != NeutrinoMessages::mode_radio)
iconView = checkBBIcon(NEUTRINO_ICON_SUBT, &w, &h);
break;
case CInfoViewerBB::ICON_VTXT: //no radio
if (neutrino->getMode() != NeutrinoMessages::mode_radio)
iconView = checkBBIcon(NEUTRINO_ICON_VTXT, &w, &h);
break;
case CInfoViewerBB::ICON_RT:
if ((neutrino->getMode() == NeutrinoMessages::mode_radio) && g_settings.radiotext_enable)
iconView = checkBBIcon(NEUTRINO_ICON_RADIOTEXTGET, &w, &h);
break;
case CInfoViewerBB::ICON_DD:
if( g_settings.infobar_show_dd_available )
iconView = checkBBIcon(NEUTRINO_ICON_DD, &w, &h);
break;
case CInfoViewerBB::ICON_16_9: //no radio
if (neutrino->getMode() != NeutrinoMessages::mode_radio)
iconView = checkBBIcon(NEUTRINO_ICON_16_9, &w, &h);
break;
case CInfoViewerBB::ICON_RES: //no radio
if ((g_settings.infobar_show_res < 2) && (neutrino->getMode() != NeutrinoMessages::mode_radio))
iconView = checkBBIcon(NEUTRINO_ICON_RESOLUTION_1280, &w, &h);
break;
case CInfoViewerBB::ICON_CA:
if (g_settings.casystem_display == 2)
iconView = checkBBIcon(NEUTRINO_ICON_SCRAMBLED2, &w, &h);
break;
case CInfoViewerBB::ICON_TUNER:
if (CFEManager::getInstance()->getEnabledCount() > 1 && g_settings.infobar_show_tuner == 1)
iconView = checkBBIcon(NEUTRINO_ICON_TUNER_1, &w, &h);
break;
default:
break;
}
if (iconView) {
bbIconMinX -= w + 2;
bbIconInfo[i].x = bbIconMinX;
bbIconInfo[i].h = h;
}
else
bbIconInfo[i].x = -1;
}
for (int i = 0; i < CInfoViewerBB::ICON_MAX; i++) {
if (bbIconInfo[i].x != -1)
bbIconMaxH = std::max(bbIconMaxH, bbIconInfo[i].h);
}
if (g_settings.infobar_show_sysfs_hdd)
bbIconMinX -= hddwidth + 2;
}
void CInfoViewerBB::getBBButtonInfo()
{
bbButtonMaxH = 0;
bbButtonMaxX = g_InfoViewer->ChanInfoX;
int bbButtonMaxW = 0;
int mode = NeutrinoMessages::mode_unknown;
for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
int w = 0, h = 0;
bool active;
std::string text, icon;
switch (i) {
case CInfoViewerBB::BUTTON_EPG:
icon = NEUTRINO_ICON_BUTTON_RED;
frameBuffer->getIconSize(icon.c_str(), &w, &h);
text = CUserMenu::getUserMenuButtonName(0, active);
if (!text.empty())
break;
text = g_settings.usermenu[SNeutrinoSettings::BUTTON_RED]->title;
if (text.empty())
text = g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST);
break;
case CInfoViewerBB::BUTTON_AUDIO:
icon = NEUTRINO_ICON_BUTTON_GREEN;
frameBuffer->getIconSize(icon.c_str(), &w, &h);
text = CUserMenu::getUserMenuButtonName(1, active);
mode = CNeutrinoApp::getInstance()->getMode();
if (!text.empty() && mode < NeutrinoMessages::mode_audio)
break;
text = g_settings.usermenu[SNeutrinoSettings::BUTTON_GREEN]->title;
if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD))
text = "";
if ((mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) && !CMoviePlayerGui::getInstance().timeshift) {
text = CMoviePlayerGui::getInstance().CurrentAudioName();
} else if (!g_RemoteControl->current_PIDs.APIDs.empty()) {
int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid;
if (text.empty()){
text = g_RemoteControl->current_PIDs.APIDs[selected].desc;
}
}
break;
case CInfoViewerBB::BUTTON_SUBS:
icon = NEUTRINO_ICON_BUTTON_YELLOW;
frameBuffer->getIconSize(icon.c_str(), &w, &h);
text = CUserMenu::getUserMenuButtonName(2, active);
if (!text.empty())
break;
text = g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->title;
if (text.empty())
text = g_Locale->getText((g_RemoteControl->are_subchannels) ? LOCALE_INFOVIEWER_SUBSERVICE : LOCALE_INFOVIEWER_SELECTTIME);
break;
case CInfoViewerBB::BUTTON_FEAT:
icon = NEUTRINO_ICON_BUTTON_BLUE;
frameBuffer->getIconSize(icon.c_str(), &w, &h);
text = CUserMenu::getUserMenuButtonName(3, active);
if (!text.empty())
break;
text = g_settings.usermenu[SNeutrinoSettings::BUTTON_BLUE]->title;
if (text.empty())
text = g_Locale->getText(LOCALE_INFOVIEWER_STREAMINFO);
break;
default:
break;
}
bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(text) + w + 10;
bbButtonInfo[i].cx = w + 5;
bbButtonInfo[i].h = h;
bbButtonInfo[i].text = text;
bbButtonInfo[i].icon = icon;
bbButtonInfo[i].active = active;
}
// Calculate position/size of buttons
minX = std::min(bbIconMinX, g_InfoViewer->ChanInfoX + (((g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX) * 75) / 100));
int MaxBr = minX - (g_InfoViewer->ChanInfoX + 10);
bbButtonMaxX = g_InfoViewer->ChanInfoX + 10;
int br = 0, count = 0;
for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
if ((i == CInfoViewerBB::BUTTON_SUBS) && (g_RemoteControl->subChannels.empty())) { // no subchannels
bbButtonInfo[i].paint = false;
// bbButtonInfo[i].x = -1;
// continue;
}
else
{
count++;
bbButtonInfo[i].paint = true;
br += bbButtonInfo[i].w;
bbButtonInfo[i].x = bbButtonMaxX;
bbButtonMaxX += bbButtonInfo[i].w;
bbButtonMaxW = std::max(bbButtonMaxW, bbButtonInfo[i].w);
}
}
if (br > MaxBr)
printf("[infoviewer_bb:%s#%d] width br (%d) > MaxBr (%d) count %d\n", __func__, __LINE__, br, MaxBr, count);
#if 0
int Btns = 0;
// counting buttons
for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
if (bbButtonInfo[i].x != -1) {
Btns++;
}
}
bbButtonMaxX = g_InfoViewer->ChanInfoX + 10;
bbButtonInfo[CInfoViewerBB::BUTTON_EPG].x = bbButtonMaxX;
bbButtonInfo[CInfoViewerBB::BUTTON_FEAT].x = minX - bbButtonInfo[CInfoViewerBB::BUTTON_FEAT].w;
int x1 = bbButtonInfo[CInfoViewerBB::BUTTON_EPG].x + bbButtonInfo[CInfoViewerBB::BUTTON_EPG].w;
int rest = bbButtonInfo[CInfoViewerBB::BUTTON_FEAT].x - x1;
if (Btns < 4) {
rest -= bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].w;
bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].x = x1 + rest / 2;
}
else {
rest -= bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].w + bbButtonInfo[CInfoViewerBB::BUTTON_SUBS].w;
rest = rest / 3;
bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].x = x1 + rest;
bbButtonInfo[CInfoViewerBB::BUTTON_SUBS].x = bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].x +
bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].w + rest;
}
#endif
bbButtonMaxX = g_InfoViewer->ChanInfoX + 10;
int step = MaxBr / 4;
if (count > 0) { /* avoid div-by-zero :-) */
step = MaxBr / count;
count = 0;
for (int i = 0; i < BUTTON_MAX; i++) {
if (!bbButtonInfo[i].paint)
continue;
bbButtonInfo[i].x = bbButtonMaxX + step * count;
// printf("%s: i = %d count = %d b.x = %d\n", __func__, i, count, bbButtonInfo[i].x);
count++;
}
} else {
printf("[infoviewer_bb:%s#%d: count <= 0???\n", __func__, __LINE__);
bbButtonInfo[BUTTON_EPG].x = bbButtonMaxX;
bbButtonInfo[BUTTON_AUDIO].x = bbButtonMaxX + step;
bbButtonInfo[BUTTON_SUBS].x = bbButtonMaxX + 2*step;
bbButtonInfo[BUTTON_FEAT].x = bbButtonMaxX + 3*step;
}
}
void CInfoViewerBB::showBBButtons(const int modus)
{
if (!is_visible)
return;
int i;
bool paint = false;
if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER)
g_InfoViewer->isVolscale = CVolume::getInstance()->hideVolscale();
else
g_InfoViewer->isVolscale = false;
getBBButtonInfo();
for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
if (tmp_bbButtonInfoText[i] != bbButtonInfo[i].text) {
paint = true;
break;
}
}
if (paint) {
int last_x = minX;
frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, minX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_LARGE, CORNER_BOTTOM); //round
for (i = BUTTON_MAX; i > 0;) {
--i;
if ((bbButtonInfo[i].x <= g_InfoViewer->ChanInfoX) || (bbButtonInfo[i].x >= g_InfoViewer->BoxEndX) || (!bbButtonInfo[i].paint))
continue;
if (bbButtonInfo[i].x > 0) {
if (bbButtonInfo[i].x + bbButtonInfo[i].w > last_x) /* text too long */
bbButtonInfo[i].w = last_x - bbButtonInfo[i].x;
last_x = bbButtonInfo[i].x;
if (bbButtonInfo[i].w - bbButtonInfo[i].cx <= 0) {
printf("[infoviewer_bb:%d cannot paint icon %d (not enough space)\n",
__LINE__, i);
continue;
}
if (bbButtonInfo[i].active) {
frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY,
bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT);
}
}
}
if (modus == CInfoViewerBB::BUTTON_AUDIO)
showIcon_DD();
for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
tmp_bbButtonInfoText[i] = bbButtonInfo[i].text;
}
}
if (g_InfoViewer->isVolscale)
CVolume::getInstance()->showVolscale();
}
void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon)
{
if ((bbIconInfo[modus].x <= g_InfoViewer->ChanInfoX) || (bbIconInfo[modus].x >= g_InfoViewer->BoxEndX))
return;
if ((modus >= CInfoViewerBB::ICON_SUBT) && (modus < CInfoViewerBB::ICON_MAX) && (bbIconInfo[modus].x != -1) && (is_visible)) {
frameBuffer->paintIcon(icon, bbIconInfo[modus].x, BBarY,
InfoHeightY_Info, 1, true, !g_settings.gradiant, COL_INFOBAR_BUTTONS_BACKGROUND);
}
}
void CInfoViewerBB::paintshowButtonBar()
{
if (!is_visible)
return;
getBBIconInfo();
for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
tmp_bbButtonInfoText[i] = "";
}
g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false);
if (g_settings.casystem_display < 2)
paintCA_bar(0,0);
frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_LARGE, CORNER_BOTTOM); //round
g_InfoViewer->showSNR();
// Buttons
showBBButtons();
// Icons, starting from right
showIcon_SubT();
showIcon_VTXT();
showIcon_DD();
showIcon_16_9();
#if 0
scrambledCheck(true);
#endif
showIcon_CA_Status(0);
showIcon_Resolution();
showIcon_Tuner();
showSysfsHdd();
}
void CInfoViewerBB::showIcon_SubT()
{
if (!is_visible)
return;
bool have_sub = false;
CZapitChannel * cc = CNeutrinoApp::getInstance()->channelList->getChannel(CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber());
if (cc && cc->getSubtitleCount())
have_sub = true;
showBBIcons(CInfoViewerBB::ICON_SUBT, (have_sub) ? NEUTRINO_ICON_SUBT : NEUTRINO_ICON_SUBT_GREY);
}
void CInfoViewerBB::showIcon_VTXT()
{
if (!is_visible)
return;
showBBIcons(CInfoViewerBB::ICON_VTXT, (g_RemoteControl->current_PIDs.PIDs.vtxtpid != 0) ? NEUTRINO_ICON_VTXT : NEUTRINO_ICON_VTXT_GREY);
}
void CInfoViewerBB::showIcon_DD()
{
if (!is_visible || !g_settings.infobar_show_dd_available)
return;
std::string dd_icon;
if ((g_RemoteControl->current_PIDs.PIDs.selected_apid < g_RemoteControl->current_PIDs.APIDs.size()) &&
(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].is_ac3))
dd_icon = NEUTRINO_ICON_DD;
else
dd_icon = g_RemoteControl->has_ac3 ? NEUTRINO_ICON_DD_AVAIL : NEUTRINO_ICON_DD_GREY;
showBBIcons(CInfoViewerBB::ICON_DD, dd_icon);
}
void CInfoViewerBB::showIcon_RadioText(bool rt_available)
{
if (!is_visible || !g_settings.radiotext_enable)
return;
std::string rt_icon;
if (rt_available)
rt_icon = (g_Radiotext->S_RtOsd) ? NEUTRINO_ICON_RADIOTEXTGET : NEUTRINO_ICON_RADIOTEXTWAIT;
else
rt_icon = NEUTRINO_ICON_RADIOTEXTOFF;
showBBIcons(CInfoViewerBB::ICON_RT, rt_icon);
}
void CInfoViewerBB::showIcon_16_9()
{
if (!is_visible)
return;
if ((g_InfoViewer->aspectRatio == 0) || ( g_RemoteControl->current_PIDs.PIDs.vpid == 0 ) || (g_InfoViewer->aspectRatio != videoDecoder->getAspectRatio())) {
if (g_InfoViewer->chanready && g_RemoteControl->current_PIDs.PIDs.vpid > 0 ) {
g_InfoViewer->aspectRatio = videoDecoder->getAspectRatio();
}
else
g_InfoViewer->aspectRatio = 0;
showBBIcons(CInfoViewerBB::ICON_16_9, (g_InfoViewer->aspectRatio > 2) ? NEUTRINO_ICON_16_9 : NEUTRINO_ICON_16_9_GREY);
}
}
void CInfoViewerBB::showIcon_Resolution()
{
if ((!is_visible) || (g_settings.infobar_show_res == 2)) //show resolution icon is off
return;
if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio)
return;
const char *icon_name = NULL;
#if 0
if ((scrambledNoSig) || ((!fta) && (scrambledErr)))
#else
#if BOXMODEL_UFS910
if (!g_InfoViewer->chanready)
#else
if (!g_InfoViewer->chanready || videoDecoder->getBlank())
#endif
#endif
{
icon_name = NEUTRINO_ICON_RESOLUTION_000;
} else {
int xres, yres, framerate;
if (g_settings.infobar_show_res == 0) {//show resolution icon on infobar
videoDecoder->getPictureInfo(xres, yres, framerate);
switch (yres) {
case 1920:
icon_name = NEUTRINO_ICON_RESOLUTION_1920;
break;
case 1080:
case 1088:
icon_name = NEUTRINO_ICON_RESOLUTION_1080;
break;
case 1440:
icon_name = NEUTRINO_ICON_RESOLUTION_1440;
break;
case 1280:
icon_name = NEUTRINO_ICON_RESOLUTION_1280;
break;
case 720:
icon_name = NEUTRINO_ICON_RESOLUTION_720;
break;
case 704:
icon_name = NEUTRINO_ICON_RESOLUTION_704;
break;
case 576:
icon_name = NEUTRINO_ICON_RESOLUTION_576;
break;
case 544:
icon_name = NEUTRINO_ICON_RESOLUTION_544;
break;
case 528:
icon_name = NEUTRINO_ICON_RESOLUTION_528;
break;
case 480:
icon_name = NEUTRINO_ICON_RESOLUTION_480;
break;
case 382:
icon_name = NEUTRINO_ICON_RESOLUTION_382;
break;
case 352:
icon_name = NEUTRINO_ICON_RESOLUTION_352;
break;
case 288:
icon_name = NEUTRINO_ICON_RESOLUTION_288;
break;
default:
icon_name = NEUTRINO_ICON_RESOLUTION_000;
break;
}
}
if (g_settings.infobar_show_res == 1) {//show simple resolution icon on infobar
videoDecoder->getPictureInfo(xres, yres, framerate);
if (yres > 704)
icon_name = NEUTRINO_ICON_RESOLUTION_HD;
else if (yres >= 288)
icon_name = NEUTRINO_ICON_RESOLUTION_SD;
else
icon_name = NEUTRINO_ICON_RESOLUTION_000;
}
}
showBBIcons(CInfoViewerBB::ICON_RES, icon_name);
}
void CInfoViewerBB::showOne_CAIcon()
{
std::string sIcon = "";
#if 0
if (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_radio) {
if (scrambledNoSig)
sIcon = NEUTRINO_ICON_SCRAMBLED2_BLANK;
else {
if (fta)
sIcon = NEUTRINO_ICON_SCRAMBLED2_GREY;
else
sIcon = (scrambledErr) ? NEUTRINO_ICON_SCRAMBLED2_RED : NEUTRINO_ICON_SCRAMBLED2;
}
}
else
#endif
sIcon = (fta) ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2;
showBBIcons(CInfoViewerBB::ICON_CA, sIcon);
}
void CInfoViewerBB::showIcon_Tuner()
{
if (CFEManager::getInstance()->getEnabledCount() <= 1 || !g_settings.infobar_show_tuner)
return;
std::string icon_name;
switch (CFEManager::getInstance()->getLiveFE()->getNumber()) {
case 1:
icon_name = NEUTRINO_ICON_TUNER_2;
break;
case 2:
icon_name = NEUTRINO_ICON_TUNER_3;
break;
case 3:
icon_name = NEUTRINO_ICON_TUNER_4;
break;
case 0:
default:
icon_name = NEUTRINO_ICON_TUNER_1;
break;
}
showBBIcons(CInfoViewerBB::ICON_TUNER, icon_name);
}
void CInfoViewerBB::showSysfsHdd()
{
if (g_settings.infobar_show_sysfs_hdd) {
//sysFS info
int percent = 0;
uint64_t t, u;
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
if (get_fs_usage("/var", t, u))
#else
if (get_fs_usage("/", t, u))
#endif
percent = (int)((u * 100ULL) / t);
showBarSys(percent);
showBarHdd(cHddStat::getInstance()->getPercent());
}
}
void CInfoViewerBB::showBarSys(int percent)
{
if (is_visible){
sysscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6);
sysscale->setValues(percent, 100);
sysscale->paint();
}
}
void CInfoViewerBB::showBarHdd(int percent)
{
if (is_visible) {
if (percent >= 0){
hddscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6);
hddscale->setValues(percent, 100);
hddscale->paint();
}else {
frameBuffer->paintBoxRel(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6, COL_INFOBAR_BUTTONS_BACKGROUND);
hddscale->reset();
}
}
}
void CInfoViewerBB::paint_ca_icons(int caid, const char *icon, int &icon_space_offset)
{
char buf[20];
int endx = g_InfoViewer->BoxEndX - 10;
int py = g_InfoViewer->BoxEndY + 2; /* hand-crafted, should be automatic */
int px = 0;
static map<int, std::pair<int,const char*> > icon_map;
const int icon_space = 5, icon_number = 10;
static int icon_offset[icon_number] = {0,0,0,0,0,0,0,0,0,0};
static int icon_sizeW [icon_number] = {0,0,0,0,0,0,0,0,0,0};
static bool init_flag = false;
if (!init_flag) {
init_flag = true;
int icon_sizeH = 0, index = 0;
map<int, std::pair<int,const char*> >::const_iterator it;
icon_map[0x0E00] = std::make_pair(index++,"powervu");
icon_map[0x4A00] = std::make_pair(index++,"d");
icon_map[0x2600] = std::make_pair(index++,"biss");
icon_map[0x0600] = std::make_pair(index++,"ird");
icon_map[0x0100] = std::make_pair(index++,"seca");
icon_map[0x0500] = std::make_pair(index++,"via");
icon_map[0x1800] = std::make_pair(index++,"nagra");
icon_map[0x0B00] = std::make_pair(index++,"conax");
icon_map[0x0D00] = std::make_pair(index++,"cw");
icon_map[0x0900] = std::make_pair(index ,"nds");
for (it=icon_map.begin(); it!=icon_map.end(); ++it) {
snprintf(buf, sizeof(buf), "%s_%s", (*it).second.second, icon);
frameBuffer->getIconSize(buf, &icon_sizeW[(*it).second.first], &icon_sizeH);
}
for (int j = 0; j < icon_number; j++) {
for (int i = j; i < icon_number; i++) {
icon_offset[j] += icon_sizeW[i] + icon_space;
}
}
}
caid &= 0xFF00;
if (icon_offset[icon_map[caid].first] == 0)
return;
if (g_settings.casystem_display == 0) {
px = endx - (icon_offset[icon_map[caid].first] - icon_space );
} else {
icon_space_offset += icon_sizeW[icon_map[caid].first];
px = endx - icon_space_offset;
icon_space_offset += 4;
}
if (px) {
snprintf(buf, sizeof(buf), "%s_%s", icon_map[caid].second, icon);
if ((px >= (endx-8)) || (px <= 0))
printf("#####[%s:%d] Error paint icon %s, px: %d, py: %d, endx: %d, icon_offset: %d\n",
__FUNCTION__, __LINE__, buf, px, py, endx, icon_offset[icon_map[caid].first]);
else
frameBuffer->paintIcon(buf, px, py);
}
}
void CInfoViewerBB::showIcon_CA_Status(int /*notfirst*/)
{
if (!is_visible)
return;
if (g_settings.casystem_display == 3)
return;
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){
if (g_settings.casystem_display == 2) {
fta = true;
showOne_CAIcon();
}
return;
}
int caids[] = { 0x900, 0xD00, 0xB00, 0x1800, 0x0500, 0x0100, 0x600, 0x2600, 0x4a00, 0x0E00 };
const char *white = "white";
const char *yellow = "yellow";
const char *green = "green";
int icon_space_offset = 0;
const char *ecm_info_f = "/tmp/ecm.info";
if(!g_InfoViewer->chanready) {
if (g_settings.infoviewer_ecm_info == 1)
frameBuffer->paintBackgroundBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-185, 225, g_InfoViewer->ChanHeight+105);
else if (g_settings.infoviewer_ecm_info == 2)
frameBuffer->paintBackgroundBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-185, 225, g_InfoViewer->ChanHeight+105);
unlink(ecm_info_f);
if (g_settings.casystem_display == 2) {
fta = true;
showOne_CAIcon();
}
else if(g_settings.casystem_display == 0) {
for (int i = 0; i < (int)(sizeof(caids)/sizeof(int)); i++) {
paint_ca_icons(caids[i], white, icon_space_offset);
}
}
return;
}
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
if(!channel)
return;
if (g_settings.casystem_display == 2) {
fta = channel->camap.empty();
showOne_CAIcon();
return;
}
emu = 0;
if(file_exists("/var/etc/.mgcamd"))
emu = 1;
else if(file_exists("/var/etc/.gbox"))
emu = 2;
else if(file_exists("/var/etc/.oscam"))
emu = 3;
else if(file_exists("/var/etc/.osemu"))
emu = 4;
else if(file_exists("/var/etc/.wicard"))
emu = 5;
else if(file_exists("/var/etc/.camd3"))
emu = 6;
if ( (file_exists(ecm_info_f)) && ((g_settings.infoviewer_ecm_info == 1) || (g_settings.infoviewer_ecm_info == 2)) )
paintECM();
if ((g_settings.casystem_display == 0) || (g_settings.casystem_display == 1))
{
FILE* fd = fopen (ecm_info_f, "r");
int ecm_caid = 0;
int decMode = 0;
bool mgcamd_emu = emu==1 ? true:false;
char ecm_pid[16] = {0};
if (fd)
{
char *buffer = NULL, *card = NULL;
size_t len = 0;
ssize_t read;
char decode[16] = {0};
while ((read = getline(&buffer, &len, fd)) != -1)
{
if ((sscanf(buffer, "=%*[^9-0]%x", &ecm_caid) == 1) || (sscanf(buffer, "caid: %x", &ecm_caid) == 1))
{
if (mgcamd_emu && ((ecm_caid & 0xFF00) == 0x1700)){
sscanf(buffer, "=%*[^','], pid %6s",ecm_pid);
}
continue;
}
else if ((sscanf(buffer, "decode:%15s", decode) == 1) || (sscanf(buffer, "source:%15s", decode) == 2) || (sscanf(buffer, "from: %15s", decode) == 3))
{
card = strstr(buffer, "127.0.0.1");
break;
}
}
fclose (fd);
if (buffer)
free (buffer);
if (strncasecmp(decode, "net", 3) == 0)
decMode = (card == NULL) ? 1 : 3; // net == 1, card == 3
else if ((strncasecmp(decode, "emu", 3) == 0) || (strncasecmp(decode, "Net", 1) == 0) || (strncasecmp(decode, "int", 3) == 0) || (sscanf(decode, "protocol: char*", 3) == 0) || (sscanf(decode, "from: char*", 3) == 0) || (strncasecmp(decode, "cache", 5) == 0) || (strstr(decode, "/" ) != NULL))
decMode = 2; //emu
else if ((strncasecmp(decode, "com", 3) == 0) || (strncasecmp(decode, "slot", 4) == 0) || (strncasecmp(decode, "local", 5) == 0))
decMode = 3; //card
}
if (mgcamd_emu && ((ecm_caid & 0xFF00) == 0x1700)) {
const char *pid_info_f = "/tmp/pid.info";
FILE* pidinfo = fopen (pid_info_f, "r");
if (pidinfo){
char *buf_mg = NULL;
size_t mg_len = 0;
ssize_t mg_read;
while ((mg_read = getline(&buf_mg, &mg_len, pidinfo)) != -1){
if(strcasestr(buf_mg, ecm_pid)){
int pidnagra = 0;
sscanf(buf_mg, "%*[^':']: CaID: %x *", &pidnagra);
ecm_caid = pidnagra;
}
}
fclose (pidinfo);
if (buf_mg)
free (buf_mg);
}
}
if ((ecm_caid & 0xFF00) == 0x1700 ) {
bool nagra_found = false;
bool beta_found = false;
for(casys_map_iterator_t it = channel->camap.begin(); it != channel->camap.end(); ++it) {
int caid = (*it) & 0xFF00;
if(caid == 0x1800)
nagra_found = true;
if (caid == 0x1700)
beta_found = true;
}
if(beta_found)
ecm_caid = 0x600;
else if(!beta_found && nagra_found)
ecm_caid = 0x1800;
}
paintEmuIcons(decMode);
for (int i = 0; i < (int)(sizeof(caids)/sizeof(int)); i++) {
bool found = false;
for(casys_map_iterator_t it = channel->camap.begin(); it != channel->camap.end(); ++it) {
int caid = (*it) & 0xFF00;
if (caid == 0x1700)
caid = 0x0600;
if((found = (caid == caids[i])))
break;
}
if(g_settings.casystem_display == 0)
paint_ca_icons(caids[i], (found ? (caids[i] == (ecm_caid & 0xFF00) ? green : yellow) : white), icon_space_offset);
else if(found)
paint_ca_icons(caids[i], (caids[i] == (ecm_caid & 0xFF00) ? green : yellow), icon_space_offset);
}
}
}
void CInfoViewerBB::paintCA_bar(int left, int right)
{
int xcnt = (g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX) / 4;
int ycnt = bottom_bar_offset / 4;
if (right)
right = xcnt - ((right/4)+1);
if (left)
left = xcnt - ((left/4)-1);
frameBuffer->paintBox(g_InfoViewer->ChanInfoX + (right*4), g_InfoViewer->BoxEndY, g_InfoViewer->BoxEndX - (left*4), g_InfoViewer->BoxEndY + bottom_bar_offset, (g_settings.dotmatrix == 1) ? COL_BLACK : COL_INFOBAR_PLUS_0);
if (g_settings.dotmatrix == 1)
{
if (left)
left -= 1;
for (int i = 0 + right; i < xcnt - left; i++) {
for (int j = 0; j < ycnt; j++) {
frameBuffer->paintBoxRel((g_InfoViewer->ChanInfoX + 2) + i*4, g_InfoViewer->BoxEndY + 2 + j*4, 2, 2, COL_INFOBAR_PLUS_1);
}
}
}
}
void CInfoViewerBB::changePB()
{
hddwidth = frameBuffer->getScreenWidth(true) * ((g_settings.screen_preset == 1) ? 10 : 8) / 128; /* 80(CRT)/100(LCD) pix if screen is 1280 wide */
if (!hddscale) {
hddscale = new CProgressBar();
hddscale->setType(CProgressBar::PB_REDRIGHT);
}
if (!sysscale) {
sysscale = new CProgressBar();
sysscale->setType(CProgressBar::PB_REDRIGHT);
}
}
void CInfoViewerBB::reset_allScala()
{
hddscale->reset();
sysscale->reset();
//lasthdd = lastsys = -1;
}
void CInfoViewerBB::setBBOffset()
{
bottom_bar_offset = (g_settings.casystem_display < 2) ? 22 : 0;
}
void* CInfoViewerBB::scrambledThread(void *arg)
{
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
CInfoViewerBB *infoViewerBB = static_cast<CInfoViewerBB*>(arg);
while(1) {
if (infoViewerBB->is_visible)
infoViewerBB->scrambledCheck();
usleep(500*1000);
}
return 0;
}
void CInfoViewerBB::scrambledCheck(bool force)
{
scrambledErr = false;
scrambledNoSig = false;
if (videoDecoder->getBlank()) {
if (videoDecoder->getPlayState())
scrambledErr = true;
else
scrambledNoSig = true;
}
if ((scrambledErr != scrambledErrSave) || (scrambledNoSig != scrambledNoSigSave) || force) {
showIcon_CA_Status(0);
showIcon_Resolution();
scrambledErrSave = scrambledErr;
scrambledNoSigSave = scrambledNoSig;
}
}
void CInfoViewerBB::paintEmuIcons(int decMode)
{
char buf[20];
int py = g_InfoViewer->BoxEndY + 2; /* hand-crafted, should be automatic */
const char emu_green[] = "green";
const char emu_gray[] = "white";
const char emu_yellow[] = "yellow";
enum E{
GBOX,MGCAMD,OSCAM,OSEMU,WICARD,CAMD3,NET,EMU,CARD
};
static int emus_icon_sizeW[CARD+1] = {0};
const char *icon_emu[CARD+1] = {"gbox", "mgcamd", "oscam", "osemu", "wicard", "camd3", "net", "emu", "card"};
int icon_sizeH = 0;
static int ga = g_InfoViewer->ChanInfoX+30+16;
if (emus_icon_sizeW[GBOX] == 0)
{
for (E e=GBOX; e <= CARD; e = E(e+1))
{
snprintf(buf, sizeof(buf), "%s_%s", icon_emu[e], emu_green);
frameBuffer->getIconSize(buf, &emus_icon_sizeW[e], &icon_sizeH);
ga+=emus_icon_sizeW[e];
}
}
struct stat sb;
int icon_emuX = g_InfoViewer->ChanInfoX ;
static int icon_offset = 0;
int icon_flag = 0; // gray = 0, yellow = 1, green = 2
if ((g_settings.casystem_display == 1) && (icon_offset))
{
paintCA_bar(icon_offset, 0);
icon_offset = 0;
}
for (E e = GBOX; e <= CARD; e = E(e+1))
{
switch (e)
{
case GBOX:
case MGCAMD:
case OSCAM:
case OSEMU:
case CAMD3:
case WICARD:
snprintf(buf, sizeof(buf), "/var/etc/.%s", icon_emu[e]);
icon_flag = (stat(buf, &sb) == -1) ? 0 : decMode ? 2 : 1;
break;
case NET:
icon_flag = (decMode == 1) ? 2 : 0;
break;
case EMU:
icon_flag = (decMode == 2) ? 2 : 0;
break;
case CARD:
icon_flag = (decMode == 3) ? 2 : 0;
break;
default:
break;
}
if (!((g_settings.casystem_display == 1) && (icon_flag == 0)))
{
snprintf(buf, sizeof(buf), "%s_%s", icon_emu[e], (icon_flag == 0) ? emu_gray : (icon_flag == 1) ? emu_yellow : emu_green);
frameBuffer->paintIcon(buf, icon_emuX, py);
if (g_settings.casystem_display == 1)
{
icon_offset += emus_icon_sizeW[e] + ((g_settings.casystem_display == 1) ? 2 : 2);
icon_emuX += icon_offset;
}
else if (e == 4)
icon_emuX += emus_icon_sizeW[e] + 15 + ((g_settings.casystem_display == 1) ? 2 : 2);
else
icon_emuX += emus_icon_sizeW[e] + ((g_settings.casystem_display == 1) ? 2 : 2);
}
}
}
void CInfoViewerBB::painttECMInfo(int xa, const char *info, char *caid, char *decode, char *response, char *prov)
{
frameBuffer->paintBoxRel(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-120, 220, g_InfoViewer->ChanHeight+40, COL_INFOBAR_SHADOW_PLUS_0, g_settings.rounded_corners ? CORNER_RADIUS_MID : 0);
frameBuffer->paintBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-125, 220, g_InfoViewer->ChanHeight+40, COL_INFOBAR_PLUS_0, g_settings.rounded_corners ? CORNER_RADIUS_MID : 0);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-190, g_InfoViewer->BoxStartY-100, xa, info, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-80, 80, "CaID:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-80, 130, caid, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-60, 80, "Decode:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-60, 70, decode, COL_INFOBAR_TEXT, 0, true);
if(response[0] != 0 )
{
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-90, g_InfoViewer->BoxStartY-60, 15, "in", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-70, g_InfoViewer->BoxStartY-60, 45, response, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-25, g_InfoViewer->BoxStartY-60, 10, "s", COL_INFOBAR_TEXT, 0, true);
}
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-40, 80, "Provider:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-40, 130, prov, COL_INFOBAR_TEXT, 0, true);
}
void CInfoViewerBB::paintECM()
{
char caid1[5] = {0};
char pid1[5] = {0};
char net[8] = {0};
char cw0_[8][3];
char cw1_[8][3];
char source1[30] = {0};
char caid2[5] = {0};
char pid2[5] = {0};
char provider1[3] = {0};
char prov1[8] = {0};
char prov2[16] = {0};
char decode1[9] = {0};
char from1[9] = {0};
char response1[10] = {0};
char reader[20] = {0};
char protocol[20] = {0};
char tmp;
const char *ecm_info = "/tmp/ecm.info";
FILE* ecminfo = fopen (ecm_info, "r");
bool ecmInfoEmpty = true;
if (ecminfo)
{
char *buffer = NULL;
size_t len = 0;
ssize_t read;
while ((read = getline(&buffer, &len, ecminfo)) != -1)
{
ecmInfoEmpty = false;
if(emu == 1 || emu == 2){
sscanf(buffer, "%*s %*s ECM on CaID 0x%4s, pid 0x%4s", caid1, pid1); // gbox, mgcamd
sscanf(buffer, "prov: %06[^',',(]", prov1); // gbox, mgcamd
sscanf(buffer, "caid: 0x%4s", caid2); // oscam
sscanf(buffer, "pid: 0x%4s", pid2); // oscam
sscanf(buffer, "provider: %s", provider1); // gbox
sscanf(buffer, "prov: 0x%6s", prov1); // oscam
sscanf(buffer, "prov: 0x%s", prov2); // oscam
sscanf(buffer, "decode:%15s", decode1); // gbox
sscanf(buffer, "from: %29s", net); // oscam
sscanf(buffer, "from: %29s", source1); // oscam
sscanf(buffer, "from: %s", from1); // oscam
}
if(emu == 2){
sscanf(buffer, "decode:%8s", source1); // gbox
sscanf(buffer, "response:%05s", response1); // gbox
sscanf(buffer, "provider: %02s", prov1); // gbox
}
if(emu == 1)
sscanf(buffer, "source: %08s", source1); // mgcamd
sscanf(buffer, "caid: 0x%4s", caid1); // oscam
sscanf(buffer, "pid: 0x%4s", pid1); // oscam
sscanf(buffer, "from: %29s", source1); // oscam
sscanf(buffer, "prov: 0x%6s", prov1); // oscam
sscanf(buffer, "ecm time: %9s",response1); // oscam
sscanf(buffer, "reader: %18s", reader); // oscam
sscanf(buffer, "protocol: %18s", protocol); // oscam
if(emu == 3){
sscanf(buffer, "source: %08s", source1); // osca,
sscanf(buffer, "caid: 0x%4s", caid1); // oscam
sscanf(buffer, "pid: 0x%4s", pid1); // oscam
sscanf(buffer, "from: %29s", source1); // oscam
sscanf(buffer, "prov: 0x%6s", prov1); // oscam
sscanf(buffer, "ecm time: %9s",response1); // oscam
sscanf(buffer, "reader: %18s", reader); // oscam
sscanf(buffer, "protocol: %18s", protocol); // oscam
}
sscanf(buffer, "%c%c0: %02s %02s %02s %02s %02s %02s %02s %02s",&tmp,&tmp, cw0_[0], cw0_[1], cw0_[2], cw0_[3], cw0_[4], cw0_[5], cw0_[6], cw0_[7]); // gbox, mgcamd oscam
sscanf(buffer, "%c%c1: %02s %02s %02s %02s %02s %02s %02s %02s",&tmp,&tmp, cw1_[0], cw1_[1], cw1_[2], cw1_[3], cw1_[4], cw1_[5], cw1_[6], cw1_[7]); // gbox, mgcamd oscam
sscanf(buffer, "%*s %*s ECM on CaID 0x%4s, pid 0x%4s", caid1, pid1); // gbox, mgcamd
sscanf(buffer, "caid: 0x%4s", caid2); // oscam
sscanf(buffer, "pid: 0x%4s", pid2); // oscam
sscanf(buffer, "provider: %s", provider1); // gbox
sscanf(buffer, "prov: %[^',']", prov1); // gbox, mgcamd
sscanf(buffer, "prov: 0x%s", prov2); // oscam
sscanf(buffer, "decode:%15s", decode1); // gbox
sscanf(buffer, "source: %s", source1); // mgcamd
sscanf(buffer, "from: %s", from1); // oscam
}
fclose (ecminfo);
if (buffer)
free (buffer);
if(ecmInfoEmpty)
return;
if(emu == 3){
std::string kname = source1;
size_t pos1 = kname.find_last_of("/")+1;
size_t pos2 = kname.find_last_of(".");
if(pos2>pos1)
kname=kname.substr(pos1, pos2-pos1);
snprintf(source1,sizeof(source1),"%s",kname.c_str());
}
if(emu == 2 && response1[0] != 0){
char tmp_res[10] = "";
memcpy(tmp_res,response1,sizeof(tmp_res));
if(response1[3] != 0){
snprintf(response1,sizeof(response1),"%c.%s",tmp_res[0],&tmp_res[1]);
} else
snprintf(response1,sizeof(response1),"0.%s",tmp_res);
}
// tmp_cw0=(cw0_[0][0]<<8)+cw0_[0][1];
// tmp_cw1=(cw1_[0][0]<<8)+cw1_[0][1];
// if((tmp_cw0+tmp_cw1) != (cw0+cw1)){
// cw0=tmp_cw0;
// cw1=tmp_cw1;
// }
}
else
{
if (g_settings.infoviewer_ecm_info == 1)
frameBuffer->paintBackgroundBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-185, 225, g_InfoViewer->ChanHeight+105);
else
frameBuffer->paintBackgroundBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-185, 225, g_InfoViewer->ChanHeight+105);
return;
}
if (prov1[strlen(prov1)-1] == '\n')
prov1[strlen(prov1)-1] = '\0';
char share_at[32] = {0};
char share_card[5] = {0};
char share_id[5] = {0};
int share_net = 0;
const char *share_info = "/tmp/share.info";
FILE* shareinfo = fopen (share_info, "r");
if (shareinfo)
{
char *buffer = NULL;
size_t len = 0;
ssize_t read;
while ((read = getline(&buffer, &len, shareinfo)) != -1)
{
sscanf(buffer, "CardID %*s at %s Card %s Sl:%*s Lev:%*s dist:%*s id:%s", share_at, share_card, share_id);
if ((strncmp(caid1, share_card, 4) == 0) && (strncmp(prov1, share_id, 4) == 0))
{
share_net = 1;
break;
}
}
fclose (shareinfo);
if (buffer)
free (buffer);
}
const char *gbox_info = "<< Gbox-ECM-Info >>";
const char *mgcamd_info = "<< Mgcamd-ECM-Info >>";
const char *oscam_info = "<< OScam-ECM-Info >>";
if (g_settings.infoviewer_ecm_info == 1)
{
if (emu == 2)
{
painttECMInfo(160, gbox_info, caid1, source1, response1, prov1);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-20, 80, "From:", COL_INFOBAR_TEXT, 0, true);
if (strstr(source1, "Net" ) != NULL)
{
if (share_net == 1)
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-20, 130, share_at, COL_INFOBAR_TEXT, 0, true);
else
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-20, 130, "N/A", COL_INFOBAR_TEXT, 0, true);
}
else
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-20, 130, "127.0.0.1", COL_INFOBAR_TEXT, 0, true);
}
else if ((emu == 1) || (emu == 3))
{
painttECMInfo((emu == 1) ?180:190,(emu == 1)? mgcamd_info:oscam_info, caid1, source1, response1, prov1);
if(emu == 3){
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-20, 80, "Reader:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-20, 130, reader, COL_INFOBAR_TEXT, 0, true);
}
}
}
if (g_settings.infoviewer_ecm_info == 2)
{
bool gboxECM = false;
int gboxoffset = 0,i=0;
if (emu == 2){
gboxECM = true;
gboxoffset = 20;
}
frameBuffer->paintBoxRel(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-180, 220, g_InfoViewer->ChanHeight+80+gboxoffset, COL_INFOBAR_SHADOW_PLUS_0, g_settings.rounded_corners ? CORNER_RADIUS_MID : 0);
frameBuffer->paintBoxRel(g_InfoViewer->BoxEndX-220, g_InfoViewer->BoxStartY-185, 220, g_InfoViewer->ChanHeight+80+gboxoffset, COL_INFOBAR_PLUS_0, g_settings.rounded_corners ? CORNER_RADIUS_MID : 0);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-140, 80, "CaID:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-120, 80, "PID:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-100, 80, "Decode:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-80, 80, "Provider:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-60, 42, "CW0:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-40, 42, "CW1:", COL_INFOBAR_TEXT, 0, true);
for(i=0;i<8;i++){
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-(173-(i*21)), g_InfoViewer->BoxStartY-60, 21, cw0_[i], COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-(173-(i*21)), g_InfoViewer->BoxStartY-40, 21, cw1_[i], COL_INFOBAR_TEXT, 0, true);
}
if (gboxECM)
{
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-190, g_InfoViewer->BoxStartY-160, 160, gbox_info, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-140, 80, caid1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-120, 80, pid1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-100, 70, source1, COL_INFOBAR_TEXT, 0, true);
if(response1[0] != 0)
{
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-90, g_InfoViewer->BoxStartY-100, 15, "in", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-70, g_InfoViewer->BoxStartY-100, 45, response1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-25, g_InfoViewer->BoxStartY-100, 10, "s", COL_INFOBAR_TEXT, 0, true);
}
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-150, g_InfoViewer->BoxStartY-80, 130, prov1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-20, 50, "From:", COL_INFOBAR_TEXT, 0, true);
if (strstr(source1, "Net") != NULL)
{
if (share_net == 1)
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-173, g_InfoViewer->BoxStartY-20, 160, share_at, COL_INFOBAR_TEXT, 0, true);
else
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-173, g_InfoViewer->BoxStartY-20, 160, "N/A", COL_INFOBAR_TEXT, 0, true);
}
else
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-173, g_InfoViewer->BoxStartY-20, 160, "127.0.0.1", COL_INFOBAR_TEXT, 0, true);
}
else if ((emu == 1) || (emu == 3))
{
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-200, g_InfoViewer->BoxStartY-160, 190,(emu == 1)? mgcamd_info:oscam_info, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-140, 80, caid1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-120, 80, pid1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-100, 70, source1, COL_INFOBAR_TEXT, 0, true);
//g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-70, g_InfoViewer->BoxStartY-100, 20, "", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-55, g_InfoViewer->BoxStartY-100, 70, response1, COL_INFOBAR_TEXT, 0, true);
//g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-25, g_InfoViewer->BoxStartY-100, 20, "", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-80, 130, prov1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-140, 80, "CaID:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-140, 130, caid2, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-120, 80, "PID:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-120, 130, pid2, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-100, 80, "Decode:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-100, 130, from1, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-80, 80, "Provider:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-135, g_InfoViewer->BoxStartY-80, 130, prov2, COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-60, 42, "CW0:", COL_INFOBAR_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(g_InfoViewer->BoxEndX-215, g_InfoViewer->BoxStartY-40, 42, "CW1:", COL_INFOBAR_TEXT, 0, true);
}
}
}
|
FFTEAM/FFTEAM-MP3-Martii
|
src/gui/infoviewer_bb.cpp
|
C++
|
gpl-3.0
| 47,910
|
/*
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.batik.dom.svg;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import org.apache.batik.css.engine.SVGCSSEngine;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGElement;
import org.w3c.dom.svg.SVGException;
import org.w3c.dom.svg.SVGFitToViewBox;
import org.w3c.dom.svg.SVGMatrix;
import org.w3c.dom.svg.SVGRect;
/**
* This class provides support for the SVGLocatable interface.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
*/
public class SVGLocatableSupport {
/**
* Creates a new SVGLocatable element.
*/
public SVGLocatableSupport() {
}
/**
* To implement {@link
* org.w3c.dom.svg.SVGLocatable#getNearestViewportElement()}.
*/
public static SVGElement getNearestViewportElement(Element e) {
Element elt = e;
while (elt != null) {
elt = SVGCSSEngine.getParentCSSStylableElement(elt);
if (elt instanceof SVGFitToViewBox) {
break;
}
}
return (SVGElement)elt;
}
/**
* To implement {@link
* org.w3c.dom.svg.SVGLocatable#getFarthestViewportElement()}.
*/
public static SVGElement getFarthestViewportElement(Element elt) {
return (SVGElement)elt.getOwnerDocument().getDocumentElement();
}
/**
* To implement {@link org.w3c.dom.svg.SVGLocatable#getBBox()}.
*/
public static SVGRect getBBox(Element elt) {
final SVGOMElement svgelt = (SVGOMElement)elt;
SVGContext svgctx = svgelt.getSVGContext();
if (svgctx == null) return null;
if (svgctx.getBBox() == null) return null;
return new SVGRect() {
public float getX() {
return (float)svgelt.getSVGContext().getBBox().getX();
}
public void setX(float x) throws DOMException {
throw svgelt.createDOMException
(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"readonly.rect", null);
}
public float getY() {
return (float)svgelt.getSVGContext().getBBox().getY();
}
public void setY(float y) throws DOMException {
throw svgelt.createDOMException
(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"readonly.rect", null);
}
public float getWidth() {
return (float)svgelt.getSVGContext().getBBox().getWidth();
}
public void setWidth(float width) throws DOMException {
throw svgelt.createDOMException
(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"readonly.rect", null);
}
public float getHeight() {
return (float)svgelt.getSVGContext().getBBox().getHeight();
}
public void setHeight(float height) throws DOMException {
throw svgelt.createDOMException
(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"readonly.rect", null);
}
};
}
/**
* To implement {@link org.w3c.dom.svg.SVGLocatable#getCTM()}.
*/
public static SVGMatrix getCTM(Element elt) {
final SVGOMElement svgelt = (SVGOMElement)elt;
return new AbstractSVGMatrix() {
protected AffineTransform getAffineTransform() {
return svgelt.getSVGContext().getCTM();
}
};
}
/**
* To implement {@link org.w3c.dom.svg.SVGLocatable#getScreenCTM()}.
*/
public static SVGMatrix getScreenCTM(Element elt) {
final SVGOMElement svgelt = (SVGOMElement)elt;
return new AbstractSVGMatrix() {
protected AffineTransform getAffineTransform() {
SVGContext context = svgelt.getSVGContext();
AffineTransform ret = context.getGlobalTransform();
AffineTransform scrnTrans = context.getScreenTransform();
if (scrnTrans != null)
ret.preConcatenate(scrnTrans);
return ret;
}
};
}
/**
* To implement {@link
* org.w3c.dom.svg.SVGLocatable#getTransformToElement(SVGElement)}.
*/
public static SVGMatrix getTransformToElement(Element elt,
SVGElement element)
throws SVGException {
final SVGOMElement currentElt = (SVGOMElement)elt;
final SVGOMElement targetElt = (SVGOMElement)element;
return new AbstractSVGMatrix() {
protected AffineTransform getAffineTransform() {
AffineTransform cat =
currentElt.getSVGContext().getGlobalTransform();
if (cat == null) {
cat = new AffineTransform();
}
AffineTransform tat =
targetElt.getSVGContext().getGlobalTransform();
if (tat == null) {
tat = new AffineTransform();
}
AffineTransform at = new AffineTransform(cat);
try {
at.preConcatenate(tat.createInverse());
return at;
} catch (NoninvertibleTransformException ex) {
throw currentElt.createSVGException
(SVGException.SVG_MATRIX_NOT_INVERTABLE,
"noninvertiblematrix",
null);
}
}
};
}
}
|
srnsw/xena
|
plugins/image/ext/src/batik-1.7/sources/org/apache/batik/dom/svg/SVGLocatableSupport.java
|
Java
|
gpl-3.0
| 6,739
|
/*
* Copyright (C) 2012 Timo Vesalainen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.vesalainen.bcc;
import java.io.IOException;
import java.util.Map;
/**
*
* @author Timo Vesalainen <timo.vesalainen@iki.fi>
*/
public class LongASM extends Assembler implements TypeASM
{
LongASM(CodeDataOutput out, Map<String, Label> labels)
{
super(out, labels);
}
public void tadd() throws IOException
{
out.writeByte(LADD);
}
public void taload() throws IOException
{
out.writeByte(LALOAD);
}
public void tand() throws IOException
{
out.writeByte(LAND);
}
public void tastore() throws IOException
{
out.writeByte(LASTORE);
}
public void tcmp() throws IOException
{
out.writeByte(LCMP);
}
public void tconst(int i) throws IOException
{
switch (i)
{
case 0:
tconst_0();
break;
case 1:
tconst_1();
break;
default:
throw new UnsupportedOperationException("Not supported yet.");
}
}
public void tconst_0() throws IOException
{
out.writeByte(LCONST_0);
}
public void tconst_1() throws IOException
{
out.writeByte(LCONST_1);
}
public void tdiv() throws IOException
{
out.writeByte(LDIV);
}
public void tload(int index) throws IOException
{
switch (index)
{
case 0:
out.writeByte(LLOAD_0);
break;
case 1:
out.writeByte(LLOAD_1);
break;
case 2:
out.writeByte(LLOAD_2);
break;
case 3:
out.writeByte(LLOAD_3);
break;
default:
if (index < 256)
{
out.writeByte(LLOAD);
out.writeByte(index);
}
else
{
out.writeByte(WIDE);
out.writeByte(LLOAD);
out.writeShort(index);
}
break;
}
}
public void tmul() throws IOException
{
out.writeByte(LMUL);
}
public void tneg() throws IOException
{
out.writeByte(LNEG);
}
public void tor() throws IOException
{
out.writeByte(LOR);
}
public void trem() throws IOException
{
out.writeByte(LREM);
}
public void treturn() throws IOException
{
out.writeByte(LRETURN);
}
public void tshl() throws IOException
{
out.writeByte(LSHL);
}
public void tshr() throws IOException
{
out.writeByte(LSHR);
}
public void tstore(int index) throws IOException
{
switch (index)
{
case 0:
out.writeByte(LSTORE_0);
break;
case 1:
out.writeByte(LSTORE_1);
break;
case 2:
out.writeByte(LSTORE_2);
break;
case 3:
out.writeByte(LSTORE_3);
break;
default:
if (index < 256)
{
out.writeByte(LSTORE);
out.writeByte(index);
}
else
{
out.writeByte(WIDE);
out.writeByte(LSTORE);
out.writeShort(index);
}
break;
}
}
public void tsub() throws IOException
{
out.writeByte(LSUB);
}
public void tushr() throws IOException
{
out.writeByte(LUSHR);
}
public void txor() throws IOException
{
out.writeByte(LXOR);
}
public void i2t() throws IOException
{
out.writeByte(I2L);
}
public void f2t() throws IOException
{
out.writeByte(F2L);
}
public void d2t() throws IOException
{
out.writeByte(D2L);
}
public void tipush(int b) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void tinc(int index, int con) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void l2t() throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpeq(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpne(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmplt(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpge(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpgt(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmple(Object target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void tcmpl() throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void tcmpg() throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void tconst_null() throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpeq(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpne(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmplt(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpge(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmpgt(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
public void if_tcmple(String target) throws IOException
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
|
tvesalainen/bcc
|
src/main/java/org/vesalainen/bcc/LongASM.java
|
Java
|
gpl-3.0
| 7,297
|
/*
* stereographic projection
*
* Copyright 2010 dan collins <danc@badbytes.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
from numpy import *
def Convert(channelpnts):
#assuming a half ~sphere, we
rad = max(chan['lpnt'][:,1]) - min(chan['lpnt'][:,1])
|
badbytes/pymeg
|
meg/stereographicprojection.py
|
Python
|
gpl-3.0
| 1,056
|
/*******************************************************************************
This file is part of G2D.
G2D is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
G2D is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You can get a copy of of the GNU General Public License
at<http://www.gnu.org/licenses/>.
Author: Michele Mei
E-Mail: michele.mei@gmail.com
*******************************************************************************/
#ifndef __osl_g2d_path_h
#define __osl_g2d_path_h
#include "Oriented.h"
#include <vector>
namespace osl {
namespace g2d {
/*! \class Path
\brief A path in two-dimension
A path can be "open" or "closed", if the starting and end points coincides
(\ref Point::operator==) then it is a closed path. A path can be self
intersecting.
*/
class G2D_API Path : public Oriented
{
struct PathAttributes;
PathAttributes* attributes;
public:
/*!
One item constructor
\param start_item First item
*/
explicit Path(std::unique_ptr<Oriented> start_item);
/*!
Create a path from a vector of oriented items.
\param oriented_items First item
\param from Optional. Initial item, if 0 taken the first
\param to Optional. Final item, if 0 taken the the last
*/
explicit Path(std::vector<std::unique_ptr<Oriented>>& oriented_items,
unsigned int from = 0, unsigned int to = 0);
bool operator==(const Item&) const override;
//! Check if path is close
/*!
\return True if the first and end points of path are equals.
Using \ref Point::operator==.
*/
bool IsClosed() const;
//! Check if items path are consecutive
static bool IsConsecutive(std::vector<std::unique_ptr<Oriented>>& items);
//! Get oriented item at the specified index
/*!
\param[in] index Item's index
\return A const reference to unique_ptr of oriented item
*/
const std::unique_ptr<Oriented>& at(unsigned int index) const;
//! Push back an oriented item in the path
/*!
\param[in] oriented_item Oriented item
*/
void push_back(std::unique_ptr<Oriented> oriented_item);
//! Erase the oriented item at the specified index
/*!
\param[in] index Item's index
\return A unique_ptr with the element eliminated on which the move was made
and can be taken over by the caller
*/
std::unique_ptr<Oriented> erase(unsigned int index);
//! Gets the number of oriented items in the path
unsigned int size() const;
//! Get all the items in the path
/*!
\return A const vector with the item's oriented items.
*/
const std::vector<std::unique_ptr<Oriented>>& get_items() const;
/* from Item.h */
virtual ~Path();
std::unique_ptr<Item> Clone() const override;
void Move(double delta_x, double delta_y) override;
void Move(const Point& delta) override;
/* from Oriented.h */
const Point& GetEndPoint() const override;
void Reverse() override;
};
}
}
#endif
|
michelemei/g2d
|
src/g2d/Path.h
|
C
|
gpl-3.0
| 3,171
|
<?php
// Activate session
session_start();
// Start output buffer
ob_start();
// Include utility files
require_once 'include/config.php';
require_once BUSINESS_DIR . 'error_handler.php';
// Set the error handler
ErrorHandler::SetHandler();
// Load the application page template
require_once PRESENTATION_DIR . 'application.php';
require_once PRESENTATION_DIR . 'link.php';
// Load the database handler
require_once BUSINESS_DIR . 'database_handler.php';
// Load Business Tier
require_once BUSINESS_DIR . 'catalog.php';
require_once BUSINESS_DIR . 'shopping_cart.php';
require_once BUSINESS_DIR . 'orders.php';
require_once BUSINESS_DIR . 'symmetric_crypt.php';
require_once BUSINESS_DIR . 'secure_card.php';
require_once BUSINESS_DIR . 'customer.php';
require_once BUSINESS_DIR . 'i_pipeline_section.php';
require_once BUSINESS_DIR . 'order_processor.php';
require_once BUSINESS_DIR . 'ps_initial_notification.php';
require_once BUSINESS_DIR . 'ps_check_funds.php';
require_once BUSINESS_DIR . 'ps_check_stock.php';
require_once BUSINESS_DIR . 'ps_stock_ok.php';
require_once BUSINESS_DIR . 'ps_take_payment.php';
require_once BUSINESS_DIR . 'ps_ship_goods.php';
require_once BUSINESS_DIR . 'ps_ship_ok.php';
require_once BUSINESS_DIR . 'ps_final_notification.php';
// Load Smarty template file
$application = new Application();
// Display the page
$application->display('store_admin.tpl');
// Close database connection
DatabaseHandler::Close();
// Output content from the buffer
flush();
ob_flush();
ob_end_clean();
?>
|
ray1919/zsq3p1_db
|
admin.php
|
PHP
|
gpl-3.0
| 1,583
|
/******************************************************************************\
* _ ___ ____ __ _ *
* | | | \ \___/ / \/ | ___ __ _ ___| |_ *
* | |_| |\ /| |\/| |/ __/ _` / __| __| *
* | _ | \ - / | | | | (_| (_| \__ \ |_ *
* |_| |_| \_/ |_| |_|\___\__,_|___/\__| *
* *
* This file is part of the HAMcast project. *
* *
* HAMcast is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* HAMcast is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with HAMcast. If not, see <http://www.gnu.org/licenses/>. *
* *
* Contact: HAMcast support <hamcast-support@informatik.haw-hamburg.de> *
\******************************************************************************/
#include <boost/thread.hpp>
#include "hamcast/uri.hpp"
#include "hamcast/multicast_packet.hpp"
#include "hamcast/interface_property.hpp"
#include "hamcast/ipc/message.hpp"
#include "hamcast/util/serialization.hpp"
namespace {
const size_t max_cache_size = 50;
typedef std::map<std::string, hamcast::uri> uri_cache;
boost::thread_specific_ptr<uri_cache> m_uri_cache;
// check if @p uri_str is cached
// if @p uri_str is cached then set storage to the cached uri object
// otherwise put a new instance to the cache and set storage afterwards
void uri_lookup(const std::string& uri_str, hamcast::uri& storage)
{
uri_cache* cache = m_uri_cache.get();
if (!cache)
{
cache = new uri_cache;
m_uri_cache.reset(cache);
}
uri_cache::const_iterator i(cache->find(uri_str));
if (i != cache->end())
{
storage = i->second;
}
else
{
storage = hamcast::uri(uri_str);
// purge the cache if full
if (cache->size() >= max_cache_size)
{
cache->clear();
}
cache->insert(uri_cache::value_type(uri_str, storage));
}
}
} // namespace <anonymous>
namespace hamcast { namespace util {
/******************************************************************************
* integers *
******************************************************************************/
deserializer& operator>>(deserializer& d, bool& storage)
{
boost::uint8_t tmp;
d >> tmp;
storage = (tmp != 0);
return d;
}
/******************************************************************************
* HAMcast types *
******************************************************************************/
serializer& operator<<(serializer& s, const uri& what)
{
return (s << what.str());
}
deserializer& operator>>(deserializer& d, uri& storage)
{
std::string str;
d >> str;
uri_lookup(str, storage);
return d;
}
serializer& operator<<(serializer& s, const multicast_packet& mp)
{
s << mp.from() << mp.size();
if (mp.size() > 0)
{
s.write(mp.size(), mp.data());
}
return s;
}
deserializer& operator>>(deserializer& d, multicast_packet& mp)
{
uri mp_from;
boost::uint32_t mp_size;
d >> mp_from >> mp_size;
char* mp_data = 0;
if (mp_size > 0)
{
mp_data = new char[mp_size];
d.read(mp_size, mp_data);
}
multicast_packet tmp(mp_from, mp_size, mp_data);
mp = tmp;
return d;
}
serializer& operator<<(serializer& s, const interface_property& ip)
{
return (s << ip.id << ip.name << ip.address << ip.technology);
}
deserializer& operator>>(deserializer& d, interface_property& ip)
{
return (d >> ip.id >> ip.name >> ip.address >> ip.technology);
}
serializer& operator<<(serializer& s, const ipc::message& what)
{
return ipc::message::serialize(s, what);
}
deserializer& operator>>(deserializer& d, ipc::message::ptr& mptr)
{
return ipc::message::deserialize(d, mptr);
}
/******************************************************************************
* standard template library types *
******************************************************************************/
serializer& operator<<(serializer& s, const std::string& what)
{
s << static_cast<boost::uint32_t>(what.size());
s.write(what.size(), what.c_str());
return s;
}
deserializer& operator>>(deserializer& d, std::string& storage)
{
boost::uint32_t str_size;
d >> str_size;
storage.reserve(str_size);
// read string in 128 byte chunks
char chunk[129];
while (str_size > 0)
{
size_t rd_size = std::min<size_t>(128, str_size);
d.read(rd_size, chunk);
chunk[rd_size] = '\0';
storage += chunk;
str_size -= rd_size;
}
return d;
}
} } // namespace hamcast::util
|
HAMcast/HAMcast
|
libhamcast/src/serialization.cpp
|
C++
|
gpl-3.0
| 5,912
|
/*
* This file is part of the L2J Global project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jglobal.gameserver.model.conditions;
import com.l2jglobal.gameserver.model.actor.L2Character;
import com.l2jglobal.gameserver.model.items.L2Item;
import com.l2jglobal.gameserver.model.skills.Skill;
/**
* The Class ConditionPlayerHp.
* @author mr
*/
public class ConditionPlayerHp extends Condition
{
private final int _hp;
/**
* Instantiates a new condition player hp.
* @param hp the hp
*/
public ConditionPlayerHp(int hp)
{
_hp = hp;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
return (effector != null) && (((effector.getCurrentHp() * 100) / effector.getMaxHp()) <= _hp);
}
}
|
rubenswagner/L2J-Global
|
java/com/l2jglobal/gameserver/model/conditions/ConditionPlayerHp.java
|
Java
|
gpl-3.0
| 1,390
|
#!/usr/bin/env python
import asyncio
import json
from bson import json_util
from pymongo import MongoClient
from .search import Query
from .crawl import Spider
class ClientSpider(Spider):
"""
Indexes the client website and saves all pages to a mongodb collection
"""
def __init__(self, client):
self.client = client
uri = client.website
super().__init__(uri)
async def save_pages(self):
"""Save pages to mongodb"""
pages = await self.crawl()
mongo_client = MongoClient('localhost', 27017)
database = mongo_client.pages
collection = database[self.client.name]
collection.delete_many({}) # delete previous pages
collection.insert_many(pages) # insert new pages
# Dump loaded BSON to valid JSON string and reload it as dict
pages_sanitised = json.loads(json_util.dumps(pages))
return pages_sanitised
class ClientQuery(Query):
"""
Query a client
"""
def __init__(self, client, query):
self.client = client
pages = client.get_pages(client.name)
query = query
super().__init__(pages, query)
def modify_search(self):
"""Modify search with client settings"""
pages = self.search()
# Dump loaded BSON to valid JSON string and reload it as dict
pages_sanitised = json.loads(json_util.dumps(pages))
return pages_sanitised
if __name__ == "__main__":
import doctest
doctest.testmod()
|
apt-helion/viperidae
|
api/developer.py
|
Python
|
gpl-3.0
| 1,525
|
# -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import os
from autonomie.models.user.userdatas import (
ZoneOption,
ZoneQualificationOption,
StudyLevelOption,
SocialStatusOption,
ActivityTypeOption,
PcsOption,
PrescripteurOption,
NonAdmissionOption,
ParcoursStatusOption,
SocialDocTypeOption,
CaeSituationOption,
AntenneOption,
)
from autonomie.models.career_path import (
TypeContratOption,
EmployeeQualityOption,
TypeSortieOption,
MotifSortieOption,
)
from autonomie.views.admin.tools import (
get_model_admin_view,
)
from autonomie.views.admin.userdatas import (
USERDATAS_URL,
UserDatasIndexView,
)
def includeme(config):
"""
Configure route and views for userdatas management
"""
for model in (
CaeSituationOption,
AntenneOption,
ZoneOption,
ZoneQualificationOption,
StudyLevelOption,
SocialStatusOption,
EmployeeQualityOption,
ActivityTypeOption,
PcsOption,
PrescripteurOption,
NonAdmissionOption,
ParcoursStatusOption,
MotifSortieOption,
SocialDocTypeOption,
TypeSortieOption,
TypeContratOption,
):
view = get_model_admin_view(model, r_path=USERDATAS_URL)
config.add_route(view.route_name, view.route_name)
config.add_admin_view(view, parent=UserDatasIndexView)
|
CroissanceCommune/autonomie
|
autonomie/views/admin/userdatas/options.py
|
Python
|
gpl-3.0
| 1,533
|
# -*- coding: utf8 -*-
"""Configuration params for sherlock."""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
CORS_HEADER = 'Content-Type'
TOKEN_TIMEOUT = 9999
SECRET_KEY = os.urandom(25)
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
leoGalani/sherlock
|
config.py
|
Python
|
gpl-3.0
| 309
|
# #############################################################################
#
# buckshot.py - given a set of numbers and a marker name, make sarsoft markers
# corresponding to all three lat-lon coordinate systems
#
#
# developed for Nevada County Sheriff's Search and Rescue
# Copyright (c) 2015 Tom Grundy
#
# http://ncssarradiologsoftware.sourceforge.net
#
# Contact the author at nccaves@yahoo.com
# Attribution, feedback, bug reports and feature requests are appreciated
#
# REVISION HISTORY
#-----------------------------------------------------------------------------
# DATE | AUTHOR | NOTES
#-----------------------------------------------------------------------------
# 5-29-16 TMG optionally write a GPX file, with color and symbol data;
# skip the URL export step if the URL field is blank;
# rearrange GUI accordingly
# 3-3-17 TMG bug fixes and cleanup (fixes github issues 6,7,8,9)
# 3-11-17 TMG fix issue 10 (crash when URL is other than localhost)
# 4-16-17 TMG fix issue 3 (mark the best match) - don't attempt an
# algorithm - just let the user select one possibility
# as the best match; this required changing the fields
# to QListWidgets; make sure the best match is exported
# to sarsoft with appropriate text, and to gpx with
# appropriate icon for Locus Map (android app). Can
# investigate best icons for other apps/programs later.
# 1-21-18 TMG fix issue 12 (integrate with search-in-progress) by
# creating a new sartopo folder each time, and placing
# all newly created buckshot markers in that folder
# 8-29-18 TMG fix #14 (work with either API version) by using external
# module sartopo_python (see separate GitHub project
# by that name)
# 10-7-18 TMG overhaul to work with significant api changes in v4151
# of sar.jar - probably not backwards compatible - required
# changes to sartopo_python also; allow URL on network
# other than localhost
#
# #############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See included file LICENSE.txt for full license terms, also
# available at http://opensource.org/licenses/gpl-3.0.html
#
# ############################################################################
#
# Originally written and tested on Windows Vista Home Basic 32-bit
# with PyQt 5.4 and Python 3.4.2; should run for Windows Vista and higher
#
# Note, this file must be encoded as UTF-8, to preserve degree signs in the code
#
# ############################################################################
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import xml.dom.minidom
import regex as re
from parse import *
import sys
import requests
import json
import os
from sartopo_python import SartopoSession
from buckshot_ui import Ui_buckshot
# valid delimiters: space, period, X, x, D, d, M, m, ', S, s, "
# 'best match' = all correct delimiters in all the correct places
# 'close match' = some delimieter in all the correct places
# first, define exactly what will qualify as an 'exact match';
# then, relax that definition some to define a 'close match'
# make a canonical form of the input string;
# make a canonical form of each possibility;
# if they are identical, it is an exact match
# i string actual coordinates should this be a match?
# 1. 39d120d 39.0dN -120.0dW exact
# 2. 39.0d120.0d exact
# 3. 39d-120d exact
# 4. 39120 close
# 5. 3901200 close
# 4. 39d12m120d12m 39d12.0mN -120d12.0mW exact
#
# preprocess the input string:
# 1. remove minus sign(s)
# 2. convert to lowercase
# 3. replace ' with m
# 4. replace " with s
# 5. replace all letters other than [dmsx] with <space>
# 6. replace all multiple-spaces with just one space
# 7. do some work to find the lat/lon break ('x'):
# 7a. for each known delimiter [dms]: if the next delimiter is d, then insert
# 'x' immediately after the current delimiter
# preprocessed input string characteristics (i.e. canonical form):
# - no minus signs
# - unknown delimiters are represented by a <space>
# - known delimiters are [.dmsx]
# criteria for exact match:
#
delimiterRegEx="[ .XxDdMm'Ss\"]"
bestMatchLabelPrefix="*"
closeMatchLabelPrefix="+"
class MyWindow(QDialog,Ui_buckshot):
def __init__(self,parent):
QDialog.__init__(self)
self.setWindowFlags(self.windowFlags()|Qt.WindowMinMaxButtonsHint)
self.parent=parent
self.ui=Ui_buckshot()
self.ui.setupUi(self)
self.setAttribute(Qt.WA_DeleteOnClose)
self.coordDdStringList=[]
self.coordDMmStringList=[]
self.coordDMSsStringList=[]
# default gpx dir: ~\Documents if it exists, ~ otherwise
self.gpxDefaultDir=os.path.expanduser("~")
docDir=self.gpxDefaultDir+"\\Documents"
if os.path.isdir(docDir):
self.gpxDefaultDir=docDir
self.ui.gpxFileNameField.setText(self.gpxDefaultDir+"\\buckshot_blank.gpx")
self.bestMatch=""
def markerNameChanged(self):
print("markerNameChanged called")
markerName=self.ui.markerNameField.text()
fileName=self.ui.gpxFileNameField.text()
idx=fileName.find("buckshot_")
if idx > -1:
self.ui.gpxFileNameField.setText(fileName[0:idx]+"buckshot_"+markerName+".gpx")
def gpxSetFileName(self):
markerName=self.ui.markerNameField.text()
initVal=self.ui.gpxFileNameField.text()
if initVal=="":
initVal=self.gpxDefaultDir+"\\buckshot_"+markerName+".gpx"
gpxFileName=QFileDialog.getSaveFileName(self,"GPX filename",initVal,filter="gpx (*.gpx)")
# cancel from file dialog returns a real array with a blank filename;
# prevent this from blanking out the filename field
if gpxFileName[0]!="":
self.ui.gpxFileNameField.setText(gpxFileName[0])
def writeGPX(self,markerList):
gpxFileName=self.ui.gpxFileNameField.text()
print("Writing GPX file "+gpxFileName)
# make sure the file is writable; if not, return False here
gpxFile=self.fnameValidate(gpxFileName)
if not gpxFile:
return False
doc=xml.dom.minidom.Document()
gpx=doc.createElement("gpx")
gpx.setAttribute("creator","BUCKSHOT")
gpx.setAttribute("version","1.1")
gpx.setAttribute("xmlns","http://www.topografix.com/GPX/1/1")
# each element in markerList will result in a gpx wpt token.
# markerList element syntax = [name,lat,lon,color]
# <desc> CDATA contains SARSoft marker and color
# <sym> CDATA contains Locus marker, parsed from marker name
# some relevant Locus markers:
# z-ico01 = red down arrow
# z-ico02 = red x
# z-ico03 = red donut
# z-ico04 = red dot
# z-ico05 = red down triangle
# same sequence as above: 06-10 = cyan; 11-15=green; 16-20=yellow
# misc-sunny = large green star bubble
for marker in markerList:
## print("marker:"+str(marker)+"\n")
[title,lat,lon,color,symbol]=marker
description=""
if title.startswith(bestMatchLabelPrefix):
description="User-selected best match!"
if title.startswith(closeMatchLabelPrefix):
description="CLOSE match for specified coordinates"
wpt=doc.createElement("wpt")
wpt.setAttribute("lat",str(lat))
wpt.setAttribute("lon",str(lon))
name=doc.createElement("name")
desc=doc.createElement("desc")
sym=doc.createElement("sym")
# descCDATAStr="comments=&url=%23"+marker[3][1:]
descCDATAStr=description
descCDATA=doc.createCDATASection(descCDATAStr)
if "_Dd" in title: # red
if title.startswith(bestMatchLabelPrefix):
symCDATAStr="z-ico01"
else:
symCDATAStr="z-ico04"
elif "_DMm" in title: # cyan
if title.startswith(bestMatchLabelPrefix):
symCDATAStr="z-ico06"
else:
symCDATAStr="z-ico09"
elif "_DMSs" in title: # yellow
if title.startswith(bestMatchLabelPrefix):
symCDATAStr="z-ico16"
else:
symCDATAStr="z-ico19"
else:
if title.startswith(bestMatchLabelPrefix):
symCDATAStr="z-ico11"
else:
symCDATAStr="z-ico14"
name.appendChild(doc.createTextNode(title))
desc.appendChild(descCDATA)
symCDATA=doc.createCDATASection(symCDATAStr)
sym.appendChild(symCDATA)
wpt.appendChild(name)
wpt.appendChild(desc)
wpt.appendChild(sym)
gpx.appendChild(wpt)
doc.appendChild(gpx)
gpxFile.write(doc.toprettyxml())
gpxFile.close()
return True
# calcLatLon - make guesses about actual coordinates based on a string of numbers
# called from textChanged of coordsField
# assumptions:
# - Degrees Latitude is a two-digit number starting with 2, 3, or 4
# - Degrees Longitude is a three-digit number starting with one, second digit
# either 0, 1, or 2
# - space or minus sign is a known delimiter and assumed to be correct
def calcLatLon(self):
### code to get overlapping matches (i.e. each possible longitude whole number) and their indices:
##import regex as re
##matches=re.finditer("1[012][0123456789]",numbers,overlapped=True)
##[match.span() for match in matches]
coordString=self.ui.coordsField.text()
# shortCoordString = the 'canonical' form that the possibilities will
# be compared to, to check for close or exact matches. Same as
# coordString, with standardized D/M/S delimiters; cannot eliminate all
# spaces at this point since they may or may not be important delimiters;
# therefore, will need to insert a space into the shortCoordString before
# longitude for each possibility on the fly during parsing; this ensures
# that original coordString with NO spaces at all can still make an
# best match.
shortCoordString=coordString.lower()
shortCoordString=re.sub(r'[Xx]',' ',shortCoordString) # replace X or x with space for canonical form
shortCoordString=re.sub(r'\s+',' ',shortCoordString) # get rid of duplicate spaces
shortCoordString=re.sub(r'\'','m',shortCoordString)
shortCoordString=re.sub(r'"','s',shortCoordString)
print("Short coordinate string for comparison:"+shortCoordString+"\n")
# different approach:
# make a list of the indeces and kinds of delimiters;
# if the indeces all match, it is a 'close' match;
# if the indeces all match AND each one is of the same kind, it is an 'best' match
delimIter=re.finditer(r'[ .dDmMsS\'"-]+',coordString)
## numbers=re.sub(r'[ .dDmMsS\'"-]','',coordString)
numbers=re.sub(r'\D','',coordString)
print("Raw Numbers:"+numbers+"\n")
## numbers=self.ui.numbersField.text()
self.coordDdStringList=[]
self.coordDMmStringList=[]
self.coordDMSsStringList=[]
latDegIndex=0
lonDegIndex=-1
pattern=re.compile('1[012][0123456789]') # assume longitude 100-129 west
matches=pattern.finditer(numbers,2,overlapped=True)
## print(str([match.span() for match in matches]))
for lonDegMobj in matches:
print(str(lonDegMobj.span()))
## lonDegMobj=pattern.search(numbers,2) # skip the first two characters
## if lonDegMobj!=None:
lonDegIndex=lonDegMobj.start()
lonDeg=lonDegMobj.group()
print("lonDegIndex: '"+str(lonDegIndex)+"'")
print("Longitude Degrees: '"+lonDeg+"'")
lonRestIndex=lonDegIndex+3
lonRest=numbers[lonRestIndex:]
print("Longitude rest: '"+lonRest+"'")
if int(numbers[0])>1 and int(numbers[0])<5: #assume latitude 20-49 north
latDeg=numbers[0:2]
latRest=numbers[2:lonDegIndex]
print("Latitude degrees: '"+latDeg+"'")
print("Latitude rest: '"+latRest+"'")
# initialize whole minutes and seconds to unrealizable values
# for use in the 'possible' section below
latMin1="99"
latMin2="99"
latSec11="99"
latSec12="99"
latSec21="99"
latSec22="99"
lonMin1="99"
lonMin2="99"
lonSec11="99"
lonSec12="99"
lonSec21="99"
lonSec22="99"
# initialize "rest" arguments to blank strings
latMin1Rest=""
latMin2Rest=""
latSec11Rest=""
latSec12Rest=""
latSec21Rest=""
latSec22Rest=""
lonMin1Rest=""
lonMin2Rest=""
lonSec11Rest=""
lonSec12Rest=""
lonSec21Rest=""
lonSec22Rest=""
# parse minutes and seconds from the rest of the string
# whole minutes and whole seconds could be one digit or two digits
if len(latRest)>0:
print("t1")
latMin1=latRest[0]
if len(latRest)>1:
print("t2")
latMin1Rest=latRest[1:]
latMin2=latRest[0:2]
if len(latRest)>2:
print("t2.5")
latMin2Rest=latRest[2:]
if len(latMin1Rest)>0:
print("t3")
latSec1=latMin1Rest[0:]
if len(latSec1)>0:
print("t4")
latSec11=latSec1[0]
if len(latSec1)>1:
print("t5")
latSec11Rest=latSec1[1:]
latSec12=latSec1[0:2]
if len(latSec1)>2:
print("t5.5")
latSec12Rest=latSec1[2:]
if len(latMin2Rest)>0:
print("t6")
latSec2=latMin2Rest[0:]
if len(latSec2)>0:
print("t7")
latSec21=latSec2[0]
if len(latSec2)>1:
print("t8")
latSec21Rest=latSec2[1:]
latSec22=latSec2[0:2]
if len(latSec2)>2:
print("t9")
latSec22Rest=latSec2[2:]
else:
latSec2="0" # account for implied zero seconds
latSec21="0"
else:
latSec1="0" # account for implied zero seconds
latSec11="0"
if len(lonRest)>0:
lonMin1=lonRest[0]
if len(lonRest)>1:
lonMin1Rest=lonRest[1:]
lonMin2=lonRest[0:2]
if len(lonRest)>2:
lonMin2Rest=lonRest[2:]
if len(lonMin1Rest)>0:
lonSec1=lonMin1Rest[0:]
if len(lonSec1)>0:
lonSec11=lonSec1[0]
if len(lonSec1)>1:
lonSec11Rest=lonSec1[1:]
lonSec12=lonSec1[0:2]
if len(lonSec1)>2:
lonSec12Rest=lonSec1[2:]
if len(lonMin2Rest)>0:
lonSec2=lonMin2Rest[0:]
if len(lonSec2)>0:
lonSec21=lonSec2[0]
if len(lonSec2)>1:
lonSec21Rest=lonSec2[1:]
lonSec22=lonSec2[0:2]
if len(lonSec2)>2:
lonSec22Rest=lonSec2[2:]
else:
lonSec2="0" # account for implied zero seconds
lonSec21="0"
else:
lonSec1="0" # account for implied zero seconds
lonSec11="0"
# set flags as to which ones are possible
# (whole min/sec <60 (2-digit) or <10 (1-digit))
latMin1Possible=int(latMin1)<10
latMin2Possible=int(latMin2)>9 and int(latMin2)<60
latSec11Possible=int(latSec11)<10
latSec12Possible=int(latSec12)<60
latSec21Possible=int(latSec21)<10
latSec22Possible=int(latSec22)<60
lonMin1Possible=int(lonMin1)<10
lonMin2Possible=int(lonMin2)>9 and int(lonMin2)<60
lonSec11Possible=int(lonSec11)<10
lonSec12Possible=int(lonSec12)<60
lonSec21Possible=int(lonSec21)<10
lonSec22Possible=int(lonSec22)<60
print("latMin1Possible:"+str(latMin1Possible)+":"+latMin1+":"+latMin1Rest)
print("latMin2Possible:"+str(latMin2Possible)+":"+latMin2+":"+latMin2Rest)
print("latSec11Possible:"+str(latSec11Possible)+":"+latSec11+":"+latSec11Rest)
print("latSec12Possible:"+str(latSec12Possible)+":"+latSec12+":"+latSec12Rest)
print("latSec21Possible:"+str(latSec21Possible)+":"+latSec21+":"+latSec21Rest)
print("latSec22Possible:"+str(latSec22Possible)+":"+latSec22+":"+latSec22Rest)
print("lonMin1Possible:"+str(lonMin1Possible)+":"+lonMin1+":"+lonMin1Rest)
print("lonMin2Possible:"+str(lonMin2Possible)+":"+lonMin2+":"+lonMin2Rest)
print("lonSec11Possible:"+str(lonSec11Possible)+":"+lonSec11+":"+lonSec11Rest)
print("lonSec12Possible:"+str(lonSec12Possible)+":"+lonSec12+":"+lonSec12Rest)
print("lonSec21Possible:"+str(lonSec21Possible)+":"+lonSec21+":"+lonSec21Rest)
print("lonSec22Possible:"+str(lonSec22Possible)+":"+lonSec22+":"+lonSec22Rest)
# zero-pad right-of-decimal if needed, i.e. no blank strings right-of-decimal
latRest=latRest or "0"
lonRest=lonRest or "0"
latMin1Rest=latMin1Rest or "0"
latMin2Rest=latMin2Rest or "0"
lonMin1Rest=lonMin1Rest or "0"
lonMin2Rest=lonMin2Rest or "0"
latSec11Rest=latSec11Rest or "0"
latSec12Rest=latSec12Rest or "0"
latSec21Rest=latSec21Rest or "0"
latSec22Rest=latSec22Rest or "0"
lonSec11Rest=lonSec11Rest or "0"
lonSec12Rest=lonSec12Rest or "0"
lonSec21Rest=lonSec21Rest or "0"
lonSec22Rest=lonSec22Rest or "0"
# build the lists of possible coordinate strings for each coordinate system
# (if only one of lat/lon per pair is possible, then the pair is
# not possible)
self.coordDdStringList.append(str(latDeg+"."+latRest+"deg N x "+lonDeg+"."+lonRest+"deg W"))
if latMin1Possible and lonMin1Possible:
self.coordDMmStringList.append(str(latDeg+"deg "+latMin1+"."+latMin1Rest+"min N x "+lonDeg+"deg "+lonMin1+"."+lonMin1Rest+"min W"))
if latMin1Possible and lonMin2Possible:
self.coordDMmStringList.append(str(latDeg+"deg "+latMin1+"."+latMin1Rest+"min N x "+lonDeg+"deg "+lonMin2+"."+lonMin2Rest+"min W"))
if latMin2Possible and lonMin1Possible:
self.coordDMmStringList.append(str(latDeg+"deg "+latMin2+"."+latMin2Rest+"min N x "+lonDeg+"deg "+lonMin1+"."+lonMin1Rest+"min W"))
if latMin2Possible and lonMin2Possible:
self.coordDMmStringList.append(str(latDeg+"deg "+latMin2+"."+latMin2Rest+"min N x "+lonDeg+"deg "+lonMin2+"."+lonMin2Rest+"min W"))
if latSec11Possible and lonSec11Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec11+"."+latSec11Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec11+"."+lonSec11Rest+"sec W"))
if latSec11Possible and lonSec12Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec11+"."+latSec11Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec12+"."+lonSec12Rest+"sec W"))
if latSec11Possible and lonSec21Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec11+"."+latSec11Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec21+"."+lonSec21Rest+"sec W"))
if latSec11Possible and lonSec22Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec11+"."+latSec11Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec22+"."+lonSec22Rest+"sec W"))
if latSec12Possible and lonSec11Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec12+"."+latSec12Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec11+"."+lonSec11Rest+"sec W"))
if latSec12Possible and lonSec12Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec12+"."+latSec12Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec12+"."+lonSec12Rest+"sec W"))
if latSec12Possible and lonSec21Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec12+"."+latSec12Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec21+"."+lonSec21Rest+"sec W"))
if latSec12Possible and lonSec22Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin1+"min "+latSec12+"."+latSec12Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec22+"."+lonSec22Rest+"sec W"))
if latSec21Possible and lonSec11Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec21+"."+latSec21Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec11+"."+lonSec11Rest+"sec W"))
if latSec21Possible and lonSec12Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec21+"."+latSec21Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec12+"."+lonSec12Rest+"sec W"))
if latSec21Possible and lonSec21Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec21+"."+latSec21Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec21+"."+lonSec21Rest+"sec W"))
if latSec21Possible and lonSec22Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec21+"."+latSec21Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec22+"."+lonSec22Rest+"sec W"))
if latSec22Possible and lonSec11Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec22+"."+latSec22Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec11+"."+lonSec11Rest+"sec W"))
if latSec22Possible and lonSec12Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec22+"."+latSec22Rest+"sec N x "+lonDeg+"deg "+lonMin1+"min "+lonSec12+"."+lonSec12Rest+"sec W"))
if latSec22Possible and lonSec21Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec22+"."+latSec22Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec21+"."+lonSec21Rest+"sec W"))
if latSec22Possible and lonSec22Possible:
self.coordDMSsStringList.append(str(latDeg+"deg "+latMin2+"min "+latSec22+"."+latSec22Rest+"sec N x "+lonDeg+"deg "+lonMin2+"min "+lonSec22+"."+lonSec22Rest+"sec W"))
else:
print("Latitiude not found.")
else:
print("Longitude not found.")
# self.ui.DdField.setPlainText("\n".join(self.coordDdStringList))
# self.ui.DMmField.setPlainText("\n".join(self.coordDMmStringList))
# self.ui.DMSsField.setPlainText("\n".join(self.coordDMSsStringList))
self.ui.DdField.clear()
self.ui.DdField.addItems(self.coordDdStringList)
self.ui.DMmField.clear()
self.ui.DMmField.addItems(self.coordDMmStringList)
self.ui.DMSsField.clear()
self.ui.DMSsField.addItems(self.coordDMSsStringList)
print("Possible Dd coordinates:\n"+str(self.coordDdStringList))
print("Possible DMm coordinates:\n"+str(self.coordDMmStringList))
print("Possible DMSs coordinates:\n"+str(self.coordDMSsStringList))
# now find the 'short' string corresponding to each possibility, and
# see how close of a match it is to the originally entered string
# (highlight the row in the GUI, and change the marker name and symbol)
for n,DdString in enumerate(self.coordDdStringList):
DdShort=DdString.replace("deg ","d")
DdShort=DdShort.replace("N x "," ")
DdShort=DdShort.replace("W","")
print("DdShort:"+DdShort)
if DdShort==shortCoordString:
print(" EXACT MATCH!")
self.coordDdStringList[n]=bestMatchLabelPrefix+DdString
# self.ui.DdField.setPlainText("\n".join(self.coordDdStringList))
self.ui.DdField.clear()
self.ui.DdField.addItems(self.coordDdStringList)
for n,DMmString in enumerate(self.coordDMmStringList):
DMmShort=DMmString.replace("deg ","d")
DMmShort=DMmShort.replace("min ","m")
DMmShort=DMmShort.replace("N x "," ")
DMmShort=DMmShort.replace("W","")
print("DMmShort:"+DMmShort)
if DMmShort==shortCoordString:
print(" EXACT MATCH!")
self.coordDMmStringList[n]=bestMatchLabelPrefix+DMmString
# self.ui.DMmField.setPlainText("\n".join(self.coordDMmStringList))
self.ui.DMmField.clear()
self.ui.DMmField.addItems(self.coordDMmStringList)
for n,DMSsString in enumerate(self.coordDMSsStringList):
DMSsShort=DMSsString.replace("deg ","d")
DMSsShort=DMSsShort.replace("min ","m")
DMSsShort=DMSsShort.replace("sec ","s")
DMSsShort=DMSsShort.replace("N x "," ")
DMSsShort=DMSsShort.replace("W","")
print("DMSsShort:"+DMSsShort)
if DMSsShort==shortCoordString:
print(" EXACT MATCH!")
self.coordDMSsStringList[n]=bestMatchLabelPrefix+DMSsString
# self.ui.DMSsField.setPlainText("\n".join(self.coordDMSsStringList))
self.ui.DMSsField.clear()
self.ui.DMSsField.addItems(self.coordDMSsStringList)
# possibilityClicked: when any row is clicked, unhighlight / unselect any
# highlighted/selected rows in the other two coordinate system list widgets,
# and use the selected row as the 'best match' possibility
def possibilityDdClicked(self):
clicked=self.ui.DdField.selectedItems()[0].text()
if clicked==self.bestMatch:
self.bestMatch=""
self.ui.DdField.clearSelection()
else:
self.bestMatch=clicked
print(self.bestMatch)
self.ui.DMmField.clearSelection()
self.ui.DMSsField.clearSelection()
def possibilityDMmClicked(self):
clicked=self.ui.DMmField.selectedItems()[0].text()
if clicked==self.bestMatch:
self.bestMatch=""
self.ui.DMmField.clearSelection()
else:
self.bestMatch=clicked
print(self.bestMatch)
self.ui.DdField.clearSelection()
self.ui.DMSsField.clearSelection()
def possibilityDMSsClicked(self):
clicked=self.ui.DMSsField.selectedItems()[0].text()
if clicked==self.bestMatch:
self.bestMatch=""
self.ui.DMSsField.clearSelection()
else:
self.bestMatch=clicked
print(self.bestMatch)
self.ui.DdField.clearSelection()
self.ui.DMmField.clearSelection()
#fnameValidate: try writing a test file to the specified filename;
# return the filehandle if valid, or print the error message and return False
# if invalid for whatever reason
def fnameValidate(self,filename):
try:
f=open(filename,"w")
except (IOError,FileNotFoundError) as err:
QMessageBox.warning(self,"Invalid Filename","GPX filename is not valid:\n\n"+str(err)+"\n\nNo markers written to GPX or URL. Fix or blank out the filename, and try again.")
return False
else:
return f
def createMarkers(self):
print("createMarkers called")
# if a gpx filename is specified, validate it first; if invalid, force
# the user to fix it or blank it out before generating any URL markers
if not self.fnameValidate(self.ui.gpxFileNameField.text()):
return
DdIdx=0
DMmIdx=0
DMSsIdx=0
DdIdxFlag=len(self.coordDdStringList)>1
DMmIdxFlag=len(self.coordDMmStringList)>1
DMSsIdxFlag=len(self.coordDMSsStringList)>1
markerName=self.ui.markerNameField.text()
if markerName=="":
markerName="X"
# for best match, use a ring with center dot
# for close match, use a hollow ring
# appropriate prefixes were determined from decoding json POST request
# of a live header when creating each type of marker by hand
# final URL values:
# simple dot: "#<hex_color>"
# target: "c:target,<hex_color>" (notice, no pound sign)
# ring: "c:ring,<hex_color>" (notice, no pound sign)
bestMatchSymbol="c:target"
closeMatchSymbol="c:ring"
# build a list of markers; each marker is a list:
# [markerName,lat,lon,color]
markerList=[]
for DdString in self.coordDdStringList:
DdIdx=DdIdx+1
labelPrefix=""
symbol="point"
# if DdString.startswith(bestMatchLabelPrefix):
if DdString==self.bestMatch:
DdString=DdString.replace(bestMatchLabelPrefix,"")
labelPrefix=bestMatchLabelPrefix
symbol=bestMatchSymbol
if DdString.startswith(closeMatchLabelPrefix):
DdString=DdString.replace(closeMatchLabelPrefix,"")
labelPrefix=closeMatchLabelPrefix
symbol=closeMatchSymbol
print(" Dd : '"+DdString+"'")
r=parse("{:g}deg N x {:g}deg W",DdString)
print(r)
if DdIdxFlag:
idx=str(DdIdx)
else:
idx=""
markerList.append([labelPrefix+markerName+"_Dd"+idx,r[0],-r[1],"FF0000",symbol])
for DMmString in self.coordDMmStringList:
DMmIdx=DMmIdx+1
labelPrefix=""
symbol="point"
# if DMmString.startswith(bestMatchLabelPrefix):
if DMmString==self.bestMatch:
DMmString=DMmString.replace(bestMatchLabelPrefix,"")
labelPrefix=bestMatchLabelPrefix
symbol=bestMatchSymbol
if DMmString.startswith(closeMatchLabelPrefix):
DMmString=DMmString.replace(closeMatchLabelPrefix,"")
labelPrefix=closeMatchLabelPrefix
symbol=closeMatchSymbol
print(" DMm : "+DMmString)
r=parse("{:g}deg {:g}min N x {:g}deg {:g}min W",DMmString)
print(r)
if DMmIdxFlag:
idx=str(DMmIdx)
else:
idx=""
markerList.append([labelPrefix+markerName+"_DMm"+idx,r[0]+r[1]/60.0,-(r[2]+r[3]/60.0),"FF00FF",symbol])
for DMSsString in self.coordDMSsStringList:
DMSsIdx=DMSsIdx+1
labelPrefix=""
symbol="point"
# if DMSsString.startswith(bestMatchLabelPrefix):
if DMSsString==self.bestMatch:
DMSsString=DMSsString.replace(bestMatchLabelPrefix,"")
labelPrefix=bestMatchLabelPrefix
symbol=bestMatchSymbol
if DMSsString.startswith(closeMatchLabelPrefix):
DMSsString=DMSsString.replace(closeMatchLabelPrefix,"")
labelPrefix=closeMatchLabelPrefix
symbol=closeMatchSymbol
print(" DMSs: "+DMSsString)
r=parse("{:g}deg {:g}min {:g}sec N x {:g}deg {:g}min {:g}sec W",DMSsString)
print(r)
if DMSsIdxFlag:
idx=str(DMSsIdx)
else:
idx=""
markerList.append([labelPrefix+markerName+"_DMSs"+idx,r[0]+r[1]/60.0+r[2]/3600.0,-(r[3]+r[4]/60.0+r[5]/3600.0),"0000FF",symbol])
print("Final marker list:")
print(str(markerList))
if self.writeGPX(markerList):
infoStr="\nWrote GPX? YES"
else:
infoStr="\nWrote GPX? NO"
if self.ui.URLField.text():
url=self.ui.URLField.text()
p=url.lower().replace("http://","").split("/")
domainAndPort=p[0]
mapID=p[-1]
print("domainAndPort: "+domainAndPort)
print("map ID: "+mapID)
sts=SartopoSession(domainAndPort=domainAndPort,mapID=mapID)
fid=sts.addFolder("Buckshot")
print(" folder id="+str(fid))
for marker in markerList:
[title,lat,lon,color,symbol]=marker
description=""
if title.startswith(bestMatchLabelPrefix):
description="User-selected best match!"
if title.startswith(closeMatchLabelPrefix):
description="CLOSE match for specified coordinates"
sts.addMarker(lat,lon,title,description,color,symbol,None,fid)
infoStr+="\nWrote URL? YES"
else:
infoStr+="\nWrote URL? NO"
print("No URL specified; skipping URL export.")
QMessageBox.information(self,"Markers Created","Markers created successfully.\n"+infoStr)
def main():
app = QApplication(sys.argv)
w = MyWindow(app)
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
|
ncssar/buckshot
|
buckshot.py
|
Python
|
gpl-3.0
| 30,547
|
<!DOCTYPE html>
<html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head lang="en-GB">
<title>Ross Gammon’s Family Tree - Events</title>
<meta charset="UTF-8" />
<meta name ="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" />
<meta name ="apple-mobile-web-app-capable" content="yes" />
<meta name="generator" content="Gramps 4.2.8 http://gramps-project.org/" />
<meta name="author" content="" />
<link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" />
<link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1 id="SiteTitle">Ross Gammon’s Family Tree</h1>
</div>
<div class="wrapper" id="nav" role="navigation">
<div class="container">
<ul class="menu" id="dropmenu">
<li><a href="../../../individuals.html" title="Individuals">Individuals</a></li>
<li><a href="../../../index.html" title="Surnames">Surnames</a></li>
<li><a href="../../../families.html" title="Families">Families</a></li>
<li class = "CurrentSection"><a href="../../../events.html" title="Events">Events</a></li>
<li><a href="../../../places.html" title="Places">Places</a></li>
<li><a href="../../../sources.html" title="Sources">Sources</a></li>
<li><a href="../../../repositories.html" title="Repositories">Repositories</a></li>
<li><a href="../../../media.html" title="Media">Media</a></li>
<li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li>
</ul>
</div>
</div>
<div class="content" id="EventDetail">
<h3>Marriage</h3>
<table class="infolist eventlist">
<tbody>
<tr>
<td class="ColumnAttribute">Gramps ID</td>
<td class="ColumnGRAMPSID">E26360</td>
</tr>
<tr>
<td class="ColumnAttribute">Date</td>
<td class="ColumnColumnDate">
1941
</td>
</tr>
</tbody>
</table>
<div class="subsection" id="sourcerefs">
<h4>Source References</h4>
<ol>
<li>
<a href="../../../src/7/5/d15f607eeb6638cd99aa7524857.html" title="Email from PhilUrlwin-Smith 24/12/07" name ="sref1">
Email from PhilUrlwin-Smith 24/12/07
<span class="grampsid"> [S0425]</span>
</a>
<ol>
<li id="sref1a">
<ul>
<li>
Confidence: Low
</li>
</ul>
</li>
</ol>
</li>
</ol>
</div>
<div class="subsection" id="references">
<h4>References</h4>
<ol class="Col1" role="Volume-n-Page"type = 1>
<li>
<a href="../../../fam/4/9/d15f609321322d3163305d61494.html">
Family of GAMMON, Cyril William Madgett and MARSHALL, Florence
<span class="grampsid"> [F5864]</span>
</a>
</li>
<li>
<a href="../../../ppl/1/e/d15f60931b650c36a9791b1f7e1.html">
GAMMON, Cyril William Madgett
<span class="grampsid"> [I18021]</span>
</a>
</li>
<li>
<a href="../../../ppl/8/b/d15f60a8866448fdb952f58d9b8.html">
MARSHALL, Florence
<span class="grampsid"> [I18960]</span>
</a>
</li>
</ol>
</div>
</div>
<div class="fullclear"></div>
<div id="footer">
<p id="createdate">
Generated by <a href="http://gramps-project.org/">Gramps</a> 4.2.8<br />Last change was the 2015-08-05 19:55:58<br />Created for <a href="../../../ppl/9/e/d15f5fb48902c4fc1b421d249e9.html">GAMMON, Francis</a>
</p>
<p id="copyright">
</p>
</div>
</body>
</html>
|
RossGammon/the-gammons.net
|
RossFamilyTree/evt/a/9/d15f60df08385b9c1b24f6e19a.html
|
HTML
|
gpl-3.0
| 3,565
|
LIB = hypoct
FC = gfortran
FFLAGS = -fPIC -Wall -O3
CC = gcc
CFLAGS = -fPIC -Wall -O3
F2PY = f2py3
F2PYFLAGS = --fcompiler=gnu95
PYTHON = python
SRC = src
BIN = bin
C = c
PYTHON = python
DOC = doc
EXAMPLES = examples
F2PY_EXT = $(shell python3-config --extension-suffix)
LIB_PY = $(LIB)_python$(F2PY_EXT)
vpath %.f90 $(SRC)
vpath %.o $(BIN)
vpath %.mod $(BIN)
vpath %.h $(C)
vpath %.so $(PYTHON)
.PHONY: all fortran c python doc fortran_driver c_driver python_driver clean clean_fortran clean_c clean_python clean_doc clean_driver rebuild help
all: fortran c python
$(LIB).o: $(LIB).f90
$(FC) $(FFLAGS) -J$(BIN) -c $< -o $(BIN)/$@
$(LIB)_c.o: $(LIB)_c.f90 $(LIB).o
$(FC) $(FFLAGS) -J$(BIN) -c $< -o $(BIN)/$@
$(LIB_PY): $(LIB)_python.f90 $(LIB).o
ln -s $(BIN)/$(LIB).mod
$(F2PY) -c -m $(LIB)_python $(F2PYFLAGS) $< $(BIN)/$(LIB).o
rm -f $(LIB).mod
mv $(LIB_PY) $(BIN)
cd $(PYTHON) ; ln -fs ../$(BIN)/$(LIB_PY)
fortran: $(LIB).o
c: fortran $(LIB)_c.o
python: fortran $(LIB_PY)
doc: python
cd $(DOC) ; make html ; make latexpdf
fortran_driver: fortran
$(FC) -o $(EXAMPLES)/$(LIB)_driver $(FFLAGS) -I$(BIN) $(EXAMPLES)/$(LIB)_driver.f90 $(BIN)/$(LIB).o
cd $(EXAMPLES) ; ./$(LIB)_driver
c_driver: c $(LIB).h
$(CC) -o $(EXAMPLES)/$(LIB)_driver $(CFLAGS) -I$(BIN) -I$(C) $(EXAMPLES)/$(LIB)_driver.c $(BIN)/$(LIB).o $(BIN)/$(LIB)_c.o -lgfortran -lm
cd $(EXAMPLES) ; ./$(LIB)_driver
python_driver: python
cd $(EXAMPLES) ; python3 $(LIB)_driver.py
clean: clean_fortran clean_c clean_python clean_doc clean_driver
clean_fortran:
rm -f $(BIN)/$(LIB).o $(BIN)/$(LIB).mod
clean_c:
rm -f $(BIN)/$(LIB)_c.o $(BIN)/$(LIB)_c.mod
clean_python:
cd $(BIN) ; rm -f $(LIB_PY)
cd $(PYTHON) ; rm -f $(LIB_PY)
cd $(PYTHON)/hypoct ; rm -rf __pycache__
clean_doc:
cd $(DOC); make clean
clean_driver:
cd $(EXAMPLES) ; rm -f $(LIB)_driver
rebuild: clean all
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " all to make all code libraries (Fortran, C, Python)"
@echo " fortran to make the Fortran library"
@echo " c to make the C wrapper to the Fortran library"
@echo " python to make the Python wrapper to the Fortran library"
@echo " doc to make HTML and PDF documentation"
@echo " fortran_driver to make the Fortran driver program"
@echo " c_driver to make the C driver program"
@echo " python_driver to make the Python driver program"
@echo " clean to remove all compiled objects"
@echo " clean_fortran to remove all compiled Fortran objects"
@echo " clean_c to remove all compiled C objects"
@echo " clean_python to remove all compiled Python objects"
@echo " clean_doc to remove all compiled documentation"
@echo " clean_driver to remove all compiled driver executables"
@echo " rebuild to clean and rebuild all libraries"
|
klho/hypoct
|
Makefile
|
Makefile
|
gpl-3.0
| 2,954
|
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.core.genetics;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import forestry.api.core.EnumHumidity;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome;
import forestry.api.genetics.IMutationCondition;
public class MutationConditionHumidity implements IMutationCondition {
private final EnumHumidity minHumidity;
private final EnumHumidity maxHumidity;
public MutationConditionHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity) {
this.minHumidity = minHumidity;
this.maxHumidity = maxHumidity;
}
@Override
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
EnumHumidity biomeHumidity = EnumHumidity.getFromValue(biome.rainfall);
if (biomeHumidity.ordinal() < minHumidity.ordinal() || biomeHumidity.ordinal() > maxHumidity.ordinal()) {
return 0;
}
return 1;
}
@Override
public String getDescription() {
if (minHumidity != maxHumidity) {
return String.format("Humidity between %s and %s.", minHumidity, maxHumidity);
} else {
return String.format("Humidity %s required.", minHumidity);
}
}
}
|
ThiagoGarciaAlves/ForestryMC
|
src/main/java/forestry/core/genetics/MutationConditionHumidity.java
|
Java
|
gpl-3.0
| 1,896
|
# 放大器
## 分类
**工作频率:** 低频放大器,中频放大器,高频放大器
**工作情况:** 甲类放大器,甲乙类放大器,乙类放大器,丙类放大器
**用 途:** 电压放大器,功率放大器
## 使用指标
1. 放大系数
2. 输出于负载阻抗上的电压与功率
3. 效率
4. 输入信号的电源的性质
## 质量指标
1. 放大器所引起的失真
2. 放大频带的宽度
3. 放大器的噪声与输出功率的动态范围
4. 放大系数的稳定性
5. 负载变动时输出电压振幅的恒定性
|
kelubo/wfbook
|
电/电子/放大器/放大器.md
|
Markdown
|
gpl-3.0
| 579
|
package io.renren.modules.api.controller;
import io.renren.common.utils.R;
import io.renren.modules.api.annotation.AuthIgnore;
import io.renren.modules.api.annotation.LoginUser;
import io.renren.modules.api.entity.TokenEntity;
import io.renren.modules.api.entity.UserEntity;
import org.springframework.web.bind.annotation.*;
/**
* API测试接口
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2017-03-23 15:47
*/
@RestController
@RequestMapping("/api")
public class ApiTestController {
/**
* 获取用户信息
*/
@GetMapping("userInfo")
public R userInfo(@LoginUser UserEntity user){
return R.ok().put("user", user);
}
/**
* 忽略Token验证测试
*/
@AuthIgnore
@GetMapping("notToken")
public R notToken(){
return R.ok().put("msg", "无需token也能访问。。。");
}
/**
* 接收JSON数据
*/
@PostMapping("jsonData")
public R jsonData(@LoginUser UserEntity user, @RequestBody TokenEntity token){
return R.ok().put("user", user).put("token", token);
}
}
|
qqq490010553/springboot-basis
|
src/main/java/io/renren/modules/api/controller/ApiTestController.java
|
Java
|
gpl-3.0
| 1,092
|
--[[
-- @author smuttoN
-- @website www.github.com/sutt0n
-- @date 5/23/2017
--]]
--[[
-- @param {string} delimiter
]]
function stringsplit(self, delimiter)
local a = self:Split(delimiter)
local t = {}
for i = 0, #a - 1 do
table.insert(t, a[i])
end
return t
end
--[[
-- @param {string} str
-- @param {string} start
]]
function startswith(str, start)
return string.sub(str, 1, string.len(start)) == start
end
--[[
-- @param {table} _table
]]
function returnIndexesInTable(_table)
local i = 0;
for _,v in pairs(_table)do
i = i + 1
end
return i;
end
--[[
-- @param {string} msg
]]
function debugMsg(msg)
if(settings.defaults.debug_mode and msg) then
print("ES_DEBUG: " .. msg)
end
end
AddEventHandler("es:debugMsg", debugMsg)
|
sutt0n/essentialmode-mysql
|
server/util.lua
|
Lua
|
gpl-3.0
| 753
|
// Copyright (c) 2009 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 "base/i18n/icu_util.h"
#include "build/build_config.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
#include <string>
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "unicode/putil.h"
#include "unicode/udata.h"
#if defined(OS_MACOSX)
#include "base/mac/foundation_util.h"
#endif
#define ICU_UTIL_DATA_FILE 0
#define ICU_UTIL_DATA_SHARED 1
#define ICU_UTIL_DATA_STATIC 2
#ifndef ICU_UTIL_DATA_IMPL
#if defined(OS_WIN)
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_SHARED
#else
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_STATIC
#endif
#endif // ICU_UTIL_DATA_IMPL
#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
#define ICU_UTIL_DATA_FILE_NAME "icudt" U_ICU_VERSION_SHORT "l.dat"
#elif ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED
#define ICU_UTIL_DATA_SYMBOL "icudt" U_ICU_VERSION_SHORT "_dat"
#if defined(OS_WIN)
#define ICU_UTIL_DATA_SHARED_MODULE_NAME "icudt.dll"
#endif
#endif
namespace icu_util {
bool Initialize() {
#ifndef NDEBUG
// Assert that we are not called more than once. Even though calling this
// function isn't harmful (ICU can handle it), being called twice probably
// indicates a programming error.
static bool called_once = false;
DCHECK(!called_once);
called_once = true;
#endif
#if (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED)
// We expect to find the ICU data module alongside the current module.
FilePath data_path;
PathService::Get(base::DIR_MODULE, &data_path);
data_path = data_path.AppendASCII(ICU_UTIL_DATA_SHARED_MODULE_NAME);
HMODULE module = LoadLibrary(data_path.value().c_str());
if (!module) {
DLOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME;
return false;
}
FARPROC addr = GetProcAddress(module, ICU_UTIL_DATA_SYMBOL);
if (!addr) {
DLOG(ERROR) << ICU_UTIL_DATA_SYMBOL << ": not found in "
<< ICU_UTIL_DATA_SHARED_MODULE_NAME;
return false;
}
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(reinterpret_cast<void*>(addr), &err);
return err == U_ZERO_ERROR;
#elif (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_STATIC)
// Mac/Linux bundle the ICU data in.
return true;
#elif (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
#if !defined(OS_MACOSX)
// For now, expect the data file to be alongside the executable.
// This is sufficient while we work on unit tests, but will eventually
// likely live in a data directory.
FilePath data_path;
bool path_ok = PathService::Get(base::DIR_EXE, &data_path);
DCHECK(path_ok);
u_setDataDirectory(data_path.value().c_str());
// Only look for the packaged data file;
// the default behavior is to look for individual files.
UErrorCode err = U_ZERO_ERROR;
udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
return err == U_ZERO_ERROR;
#else
// If the ICU data directory is set, ICU won't actually load the data until
// it is needed. This can fail if the process is sandboxed at that time.
// Instead, Mac maps the file in and hands off the data so the sandbox won't
// cause any problems.
// Chrome doesn't normally shut down ICU, so the mapped data shouldn't ever
// be released.
static file_util::MemoryMappedFile mapped_file;
if (!mapped_file.IsValid()) {
// Assume it is in the MainBundle's Resources directory.
FilePath data_path =
base::mac::PathForMainAppBundleResource(CFSTR(ICU_UTIL_DATA_FILE_NAME));
if (data_path.empty()) {
DLOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle";
return false;
}
if (!mapped_file.Initialize(data_path)) {
DLOG(ERROR) << "Couldn't mmap " << data_path.value();
return false;
}
}
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err);
return err == U_ZERO_ERROR;
#endif // OS check
#endif
}
} // namespace icu_util
|
tierney/cryptagram-cc
|
src/base/i18n/icu_util.cc
|
C++
|
gpl-3.0
| 4,102
|
/*
* Created on 16-dic-2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
/* gvSIG. Sistema de Información Geográfica de la Generalitat Valenciana
*
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
*
* For more information, contact:
*
* Generalitat Valenciana
* Conselleria d'Infraestructures i Transport
* Av. Blasco Ibáñez, 50
* 46010 VALENCIA
* SPAIN
*
* +34 963862235
* gvsig@gva.es
* www.gvsig.gva.es
*
* or
*
* IVER T.I. S.A
* Salamanca 50
* 46005 Valencia
* Spain
*
* +34 963163400
* dac@iver.es
*/
package com.iver.cit.gvsig.fmap.layers;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.print.attribute.PrintRequestAttributeSet;
import org.geotools.data.FeatureSource;
import org.geotools.map.DefaultMapContext;
import org.geotools.map.MapContext;
import org.geotools.map.MapLayer;
import org.geotools.renderer.lite.LiteRenderer2;
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
import com.iver.cit.gvsig.fmap.ViewPort;
import com.iver.utiles.swing.threads.Cancellable;
import com.vividsolutions.jts.geom.Envelope;
/**
* @author FJP
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
// TODO: Cuando no sea para pruebas, habrá que ponerla privada
public class FLyrGT2_old extends FLyrDefault {
private MapLayer m_lyrGT2;
private LiteRenderer2 liteR2;
private MapContext mapContextGT2;
public FLyrGT2_old(MapLayer lyrGT2)
{
m_lyrGT2 = lyrGT2;
setName(lyrGT2.getTitle());
mapContextGT2 = new DefaultMapContext();
mapContextGT2.addLayer(lyrGT2);
liteR2 = new LiteRenderer2(mapContextGT2);
}
/* (non-Javadoc)
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getFullExtent()
*/
public Rectangle2D getFullExtent() {
FeatureSource fs = m_lyrGT2.getFeatureSource();
Envelope bounds = null;
try {
bounds = fs.getBounds();
if (bounds == null)
{
bounds = fs.getFeatures().getBounds();
}
} catch (IOException e) {
e.printStackTrace();
}
return new Rectangle2D.Double(bounds.getMinX(), bounds.getMinY(),
bounds.getWidth(), bounds.getHeight());
}
/* (non-Javadoc)
* @see com.iver.cit.gvsig.fmap.layers.FLayer#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.operations.Cancellable)
*/
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale) throws ReadDriverException {
try {
if (isWithinScale(scale)){
// mapExtent = this.context.getAreaOfInterest();
m_lyrGT2.setVisible(isVisible());
Envelope envelope = new Envelope(viewPort.getExtent().getMinX(),
viewPort.getExtent().getMinY(), viewPort.getExtent().getMaxX(),
viewPort.getExtent().getMaxY());
mapContextGT2.setAreaOfInterest(envelope);
/* FeatureResults results = queryLayer(m_lyrGT2, envelope,
destinationCrs);
// extract the feature type stylers from the style object
// and process them
processStylers(g, results,
m_lyrGT2.getStyle().getFeatureTypeStyles(), viewPort.getAffineTransform(),
mapContextGT2.getCoordinateReferenceSystem()); */
Rectangle r = new Rectangle(viewPort.getImageSize());
long t1 = System.currentTimeMillis();
liteR2.paint(g,r, viewPort.getAffineTransform());
long t2 = System.currentTimeMillis();
System.out.println("Tiempo en pintar capa " + getName() + " de GT2:" + (t2- t1) + " milisegundos");
}
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.utiles.swing.threads.Cancellable)
*/
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale, PrintRequestAttributeSet properties) throws ReadDriverException {
}
}
|
iCarto/siga
|
libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrGT2_old.java
|
Java
|
gpl-3.0
| 5,013
|
namespace _08.Custom_Comparator
{
using System;
using System.Collections.Generic;
using System.Linq;
public class Startup
{
public static void Main()
{
int[] numbers = Console.ReadLine()
.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
.Select(int.Parse)
.ToArray();
Array.Sort(numbers, (x, y) =>
{
if (IsEven(x) && !IsEven(y))
{
return -1;
}
if (!IsEven(x) && IsEven(y))
{
return 1;
}
if (x < y)
{
return -1;
}
if (x > y)
{
return 1;
}
return 0;
});
Console.WriteLine(string.Join(" ",numbers));
}
static bool IsEven(int i)
{
return i % 2 == 0;
}
}
}
|
PlamenHP/Softuni
|
Advanced C#/Functional Programming - Exercises/08. Custom Comparator/Startup.cs
|
C#
|
gpl-3.0
| 1,086
|
#include <fstream>
#include <iostream>
#include "df3volume.h"
#ifdef _WIN32
# define LITTLE_ENDIAN
#endif
#ifdef LITTLE_ENDIAN
#define SWAP_2(x) ( (((x) & 0xff) << 8) | ((unsigned short)(x) >> 8) )
#define SWAP_4(x) ( ((x) << 24) | \
(((x) << 8) & 0x00ff0000) | \
(((x) >> 8) & 0x0000ff00) | \
((x) >> 24) )
#define FIX_SHORT(x) (*(unsigned short *)&(x) = SWAP_2(*(unsigned short *)&(x)))
#define FIX_INT(x) (*(unsigned int *)&(x) = SWAP_4(*(unsigned int *)&(x)))
#else
#define FIX_SHORT(x) (x)
#define FIX_INT(x) (x)
#endif
using namespace std;
bool df3volume::load(const char * file) {
ifstream ffile;
ffile.open(file, ios_base::binary | ios_base::in);
if( ffile.fail() ) {
cerr << "ERROR: Could not read input volume file '" << file << "' ! " << endl;
return false;
}
ffile.read((char*)&width, sizeof(short));
ffile.read((char*)&height, sizeof(short));
ffile.read((char*)&depth, sizeof(short));
width = FIX_SHORT(width);
height = FIX_SHORT(height);
depth = FIX_SHORT(depth);
size_t size = width * height * depth;
data.resize(size);
ffile.read((char*)&data[0], size);
if( ffile.fail() ) {
cerr << "Failed to read from volume file !" << endl;
ffile.close();
return false;
}
ffile.close();
#ifdef _DEBUG
cout << "Volume " << file << " size = " << size << " bytes" << endl;
#endif
return true;
}
bool df3volume::load_raw(uint16 _width, uint16 _height, uint16 _depth, const char * file) {
ifstream ffile;
ffile.open(file, ios_base::binary | ios_base::in);
if( ffile.fail() ) {
cerr << "Could not read input volume file '" << file << "' ! " << endl;
return false;
}
size_t size = _width * _height * _depth;
data.resize(size);
ffile.read((char*)&data[0], size);
if( ffile.fail() ) {
cerr << "Failed to read from volume file " << file << endl;
ffile.close();
return false;
}
width = _width;
height = _height;
depth = _depth;
#ifdef _DEBUG
cout << "Volume " << file << " size = " << size << " bytes" << endl;
#endif
return true;
}
bool df3volume::save(const char* file) {
ofstream df3(file, ios::out | ios::binary);
if( df3.fail() ) {
cerr << "Could not open file " << file << " for writing !" << endl;
return false;
}
uint16 _width = FIX_SHORT(width);
uint16 _height = FIX_SHORT(height);
uint16 _depth = FIX_SHORT(depth);
df3.write((const char*)&_width, sizeof(uint16));
df3.write((const char*)&_height, sizeof(uint16));
df3.write((const char*)&_depth, sizeof(uint16));
df3.write((const char*)&data[0], data.size());
if( df3.fail() ) {
cerr << "Failed to save df3 volume to output file " << file << endl;
df3.close();
return false;
}
df3.close();
return true;
}
|
mihaipopescu/VEGA
|
tools/df3volume.cpp
|
C++
|
gpl-3.0
| 3,022
|
// Copyright (c) 2005 - 2015 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// Return To The Roots is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.
///////////////////////////////////////////////////////////////////////////////
// Header
#include "defines.h"
#include "iwEndgame.h"
#include "Loader.h"
#include "GameManager.h"
#include "desktops/dskMainMenu.h"
#include "iwSave.h"
#include "WindowManager.h"
#include "GameClient.h"
///////////////////////////////////////////////////////////////////////////////
// Makros / Defines
#if defined _WIN32 && defined _DEBUG && defined _MSC_VER
#define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__)
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
///////////////////////////////////////////////////////////////////////////////
/**
* Konstruktor von @p iwEndgame.
*
* @author OLiver
*/
iwEndgame::iwEndgame(void)
: IngameWindow(CGI_ENDGAME, 0xFFFF, 0xFFFF, 240, 100, _("End game?"), LOADER.GetImageN("resource", 41))
{
// Ok
AddImageButton(0, 16, 24, 71, 57, TC_GREEN2, LOADER.GetImageN("io", 32)); //-V525
// Abbrechen
AddImageButton(1, 88, 24, 71, 57, TC_RED1, LOADER.GetImageN("io", 40));
// Ok + Speichern
AddImageButton(2, 160, 24, 65, 57, TC_GREY, LOADER.GetImageN("io", 47));
}
void iwEndgame::Msg_ButtonClick(const unsigned int ctrl_id)
{
switch(ctrl_id)
{
case 0: // OK
{
GAMEMANAGER.ShowMenu();
GAMECLIENT.ExitGame();
} break;
case 1: // Abbrechen
{
Close();
} break;
case 2: // OK + Speichern
{
WINDOWMANAGER.Show(new iwSave());
} break;
}
}
|
ikharbeq/s25client
|
src/ingameWindows/iwEndgame.cpp
|
C++
|
gpl-3.0
| 2,321
|
package dotest.module.frame.debug;
import android.app.Activity;
import core.interfaces.DoIPageViewFactory;
public class DoPageViewFactory implements DoIPageViewFactory {
private Activity currentActivity;
@Override
public Activity getAppContext() {
// TODO Auto-generated method stub
return currentActivity;
}
@Override
public void openPage(String arg0, String arg1, String arg2, String arg3,
String arg4, String arg5, String arg6, String arg7) {
// TODO Auto-generated method stub
}
public void setCurrentActivity(Activity currentActivity) {
this.currentActivity = currentActivity;
}
@Override
public void closePage(String _animationType, String _data, int _continue) {
// TODO Auto-generated method stub
}
}
|
do-android/do_BaiduMapView
|
doExt_do_BaiduMapView/src/dotest/module/frame/debug/DoPageViewFactory.java
|
Java
|
gpl-3.0
| 748
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_11) on Mon Jun 16 17:36:07 PDT 2014 -->
<title>Uses of Class javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler (Java Platform SE 8 )</title>
<meta name="date" content="2014-06-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler (Java Platform SE 8 )";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../javax/swing/plaf/basic/BasicTreeUI.TreeSelectionHandler.html" title="class in javax.swing.plaf.basic">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><strong>Java™ Platform<br>Standard Ed. 8</strong></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?javax/swing/plaf/basic/class-use/BasicTreeUI.TreeSelectionHandler.html" target="_top">Frames</a></li>
<li><a href="BasicTreeUI.TreeSelectionHandler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler" class="title">Uses of Class<br>javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler</h2>
</div>
<div class="classUseContainer">No usage of javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../javax/swing/plaf/basic/BasicTreeUI.TreeSelectionHandler.html" title="class in javax.swing.plaf.basic">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><strong>Java™ Platform<br>Standard Ed. 8</strong></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?javax/swing/plaf/basic/class-use/BasicTreeUI.TreeSelectionHandler.html" target="_top">Frames</a></li>
<li><a href="BasicTreeUI.TreeSelectionHandler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://download.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved. </font></small></p>
</body>
</html>
|
DeanAaron/jdk8
|
jdk8en_us/docs/api/javax/swing/plaf/basic/class-use/BasicTreeUI.TreeSelectionHandler.html
|
HTML
|
gpl-3.0
| 5,396
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-09 11:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tmv_app', '0072_runstats_dyn_win_threshold'),
]
operations = [
migrations.AlterField(
model_name='runstats',
name='dyn_win_threshold',
field=models.FloatField(default=0.1),
),
]
|
mcallaghan/tmv
|
BasicBrowser/tmv_app/migrations/0073_auto_20180109_1124.py
|
Python
|
gpl-3.0
| 471
|
// This file is part of RBDyn.
//
// RBDyn is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RBDyn is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with RBDyn. If not, see <http://www.gnu.org/licenses/>.
#pragma once
// includes
// std
#include <tuple>
// RBDyn
#include "Body.h"
#include "Joint.h"
#include "MultiBody.h"
#include "MultiBodyConfig.h"
#include "MultiBodyGraph.h"
std::tuple<int, int> createLeg(rbd::MultiBodyGraph& mbg,
const Eigen::Vector3d& direction, int parentId,
int beginBId, int beginJId, const std::string& prefix)
{
using namespace Eigen;
using namespace sva;
using namespace rbd;
double mass = 1.;
Matrix3d I = Matrix3d::Identity();
Vector3d h = Vector3d::Zero();
RBInertiad rbi(mass, h, I);
mbg.addBody({rbi, beginBId + 0, prefix + "LEG0"});
mbg.addBody({rbi, beginBId + 1, prefix + "LEG1"});
mbg.addBody({rbi, beginBId + 2, prefix + "LEG2"});
mbg.addBody({rbi, beginBId + 3, prefix + "LEG3"});
mbg.addBody({rbi, beginBId + 4, prefix + "LEG4"});
mbg.addBody({rbi, beginBId + 5, prefix + "LEG5"});
mbg.addJoint({Joint::RevX, true, beginJId + 0, prefix + "LEGBASE_0"});
mbg.addJoint({Joint::RevY, true, beginJId + 1, prefix + "LEG0_1"});
mbg.addJoint({Joint::RevZ, true, beginJId + 2, prefix + "LEG1_2"});
mbg.addJoint({Joint::RevX, true, beginJId + 3, prefix + "LEG2_3"});
mbg.addJoint({Joint::RevY, true, beginJId + 4, prefix + "LEG3_5"});
mbg.addJoint({Joint::RevX, true, beginJId + 5, prefix + "LEG4_5"});
PTransformd to(direction);
PTransformd from(PTransformd::Identity());
mbg.linkBodies(parentId, to, beginBId + 0, from, beginJId + 0);
mbg.linkBodies(beginBId + 0, to, beginBId + 1, from, beginJId + 1);
mbg.linkBodies(beginBId + 1, to, beginBId + 2, from, beginJId + 2);
mbg.linkBodies(beginBId + 2, to, beginBId + 3, from, beginJId + 3);
mbg.linkBodies(beginBId + 3, to, beginBId + 4, from, beginJId + 4);
mbg.linkBodies(beginBId + 4, to, beginBId + 5, from, beginJId + 5);
return std::make_tuple(beginBId + 6, beginJId + 6);
}
std::tuple<int, int> createArm(rbd::MultiBodyGraph& mbg,
const Eigen::Vector3d& direction, int parentId,
int beginBId, int beginJId, const std::string& prefix)
{
using namespace Eigen;
using namespace sva;
using namespace rbd;
double mass = 1.;
Matrix3d I = Matrix3d::Identity();
Vector3d h = Vector3d::Zero();
RBInertiad rbi(mass, h, I);
mbg.addBody({rbi, beginBId + 0, prefix + "ARM0"});
mbg.addBody({rbi, beginBId + 1, prefix + "ARM1"});
mbg.addBody({rbi, beginBId + 2, prefix + "ARM2"});
mbg.addBody({rbi, beginBId + 3, prefix + "ARM3"});
mbg.addBody({rbi, beginBId + 4, prefix + "ARM4"});
mbg.addBody({rbi, beginBId + 5, prefix + "ARM5"});
mbg.addBody({rbi, beginBId + 6, prefix + "ARM6"});
mbg.addJoint({Joint::RevX, true, beginJId + 0, prefix + "ARMBASE_0"});
mbg.addJoint({Joint::RevY, true, beginJId + 1, prefix + "ARM0_1"});
mbg.addJoint({Joint::RevZ, true, beginJId + 2, prefix + "ARM1_2"});
mbg.addJoint({Joint::RevX, true, beginJId + 3, prefix + "ARM2_3"});
mbg.addJoint({Joint::RevX, true, beginJId + 4, prefix + "ARM3_5"});
mbg.addJoint({Joint::RevY, true, beginJId + 5, prefix + "ARM4_5"});
mbg.addJoint({Joint::RevZ, true, beginJId + 6, prefix + "ARM5_6"});
PTransformd to(direction);
PTransformd from(PTransformd::Identity());
mbg.linkBodies(parentId, to, beginBId + 0, from, beginJId + 0);
mbg.linkBodies(beginBId + 0, to, beginBId + 1, from, beginJId + 1);
mbg.linkBodies(beginBId + 1, to, beginBId + 2, from, beginJId + 2);
mbg.linkBodies(beginBId + 2, to, beginBId + 3, from, beginJId + 3);
mbg.linkBodies(beginBId + 3, to, beginBId + 4, from, beginJId + 4);
mbg.linkBodies(beginBId + 4, to, beginBId + 5, from, beginJId + 5);
mbg.linkBodies(beginBId + 5, to, beginBId + 6, from, beginJId + 6);
return std::make_tuple(beginBId + 7, beginJId + 7);
}
/// @return An simple XYZ arm with Y as up axis.
std::tuple<rbd::MultiBody, rbd::MultiBodyConfig, rbd::MultiBodyGraph>
makeTree30Dof(bool isFixed=true)
{
using namespace Eigen;
using namespace sva;
using namespace rbd;
MultiBodyGraph mbg;
double mass = 1.;
Matrix3d I = Matrix3d::Identity();
Vector3d h = Vector3d::Zero();
RBInertiad rbi(mass, h, I);
mbg.addBody({rbi, 0, "BODY0"});
mbg.addBody({rbi, 1, "BODY1"});
mbg.addBody({rbi, 2, "TORSO"});
mbg.addBody({rbi, 3, "HEAD0"});
mbg.addBody({rbi, 4, "HEAD1"});
mbg.addJoint({Joint::RevY, true, 0, "BODY0_BODY1"});
mbg.addJoint({Joint::RevX, true, 1, "BODY1_TORSO"});
mbg.addJoint({Joint::RevY, true, 2, "TORSO_HEAD0"});
mbg.addJoint({Joint::RevX, true, 3, "HEAD0_HEAD1"});
PTransformd to(Vector3d(0., 0.1, 0.));
PTransformd from(PTransformd::Identity());
mbg.linkBodies(0, to, 1, from, 0);
mbg.linkBodies(1, to, 2, from, 1);
mbg.linkBodies(2, to, 3, from, 2);
mbg.linkBodies(3, to, 4, from, 3);
int nextBId = 5;
int nextJId = 4;
// left arm
std::tie(nextBId, nextJId) = createArm(mbg, Vector3d(-0.1, 0.05, 0.), 2,
nextBId, nextJId, "L");
// right arm
std::tie(nextBId, nextJId) = createArm(mbg, Vector3d(0.1, 0.05, 0.), 2,
nextBId, nextJId, "R");
// left leg
std::tie(nextBId, nextJId) = createLeg(mbg, Vector3d(-0.1, -0.05, 0.), 0,
nextBId, nextJId, "L");
// right leg
std::tie(nextBId, nextJId) = createLeg(mbg, Vector3d(0.1, -0.05, 0.), 0,
nextBId, nextJId, "R");
MultiBody mb = mbg.makeMultiBody(0, isFixed);
MultiBodyConfig mbc(mb);
mbc.zero(mb);
return std::make_tuple(mb, mbc, mbg);
}
|
bchretien/RBDyn
|
tests/Tree30Dof.h
|
C
|
gpl-3.0
| 5,894
|
#include "SQLParserResult.h"
namespace hsql {
SQLParserResult::SQLParserResult() :
isValid_(true),
errorMsg_(NULL) {};
SQLParserResult::SQLParserResult(SQLStatement* stmt) :
isValid_(true),
errorMsg_(NULL) {
addStatement(stmt);
};
SQLParserResult::~SQLParserResult() {
for (SQLStatement* statement : statements_) {
delete statement;
}
free(errorMsg_);
}
void SQLParserResult::addStatement(SQLStatement* stmt) {
statements_.push_back(stmt);
}
const SQLStatement* SQLParserResult::getStatement(int index) const {
return statements_[index];
}
SQLStatement* SQLParserResult::getMutableStatement(int index) {
return statements_[index];
}
size_t SQLParserResult::size() const {
return statements_.size();
}
bool SQLParserResult::isValid() const {
return isValid_;
}
const char* SQLParserResult::errorMsg() const {
return errorMsg_;
}
int SQLParserResult::errorLine() const {
return errorLine_;
}
int SQLParserResult::errorColumn() const {
return errorColumn_;
}
void SQLParserResult::setIsValid(bool isValid) {
isValid_ = isValid;
}
void SQLParserResult::setErrorDetails(char* errorMsg, int errorLine, int errorColumn) {
errorMsg_ = errorMsg;
errorLine_ = errorLine;
errorColumn_ = errorColumn;
}
} // namespace hsql
|
msdeep14/DeepDataBase
|
sql-parser/src/SQLParserResult.cpp
|
C++
|
gpl-3.0
| 1,363
|
namespace _6.Customers_Migration
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public partial class StoreLocation
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public StoreLocation()
{
Sales = new HashSet<Sale>();
}
public int Id { get; set; }
public string LocationName { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Sale> Sales { get; set; }
}
}
|
PlamenHP/Softuni
|
Entity Framework/Entity Framework Code First/6. Customers Migration/StoreLocation.cs
|
C#
|
gpl-3.0
| 782
|
# smallest number 2^500500 divisors , modulo 500500507
# 单调递减
# (2^a0)(2^a1)(2^a2) = 2^500500
# (2^ai)(2^aj) -> (2^{ai-1})(2^{aj+1}) : p_j^(2^{aj})/p_i^(2^{ai-1}) < 1 , (a > b)
# (2^aj)ln(p_j) < (2^{ai-1})ln(p_i)
# if 2^{a_i-a_j-1} > ln(p_j)/ln(p_i), then a_i-=1,a_j-=1
#
# i < j
# p_j^(2^(a_j-1)) < p_i^(2^a_i)
# p_i^(2^(a_i-1)) < p_j^(2^a_j)
#
# (n-log(log(p_i)/log(p_j)/2)/log(2))/2 > ai > (n-log(2*log(p_i)/log(p_j))/log(2))/2
#
# n = a_i+a_j
# a_i = floor(
# (
# n + 1 - (log(
# log(p_i)/log(p_j)
# )/log(2))
# )/2
# )
import math
N = 9_000_000
MOD = 500500507
def mypow(v, mi):
r = 1
while mi > 0:
if mi % 2 == 1:
r *= v
r %= MOD
v *= v
v %= MOD
mi //= 2
return r
def prepare():
p = [0 for i in range(N+10)]
ps = []
for i in range(2,N+1):
if p[i] != 0:
continue;
ps.append(i)
j = i*i
while j <= N:
p[j] = i
j+=i
print("prime count:",len(ps),",max prime:",ps[-1])
logij = [0 for i in range(500500)]
for i in range(500500):
logij[i] = math.log(math.log(ps[i])/math.log(ps[i+1])/2)/math.log(4)
print("logij finished")
# p[i] = i is prime
# ps : prime s
# logij : adjacent
# sum 以外的部分
return p,ps,logij
# dst 幂次 , p 质数校验数组, ps质数数组, 预先运算 sum以外部分
def main(dst,p,ps,logij):
ans = [0 for i in range(500500)]
ans[0] = dst
maxi = 1 # ans 长度
loop = True
while loop:
loop = False
i = 0
# for range not work when i want modify i
while i+1 < len(ans) and ans[i] > 0:
cnt = ans[i]+ans[i+1]
dstai = math.floor(cnt/2 - logij[i])
if dstai != ans[i]:
ans[i] = dstai;
ans[i+1] = cnt - dstai
# just from last start
if i > 0:
i -= 1
continue
i+=1
if i >= maxi and ans[i] > 0:
maxi = i+1
print(f"len[{maxi}]\tfirst[{ans[0]}]\tlast[{ans[i]}]", flush=True)
assert(i+1 < len(ans))
assert(ans[maxi] == 0)
# print("arr:",ans[:maxi])
print(f"fixlen [{maxi}]\tfirst[{ans[0]}]\tlast[{ans[maxi-1]}]", flush=True)
# check movable first and last
# if math.log(math.log(ps[maxi])/math.log(2)) < math.log(2)*(ans[0]-1):
newans0 = math.floor((ans[0]+1-math.log(math.log(2)/math.log(ps[maxi]))/math.log(2))/2)
if newans0 != ans[0]:
ans[maxi] = ans[0] - newans0
ans[0] = newans0
assert(ans[0] > 0)
assert(ans[maxi] > 0)
loop = True
output = 1
for i in range(len(ans)):
output *= mypow(ps[i],2**ans[i] - 1);
output %= MOD
print("ans:", output, flush=True)
p,ps,logij = prepare()
main(4,p,ps,logij)
main(500500,p,ps,logij)
# len[206803] first[5] last[1]
# fixlen [206803] first[5] last[1]
# ans: 287659177
# 跑了3个小时 , 没有所有位满足最小
|
CroMarmot/MyOICode
|
ProjectEuler/unsolved/p500.py
|
Python
|
gpl-3.0
| 3,132
|
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 29 18:02:06 2015
"""
#####################################################################################################
# Groupe d'Étude pour la Traduction/le Traitement Automatique des Langues et de la Parole (GETALP)
# Homepage: http://getalp.imag.fr
#
# Author: Tien LE (ngoc-tien.le@imag.fr)
# Advisors: Laurent Besacier & Benjamin Lecouteux
# URL: tienhuong.weebly.com
#####################################################################################################
import os
import sys
import datetime
#when import module/class in other directory
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))#in order to test with line by line on the server
from feature.common_functions import *
from config.configuration import *
#**************************************************************************#
def get_duration(datetime_start, datetime_end):
dt1 = datetime.datetime.strptime(datetime_start, '%Y-%m-%d %H:%M:%S.%f')
dt2 = datetime.datetime.strptime(datetime_end, '%Y-%m-%d %H:%M:%S.%f')
duration = dt2-dt1
return duration
#**************************************************************************#
"""
noruego NOUN
de OTHER
"""
def count_num_of_words_for_polysemy_count_target(file_input_path):
if not os.path.exists(file_input_path):
raise TypeError('Not Existed file corpus input with format - column')
#end if
#for reading: file_input_path
file_reader = open(file_input_path, mode = 'r', encoding = 'utf-8')
num_of_words_all = 0
num_of_words_other = 0
str_other = "OTHER"
for line in file_reader:
line = line.strip()
if len(line) == 0:
continue
#end if
num_of_words_all += 1
items = split_string_to_list_delimeter_tab(line)
if items[1].strip() == str_other:
num_of_words_other += 1
#end if
#end for
#close file
file_reader.close()
num_of_words_result = num_of_words_all - num_of_words_other
print("num_of_words_all = %d" %num_of_words_all)
print("num_of_words_result = %d" %num_of_words_result)
#**************************************************************************#
def convert_from_second_to_format_h_m_s(num_of_second):
m, s = divmod(num_of_second, 60)
h, m = divmod(m, 60)
d, h = divmod(h, 24)
print("d:h:m:s = %d:%d:%02d:%02d" % (d, h, m, s))
#**************************************************************************#
#**************************************************************************#
#**************************************************************************#
#**************************************************************************#
if __name__ == "__main__":
#Test case:
current_config = load_configuration()
datetime_start="2015-03-31 20:09:23.282432"
datetime_end="2015-04-01 00:25:42.996360"
dt = get_duration(datetime_start, datetime_end)
print(dt)
file_input_path = current_config.BABEL_NET_CORPUS_ES
count_num_of_words_for_polysemy_count_target(file_input_path)
convert_from_second_to_format_h_m_s(449369)
print ('OK')
|
besacier/WCE-LIG
|
wce_system/preprocessing/measure_performance_system.py
|
Python
|
gpl-3.0
| 3,171
|
package se.lu.nateko.cp.meta.services.sparql.index
object StringHierarchicalBitmap{
import HierarchicalBitmap._
val SpilloverThreshold = 513
implicit object Ord extends Ordering[String]{
def compare(x: String, y: String): Int = {
val lx = x.length; val ly = y.length
val lmin = Math.min(lx, ly)
var i = 0
while(i < lmin){
val sx = x.charAt(i).toShort
val sy = y.charAt(i).toShort
if(sx < sy) return -1
if(sx > sy) return 1
i += 1
}
if(lx == ly) 0
else if (lx < ly) -1
else 1
}
}
def apply(stringLookup: Int => String): HierarchicalBitmap[String] = {
val geo = new Geo[String]{
val spilloverThreshold: Int = SpilloverThreshold
def keyLookup(value: Int): String = stringLookup(value)
def coordinate(key: String, depth: Int): Coord =
if(depth < 1) 0
else if(depth > key.length) Short.MinValue
else key.charAt(depth - 1).toShort
}
new HierarchicalBitmap[String](0, None)(geo, Ord)
}
}
|
ICOS-Carbon-Portal/meta
|
src/main/scala/se/lu/nateko/cp/meta/services/sparql/index/StringHierarchicalBitmap.scala
|
Scala
|
gpl-3.0
| 975
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../editor.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../rct1.h"
#include "../ride/ride.h"
#include "../ride/track.h"
#include "../ride/track_design.h"
#include "../ride/TrackDesignRepository.h"
#include "../sprites.h"
#include "error.h"
enum {
WIDX_BACKGROUND,
WIDX_TITLE,
WIDX_CLOSE,
WIDX_TRACK_LIST,
WIDX_TRACK_PREVIEW,
WIDX_ROTATE,
WIDX_TOGGLE_SCENERY,
WIDX_BACK,
};
static rct_widget window_track_list_widgets[] = {
{ WWT_FRAME, 0, 0, 599, 0, 399, 0xFFFFFFFF, STR_NONE },
{ WWT_CAPTION, 0, 1, 598, 1, 14, STR_SELECT_DESIGN, STR_WINDOW_TITLE_TIP },
{ WWT_CLOSEBOX, 0, 587, 597, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP },
{ WWT_SCROLL, 0, 4, 221, 33, 395, SCROLL_VERTICAL, STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP },
{ WWT_FLATBTN, 0, 224, 595, 18, 236, 0xFFFFFFFF, STR_NONE },
{ WWT_FLATBTN, 0, 574, 597, 374, 397, SPR_ROTATE_ARROW, STR_ROTATE_90_TIP },
{ WWT_FLATBTN, 0, 574, 597, 350, 373, SPR_SCENERY, STR_TOGGLE_SCENERY_TIP },
{ WWT_13, 0, 4, 221, 18, 29, STR_SELECT_OTHER_RIDE, STR_NONE },
{ WIDGETS_END },
};
static void window_track_list_close(rct_window *w);
static void window_track_list_mouseup(rct_window *w, int widgetIndex);
static void window_track_list_update(rct_window *w);
static void window_track_list_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height);
static void window_track_list_scrollmousedown(rct_window *w, int scrollIndex, int x, int y);
static void window_track_list_scrollmouseover(rct_window *w, int scrollIndex, int x, int y);
static void window_track_list_tooltip(rct_window* w, int widgetIndex, rct_string_id *stringId);
static void window_track_list_invalidate(rct_window *w);
static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
static void window_track_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex);
static rct_window_event_list window_track_list_events = {
window_track_list_close,
window_track_list_mouseup,
NULL,
NULL,
NULL,
NULL,
window_track_list_update,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
window_track_list_scrollgetsize,
window_track_list_scrollmousedown,
NULL,
window_track_list_scrollmouseover,
NULL,
NULL,
NULL,
window_track_list_tooltip,
NULL,
NULL,
window_track_list_invalidate,
window_track_list_paint,
window_track_list_scrollpaint
};
#define TRACK_DESIGN_INDEX_UNLOADED UINT16_MAX
ride_list_item _window_track_list_item;
static track_design_file_ref *_trackDesigns = NULL;
static size_t _trackDesignsCount = 0;
static uint16 _loadedTrackDesignIndex;
static rct_track_td6 *_loadedTrackDesign;
static uint8 *_trackDesignPreviewPixels;
static void track_list_load_designs(ride_list_item item);
static bool track_list_load_design_for_preview(utf8 *path);
/**
*
* rct2: 0x006CF1A2
*/
void window_track_list_open(ride_list_item item)
{
window_close_construction_windows();
_window_track_list_item = item;
track_list_load_designs(item);
int x, y;
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
x = gScreenWidth / 2 - 300;
y = max(28, gScreenHeight / 2 - 200);
} else {
x = 0;
y = 29;
}
rct_window *w = window_create(
x,
y,
600,
400,
&window_track_list_events,
WC_TRACK_DESIGN_LIST,
0
);
w->widgets = window_track_list_widgets;
w->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_ROTATE) | (1 << WIDX_TOGGLE_SCENERY) | (1 << WIDX_BACK);
window_init_scroll_widgets(w);
w->track_list.var_480 = 0xFFFF;
w->track_list.var_484 = 0;
w->track_list.reload_track_designs = false;
w->selected_list_item = 0;
if (_trackDesignsCount != 0 && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
w->selected_list_item = 1;
}
gTrackDesignSceneryToggle = false;
window_push_others_right(w);
_currentTrackPieceDirection = 2;
_trackDesignPreviewPixels = calloc(4, TRACK_PREVIEW_IMAGE_SIZE);
_loadedTrackDesign = NULL;
_loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED;
}
/**
*
* rct2: 0x006CFD76
*/
static void window_track_list_close(rct_window *w)
{
// Dispose track design and preview
track_design_dispose(_loadedTrackDesign);
_loadedTrackDesign = NULL;
SafeFree(_trackDesignPreviewPixels);
// Dispose track list
for (size_t i = 0; i < _trackDesignsCount; i++) {
free(_trackDesigns[i].name);
free(_trackDesigns[i].path);
}
SafeFree(_trackDesigns);
_trackDesignsCount = 0;
}
/**
*
* rct2: 0x006CFB82
*/
static void window_track_list_select(rct_window *w, int index)
{
w->track_list.var_480 = index;
// Displays a message if the ride can't load, fix #4080
if (_loadedTrackDesign == NULL) {
window_error_open(STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_TRACK_LOAD_FAILED_ERROR);
return;
}
audio_play_sound_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0);
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
if (index == 0) {
window_close(w);
ride_construct_new(_window_track_list_item);
return;
}
index--;
}
rct_track_td6 *td6 = _loadedTrackDesign;
if (td6 != NULL && (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE)) {
gTrackDesignSceneryToggle = true;
}
track_design_file_ref *tdRef = &_trackDesigns[index];
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
window_track_manage_open(tdRef);
} else {
if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED && (_loadedTrackDesign->track_flags & 4)) {
window_error_open(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE);
}
window_track_place_open(tdRef);
}
}
static int window_track_list_get_list_item_index_from_position(int x, int y)
{
int maxItems = (int)_trackDesignsCount;
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
// Extra item: custom design
maxItems++;
}
int index = y / 10;
if (index < 0 || index >= maxItems) {
index = -1;
}
return index;
}
/**
*
* rct2: 0x006CFA31
*/
static void window_track_list_mouseup(rct_window *w, int widgetIndex)
{
switch (widgetIndex) {
case WIDX_CLOSE:
window_close(w);
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number);
window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number);
trackmanager_load();
}
break;
case WIDX_ROTATE:
_currentTrackPieceDirection++;
_currentTrackPieceDirection %= 4;
window_invalidate(w);
break;
case WIDX_TOGGLE_SCENERY:
gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle;
_loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED;
window_invalidate(w);
break;
case WIDX_BACK:
window_close(w);
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number);
window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number);
trackmanager_load();
} else {
window_new_ride_open();
}
break;
}
}
/**
*
* rct2: 0x006CFAB0
*/
static void window_track_list_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height)
{
size_t numItems = _trackDesignsCount;
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
// Extra item: custom design
numItems++;
}
*height = (int)(numItems * 10);
}
/**
*
* rct2: 0x006CFB39
*/
static void window_track_list_scrollmousedown(rct_window *w, int scrollIndex, int x, int y)
{
if (!(w->track_list.var_484 & 1)) {
int i = window_track_list_get_list_item_index_from_position(x, y);
if (i != -1) {
window_track_list_select(w, i);
}
}
}
/**
*
* rct2: 0x006CFAD7
*/
static void window_track_list_scrollmouseover(rct_window *w, int scrollIndex, int x, int y)
{
if (!(w->track_list.var_484 & 1)) {
int i = window_track_list_get_list_item_index_from_position(x, y);
if (i != -1 && w->selected_list_item != i) {
w->selected_list_item = i;
window_invalidate(w);
}
}
}
/**
*
* rct2: 0x006CFD6C
*/
static void window_track_list_tooltip(rct_window* w, int widgetIndex, rct_string_id *stringId)
{
set_format_arg(0, rct_string_id, STR_LIST);
}
static void window_track_list_update(rct_window *w)
{
if (w->track_list.reload_track_designs) {
track_list_load_designs(_window_track_list_item);
w->selected_list_item = 0;
window_invalidate(w);
}
}
/**
*
* rct2: 0x006CF2D6
*/
static void window_track_list_invalidate(rct_window *w)
{
colour_scheme_update(w);
rct_string_id stringId = STR_NONE;
rct_ride_entry *entry = get_ride_entry(_window_track_list_item.entry_index);
if (entry != NULL && entry != (rct_ride_entry*)-1) {
stringId = entry->name;
if (!(entry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) || rideTypeShouldLoseSeparateFlag(entry))
stringId = _window_track_list_item.type + 2;
}
set_format_arg(0, rct_string_id, stringId);
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
window_track_list_widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS;
window_track_list_widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_RENAME_OR_DELETE_IT;
} else {
window_track_list_widgets[WIDX_TITLE].text = STR_SELECT_DESIGN;
window_track_list_widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP;
}
if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) || w->selected_list_item != 0) {
w->pressed_widgets |= 1 << WIDX_TRACK_PREVIEW;
w->disabled_widgets &= ~(1 << WIDX_TRACK_PREVIEW);
window_track_list_widgets[WIDX_ROTATE].type = WWT_FLATBTN;
window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WWT_FLATBTN;
if (gTrackDesignSceneryToggle) {
w->pressed_widgets &= ~(1 << WIDX_TOGGLE_SCENERY);
} else {
w->pressed_widgets |= (1 << WIDX_TOGGLE_SCENERY);
}
} else {
w->pressed_widgets &= ~(1 << WIDX_TRACK_PREVIEW);
w->disabled_widgets |= (1 << WIDX_TRACK_PREVIEW);
window_track_list_widgets[WIDX_ROTATE].type = WWT_EMPTY;
window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WWT_EMPTY;
}
}
/**
*
* rct2: 0x006CF387
*/
static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
window_draw_widgets(w, dpi);
int trackIndex = w->selected_list_item;
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
if (_trackDesignsCount == 0 || trackIndex == -1) {
return;
}
} else if (trackIndex-- == 0) {
return;
}
// Track preview
int x, y, colour;
rct_widget *widget = &window_track_list_widgets[WIDX_TRACK_PREVIEW];
x = w->x + widget->left + 1;
y = w->y + widget->top + 1;
colour = ColourMapA[w->colours[0]].darkest;
gfx_fill_rect(dpi, x, y, x + 369, y + 216, colour);
if (_loadedTrackDesignIndex != trackIndex) {
utf8 *path = _trackDesigns[trackIndex].path;
if (track_list_load_design_for_preview(path)) {
_loadedTrackDesignIndex = trackIndex;
} else {
_loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED;
return;
}
}
rct_track_td6 *td6 = _loadedTrackDesign;
if (td6 == NULL) {
return;
}
rct_g1_element *substituteElement = &g1Elements[0];
rct_g1_element tmpElement = *substituteElement;
substituteElement->offset = _trackDesignPreviewPixels + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
substituteElement->width = 370;
substituteElement->height = 217;
substituteElement->x_offset = 0;
substituteElement->y_offset = 0;
substituteElement->flags = G1_FLAG_BMP;
gfx_draw_sprite(dpi, 0, x, y, 0);
*substituteElement = tmpElement;
x = w->x + (widget->left + widget->right) / 2;
y = w->y + widget->bottom - 12;
// Warnings
if ((td6->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE) && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) {
// Vehicle design not available
gfx_draw_string_centred_clipped(dpi, STR_VEHICLE_DESIGN_UNAVAILABLE, NULL, COLOUR_BLACK, x, y, 368);
y -= 10;
}
if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) {
if (!gTrackDesignSceneryToggle) {
// Scenery not available
gfx_draw_string_centred_clipped(dpi, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, NULL, COLOUR_BLACK, x, y, 368);
y -= 10;
}
}
// Track design name
utf8 *trackName = _trackDesigns[trackIndex].name;
gfx_draw_string_centred_clipped(dpi, STR_TRACK_PREVIEW_NAME_FORMAT, &trackName, COLOUR_BLACK, x, y, 368);
// Information
x = w->x + widget->left + 1;
y = w->y + widget->bottom + 2;
// Stats
fixed32_2dp rating = td6->excitement * 10;
gfx_draw_string_left(dpi, STR_TRACK_LIST_EXCITEMENT_RATING, &rating, COLOUR_BLACK, x, y);
y += 10;
rating = td6->intensity * 10;
gfx_draw_string_left(dpi, STR_TRACK_LIST_INTENSITY_RATING, &rating, COLOUR_BLACK, x, y);
y += 10;
rating = td6->nausea * 10;
gfx_draw_string_left(dpi, STR_TRACK_LIST_NAUSEA_RATING, &rating, COLOUR_BLACK, x, y);
y += 14;
if (td6->type != RIDE_TYPE_MAZE) {
if (td6->type == RIDE_TYPE_MINI_GOLF) {
// Holes
uint16 holes = td6->holes & 0x1F;
gfx_draw_string_left(dpi, STR_HOLES, &holes, COLOUR_BLACK, x, y);
y += 10;
} else {
// Maximum speed
uint16 speed = ((td6->max_speed << 16) * 9) >> 18;
gfx_draw_string_left(dpi, STR_MAX_SPEED, &speed, COLOUR_BLACK, x, y);
y += 10;
// Average speed
speed = ((td6->average_speed << 16) * 9) >> 18;
gfx_draw_string_left(dpi, STR_AVERAGE_SPEED, &speed, COLOUR_BLACK, x, y);
y += 10;
}
// Ride length
set_format_arg(0, rct_string_id, STR_RIDE_LENGTH_ENTRY);
set_format_arg(2, uint16, td6->ride_length);
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
y += 10;
}
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES)) {
// Maximum positive vertical Gs
int gForces = td6->max_positive_vertical_g * 32;
gfx_draw_string_left(dpi, STR_MAX_POSITIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
y += 10;
// Maximum negative verical Gs
gForces = td6->max_negative_vertical_g * 32;
gfx_draw_string_left(dpi, STR_MAX_NEGATIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
y += 10;
// Maximum lateral Gs
gForces = td6->max_lateral_g * 32;
gfx_draw_string_left(dpi, STR_MAX_LATERAL_G, &gForces, COLOUR_BLACK, x, y);
y += 10;
// If .TD6
if (td6->version_and_colour_scheme / 4 >= 2) {
if (td6->total_air_time != 0) {
// Total air time
int airTime = td6->total_air_time * 25;
gfx_draw_string_left(dpi, STR_TOTAL_AIR_TIME, &airTime, COLOUR_BLACK, x, y);
y += 10;
}
}
}
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_DROPS)) {
// Drops
uint16 drops = td6->drops & 0x3F;
gfx_draw_string_left(dpi, STR_DROPS, &drops, COLOUR_BLACK, x, y);
y += 10;
// Drop height is multiplied by 0.75
gfx_draw_string_left(dpi, STR_HIGHEST_DROP_HEIGHT, &drops, COLOUR_BLACK, x, y);
y += 10;
}
if (td6->type != RIDE_TYPE_MINI_GOLF) {
uint16 inversions = td6->inversions & 0x1F;
if (inversions != 0) {
// Inversions
gfx_draw_string_left(dpi, STR_INVERSIONS, &inversions, COLOUR_BLACK, x, y);
y += 10;
}
}
y += 4;
if (td6->space_required_x != 0xFF) {
// Space required
set_format_arg(0, uint16, td6->space_required_x);
set_format_arg(2, uint16, td6->space_required_y);
gfx_draw_string_left(dpi, STR_TRACK_LIST_SPACE_REQUIRED, gCommonFormatArgs, COLOUR_BLACK, x, y);
y += 10;
}
if (td6->cost != 0) {
gfx_draw_string_left(dpi, STR_TRACK_LIST_COST_AROUND, &td6->cost, COLOUR_BLACK, x, y);
y += 14;
}
}
/**
*
* rct2: 0x006CF8CD
*/
static void window_track_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
{
uint8 paletteIndex = ColourMapA[w->colours[0]].mid_light;
gfx_clear(dpi, paletteIndex);
int x = 0;
int y = 0;
size_t listIndex = 0;
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) {
if (_trackDesignsCount == 0) {
// No track designs
gfx_draw_string_left(dpi, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE, NULL, COLOUR_BLACK, x, y - 1);
return;
}
} else {
// Build custom track item
rct_string_id stringId;
if (listIndex == w->selected_list_item) {
// Highlight
gfx_filter_rect(dpi, x, y, w->width, y + 9, PALETTE_DARKEN_1);
stringId = STR_WINDOW_COLOUR_2_STRINGID;
} else {
stringId = STR_BLACK_STRING;
}
rct_string_id stringId2 = STR_BUILD_CUSTOM_DESIGN;
gfx_draw_string_left(dpi, stringId, &stringId2, COLOUR_BLACK, x, y - 1);
y += 10;
listIndex++;
}
for (size_t i = 0; i < _trackDesignsCount; i++, listIndex++) {
if (y + 10 >= dpi->y && y < dpi->y + dpi->height) {
rct_string_id stringId;
if (listIndex == w->selected_list_item) {
// Highlight
gfx_filter_rect(dpi, x, y, w->width, y + 9, PALETTE_DARKEN_1);
stringId = STR_WINDOW_COLOUR_2_STRINGID;
} else {
stringId = STR_BLACK_STRING;
}
// Draw track name
set_format_arg(0, rct_string_id, STR_TRACK_LIST_NAME_FORMAT);
set_format_arg(2, utf8*, _trackDesigns[i].name);
gfx_draw_string_left(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, x, y - 1);
}
y += 10;
}
}
static void track_list_load_designs(ride_list_item item)
{
char entry[9];
const char *entryPtr = NULL;
if (item.type < 0x80) {
rct_ride_entry *rideEntry = get_ride_entry(item.entry_index);
if ((rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE) && !rideTypeShouldLoseSeparateFlag(rideEntry)) {
get_ride_entry_name(entry, item.entry_index);
entryPtr = entry;
}
}
_trackDesignsCount = track_repository_get_items_for_ride(&_trackDesigns, item.type, entryPtr);
}
static bool track_list_load_design_for_preview(utf8 *path)
{
// Dispose currently loaded track
track_design_dispose(_loadedTrackDesign);
_loadedTrackDesign = NULL;
_loadedTrackDesign = track_design_open(path);
if (_loadedTrackDesign != NULL && drawing_engine_get_type() != DRAWING_ENGINE_OPENGL) {
track_design_draw_preview(_loadedTrackDesign, _trackDesignPreviewPixels);
return true;
}
return false;
}
|
Overv/OpenRCT2
|
src/windows/track_list.c
|
C
|
gpl-3.0
| 18,487
|
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_ParticleSystem_CollisionModule : LuaObject {
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int constructor(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule o;
o=new UnityEngine.ParticleSystem.CollisionModule();
pushValue(l,true);
pushValue(l,o);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int SetPlane(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
System.Int32 a1;
checkType(l,2,out a1);
UnityEngine.Transform a2;
checkType(l,3,out a2);
self.SetPlane(a1,a2);
pushValue(l,true);
setBack(l,self);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int GetPlane(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
System.Int32 a1;
checkType(l,2,out a1);
var ret=self.GetPlane(a1);
pushValue(l,true);
pushValue(l,ret);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_enabled(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.enabled);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_enabled(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.enabled=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_type(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.type);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_type(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemCollisionType v;
checkEnum(l,2,out v);
self.type=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_mode(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.mode);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_mode(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemCollisionMode v;
checkEnum(l,2,out v);
self.mode=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_dampen(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.dampen);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_dampen(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.dampen=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_bounce(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.bounce);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_bounce(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.bounce=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_lifetimeLoss(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.lifetimeLoss);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_lifetimeLoss(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.lifetimeLoss=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_minKillSpeed(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.minKillSpeed);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_minKillSpeed(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.minKillSpeed=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_maxKillSpeed(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.maxKillSpeed);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_maxKillSpeed(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.maxKillSpeed=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_collidesWith(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.collidesWith);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_collidesWith(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.LayerMask v;
checkValueType(l,2,out v);
self.collidesWith=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_enableDynamicColliders(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.enableDynamicColliders);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_enableDynamicColliders(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.enableDynamicColliders=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_enableInteriorCollisions(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.enableInteriorCollisions);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_enableInteriorCollisions(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.enableInteriorCollisions=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_maxCollisionShapes(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.maxCollisionShapes);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_maxCollisionShapes(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
int v;
checkType(l,2,out v);
self.maxCollisionShapes=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_quality(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.quality);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_quality(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemCollisionQuality v;
checkEnum(l,2,out v);
self.quality=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_voxelSize(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.voxelSize);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_voxelSize(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.voxelSize=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_radiusScale(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radiusScale);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_radiusScale(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.radiusScale=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_sendCollisionMessages(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.sendCollisionMessages);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_sendCollisionMessages(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.sendCollisionMessages=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_maxPlaneCount(IntPtr l) {
try {
UnityEngine.ParticleSystem.CollisionModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.maxPlaneCount);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
static public void reg(IntPtr l) {
getTypeTable(l,"UnityEngine.ParticleSystem.CollisionModule");
addMember(l,SetPlane);
addMember(l,GetPlane);
addMember(l,"enabled",get_enabled,set_enabled,true);
addMember(l,"type",get_type,set_type,true);
addMember(l,"mode",get_mode,set_mode,true);
addMember(l,"dampen",get_dampen,set_dampen,true);
addMember(l,"bounce",get_bounce,set_bounce,true);
addMember(l,"lifetimeLoss",get_lifetimeLoss,set_lifetimeLoss,true);
addMember(l,"minKillSpeed",get_minKillSpeed,set_minKillSpeed,true);
addMember(l,"maxKillSpeed",get_maxKillSpeed,set_maxKillSpeed,true);
addMember(l,"collidesWith",get_collidesWith,set_collidesWith,true);
addMember(l,"enableDynamicColliders",get_enableDynamicColliders,set_enableDynamicColliders,true);
addMember(l,"enableInteriorCollisions",get_enableInteriorCollisions,set_enableInteriorCollisions,true);
addMember(l,"maxCollisionShapes",get_maxCollisionShapes,set_maxCollisionShapes,true);
addMember(l,"quality",get_quality,set_quality,true);
addMember(l,"voxelSize",get_voxelSize,set_voxelSize,true);
addMember(l,"radiusScale",get_radiusScale,set_radiusScale,true);
addMember(l,"sendCollisionMessages",get_sendCollisionMessages,set_sendCollisionMessages,true);
addMember(l,"maxPlaneCount",get_maxPlaneCount,null,true);
createTypeMetatable(l,constructor, typeof(UnityEngine.ParticleSystem.CollisionModule),typeof(System.ValueType));
}
}
|
yongkangchen/poker-client
|
Assets/Runtime/Slua/LuaObject/Unity/Lua_UnityEngine_ParticleSystem_CollisionModule.cs
|
C#
|
gpl-3.0
| 14,303
|
package tensor2go
type Scalar struct {
*Tensor
}
func NewScalar(val interface{}) (v *Scalar){
v = &Scalar{NewTensor()}
v.Tensor.tensorRoot = v.Tensor.graph.CreateVertex("root",val)
return
}
func (s *Scalar) Val() interface{} {
return s.Tensor.tensorRoot.Properties()
}
func (s *Scalar) Multiply(val interface{})(r interface{}){
m, ok := s.Val().(Multiplier)
if !ok {
panic("Value is not a multiplier")
}
if v, ok := val.(*Scalar); ok {
r = m.Multiply(v.Val())
}
return
}
|
joernweissenborn/tensor2go
|
scalar.go
|
GO
|
gpl-3.0
| 491
|
/**************************************************************************************************
* This file is part of Connect X.
*
* Connect X is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Connect X is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Connect X. If not, see <https://www.gnu.org/licenses/>.
*
*************************************************************************************************/
/**********************************************************************************************//**
* @file GameBoard.cpp
* @date 2020
*
*************************************************************************************************/
#include <algorithm>
#include <gdkmm/display.h>
#include <cxinv/include/assertion.h>
#include <cxmodel/include/Disc.h>
#include <Board.h>
#include <DiscChip.h>
#include <IGameViewController.h>
#include <IGameViewPresenter.h>
constexpr bool FULLY_HANDLED = true;
constexpr bool PROPAGATE = false;
namespace
{
// Computes the best chip dimension so that the game view, when the board is present with all
// chips drawn, is entirely viewable on the user's screen.
int ComputeMinimumChipSize(const cxgui::Board& p_board, size_t p_nbRows, size_t p_nbColumns)
{
// Get screen containing the widget:
const Glib::RefPtr<const Gdk::Screen> screen = p_board.get_screen();
IF_CONDITION_NOT_MET_DO(bool(screen), return -1;);
// Get the screen dimensions:
const int fullScreenHeight = screen->get_height();
const int fullScreenWidth = screen->get_width();
// Get minimum screen dimension:
const int minFullScreenDimension = std::min(fullScreenHeight, fullScreenWidth);
// First, we check if the chips can use their default size:
int nbRows = static_cast<int>(p_nbRows);
int nbColumns = static_cast<int>(p_nbColumns);
if(nbRows * cxgui::DEFAULT_CHIP_SIZE < (2 * fullScreenHeight) / 3)
{
if(nbColumns * cxgui::DEFAULT_CHIP_SIZE < (2 * fullScreenWidth) / 3)
{
return cxgui::DEFAULT_CHIP_SIZE;
}
}
// The the biggest board dimension:
const int maxBoardDimension = std::max(nbRows, nbColumns);
// From this, the max chip dimension (dimension at which together, chips from the board would fill the
// entire screen in its smallest dimension) is computed:
const int maxChipDimension = (minFullScreenDimension / maxBoardDimension);
// We take two thirds from this value for the board (leaving the remaining to the rest of the
// game view):
return (maxChipDimension * 2) / 3;
}
} // namespace
cxgui::Board::Board(const IGameViewPresenter& p_presenter, IGameViewController& p_controller)
: m_presenter{p_presenter}
, m_controller{p_controller}
, m_currentDiscPosition{0u}
{
set_orientation(Gtk::Orientation::ORIENTATION_VERTICAL);
InitializeNextDiscArea(m_presenter.GetGameViewBoardWidth());
InitializeBoard(m_presenter.GetGameViewBoardHeight(), m_presenter.GetGameViewBoardWidth());
pack1(m_nextDiscAreaLayout, true, false);
pack2(m_boardLayout, true, false);
}
void cxgui::Board::DropChip()
{
Chip* chip = GetChip(m_nextDiscAreaLayout, m_currentDiscPosition, 0);
IF_CONDITION_NOT_MET_DO(chip, return;);
m_controller.OnDown(chip->GetColor(), m_currentDiscPosition);
}
void cxgui::Board::MoveLeft()
{
Move(Side::Left);
}
void cxgui::Board::MoveRight()
{
Move(Side::Right);
}
void cxgui::Board::Update(Context p_context)
{
switch(p_context)
{
case Context::CHIP_DROPPED:
{
MoveCurrentDiscAtFirstRow();
RefreshBoardArea();
break;
}
case Context::GAME_WON:
{
ClearNextDiscArea();
RefreshBoardArea();
break;
}
case Context::GAME_REINITIALIZED:
{
MoveCurrentDiscAtFirstRow();
ClearBoardArea();
break;
}
}
}
cxgui::Chip* cxgui::Board::GetChip(Gtk::Grid& p_discArea, int p_left, int p_top)
{
Widget* child = p_discArea.get_child_at(p_left, p_top);
IF_CONDITION_NOT_MET_DO(child, return nullptr;);
Chip* chip = dynamic_cast<Chip*>(child);
IF_CONDITION_NOT_MET_DO(child, return nullptr;);
return chip;
}
void cxgui::Board::Move(Side p_side)
{
ChangeCurrentDisc(cxmodel::MakeTransparent());
UpdateNextDiscPosition(p_side);
ChangeCurrentDisc(m_presenter.GetGameViewActivePlayerChipColor());
}
void cxgui::Board::ChangeCurrentDisc(const cxmodel::ChipColor& p_newColor)
{
Chip* chip = GetChip(m_nextDiscAreaLayout, m_currentDiscPosition, 0);
IF_CONDITION_NOT_MET_DO(chip, return;);
chip->ChangeColor(p_newColor);
}
void cxgui::Board::UpdateNextDiscPosition(Side p_side)
{
if(p_side == Side::Left)
{
if(m_currentDiscPosition > 0)
{
--m_currentDiscPosition;
}
else
{
m_currentDiscPosition = m_presenter.GetGameViewBoardWidth() - 1;
}
}
else
{
if(m_currentDiscPosition < m_presenter.GetGameViewBoardWidth() - 1)
{
++m_currentDiscPosition;
}
else
{
m_currentDiscPosition = 0u;
}
}
}
void cxgui::Board::InitializeNextDiscArea(size_t p_width)
{
const int chipDimension = ComputeMinimumChipSize(*this, m_presenter.GetGameViewBoardHeight(), m_presenter.GetGameViewBoardWidth());
m_nextDiscAreaLayout.set_row_homogeneous(true);
m_nextDiscAreaLayout.set_column_homogeneous(true);
Chip* activePlayerChip = Gtk::manage(new DiscChip{m_presenter.GetGameViewActivePlayerChipColor(), cxmodel::MakeTransparent(), chipDimension});
activePlayerChip->set_vexpand(true);
activePlayerChip->set_hexpand(true);
m_nextDiscAreaLayout.attach(*activePlayerChip, 0, 0, 1, 1);
for(size_t i = 1; i < p_width; ++i)
{
Chip* noChip = Gtk::manage(new DiscChip{cxmodel::MakeTransparent(), cxmodel::MakeTransparent(), chipDimension});
noChip->set_vexpand(true);
noChip->set_hexpand(true);
m_nextDiscAreaLayout.attach(*noChip, i, 0, 1, 1);
}
}
void cxgui::Board::InitializeBoard(size_t p_height, size_t p_width)
{
const int chipDimension = ComputeMinimumChipSize(*this, m_presenter.GetGameViewBoardHeight(), m_presenter.GetGameViewBoardWidth());
m_boardLayout.set_row_homogeneous(true);
m_boardLayout.set_column_homogeneous(true);
for(size_t i = 0; i < p_height; ++i)
{
for(size_t j = 0; j < p_width; ++j)
{
Chip* noChip = Gtk::manage(new DiscChip{cxmodel::MakeTransparent(), cxmodel::MakeBlue(), chipDimension});
noChip->set_vexpand(true);
noChip->set_hexpand(true);
m_boardLayout.attach(*noChip, j, i, 1, 1);
}
}
}
void cxgui::Board::MoveCurrentDiscAtFirstRow()
{
Chip* currentChip = GetChip(m_nextDiscAreaLayout, m_currentDiscPosition, 0);
IF_CONDITION_NOT_MET_DO(currentChip, return;);
currentChip->ChangeColor(cxmodel::MakeTransparent());
m_currentDiscPosition = 0u;
Chip* startChip = GetChip(m_nextDiscAreaLayout, m_currentDiscPosition, 0);
IF_CONDITION_NOT_MET_DO(startChip, return;);
startChip->ChangeColor(m_presenter.GetGameViewActivePlayerChipColor());
}
void cxgui::Board::RefreshBoardArea()
{
const cxgui::IGameViewPresenter::ChipColors& chipColors = m_presenter.GetGameViewChipColors();
for(size_t row = 0u; row < m_presenter.GetGameViewBoardHeight(); ++row)
{
for(size_t column = 0u; column < m_presenter.GetGameViewBoardWidth(); ++column)
{
Chip* chip = GetChip(m_boardLayout, column, row);
IF_CONDITION_NOT_MET_DO(chip, return;);
chip->ChangeColor(chipColors[row][column]);
}
}
}
void cxgui::Board::ClearNextDiscArea()
{
for(size_t column = 0u; column < m_presenter.GetGameViewBoardWidth(); ++column)
{
Chip* chip = GetChip(m_nextDiscAreaLayout, column, 0u);
IF_CONDITION_NOT_MET_DO(chip, return;);
chip->ChangeColor(cxmodel::MakeTransparent());
}
}
void cxgui::Board::ClearBoardArea()
{
for(size_t row = 0u; row < m_presenter.GetGameViewBoardHeight(); ++row)
{
for(size_t column = 0u; column < m_presenter.GetGameViewBoardWidth(); ++column)
{
Chip* chip = GetChip(m_boardLayout, column, row);
IF_CONDITION_NOT_MET_DO(chip, return;);
chip->ChangeColor(cxmodel::MakeTransparent());
}
}
}
|
BobMorane22/ConnectX
|
cxgui/src/Board.cpp
|
C++
|
gpl-3.0
| 8,959
|
using CatalokoSite.Models;
using CatalokoSite.Models.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CatalokoSite.Controllers
{
public class MarketController : Controller
{
[Route("~/market")]
public ActionResult Noticias()
{
var model = new OpenGraph
{
title = "Market",
description = "Compre e venda no Catáloko",
image = ""
};
return View(Config.ResolveMasterView(this.HttpContext), model);
}
}
}
|
albertoroque/cataloko
|
site/CatalokoSite/Controllers/MarketController.cs
|
C#
|
gpl-3.0
| 642
|
/*
OpenChange Storage Abstraction Layer library
OpenChange Project
Copyright (C) Julien Kerihuel 2010
Copyright (C) Carlos Pérez-Aradros Herce 2014
Copyright (C) Jesús García Sáez 2014
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
\file mapistore_indexing.c
\brief MAPISTORE internal indexing functions
This file contains functionality to map between folder / message
identifiers and backend URI strings.
*/
#include "mapistore.h"
#include "mapistore_errors.h"
#include "mapistore_private.h"
#include "backends/indexing_tdb.h"
#include "backends/indexing_mysql.h"
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
char *default_indexing_url = NULL;
/**
\details Set the default backend url. If none is set, a tdb file per user
will be used.
\param url default backend url to be used
*/
_PUBLIC_ void mapistore_set_default_indexing_url(const char *url)
{
TALLOC_CTX *mem_ctx;
if (default_indexing_url) talloc_free(default_indexing_url);
if (url == NULL) {
default_indexing_url = NULL;
} else {
mem_ctx = talloc_autofree_context();
default_indexing_url = talloc_strdup(mem_ctx, url);
}
}
/**
\details Search the indexing record matching the username
\param mstore_ctx pointer to the mapistore context
\param username the username to lookup
\return pointer to the tdb_wrap structure on success, otherwise NULL
*/
struct indexing_context *mapistore_indexing_search(struct mapistore_context *mstore_ctx,
const char *username)
{
struct indexing_context_list *el;
/* Sanity checks */
if (!mstore_ctx) return NULL;
if (!mstore_ctx->indexing_list) return NULL;
if (!username) return NULL;
for (el = mstore_ctx->indexing_list; el; el = el->next) {
/* TODO: extract url from backend mapping, by the moment we use the username */
if (el && el->ctx && !strcmp(el->ctx->url, username)) {
return el->ctx;
}
}
return NULL;
}
/**
\details Open connection to indexing database for a given user
\param mstore_ctx pointer to the mapistore context
\param username name for which the indexing database has to be
created
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_add(struct mapistore_context *mstore_ctx,
const char *username,
struct indexing_context **ictxp)
{
struct indexing_context_list *ictx;
const char *indexing_url;
/* Sanity checks */
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!username, MAPISTORE_ERROR, NULL);
/* Step 1. Search if the context already exists */
*ictxp = mapistore_indexing_search(mstore_ctx, username);
MAPISTORE_RETVAL_IF(*ictxp, MAPISTORE_SUCCESS, NULL);
// indexing context has not been found, let's create it.
indexing_url = openchangedb_get_indexing_url(mstore_ctx->conn_info->oc_ctx,
username);
if (indexing_url == NULL) {
indexing_url = default_indexing_url;
}
// indexing_url NULL means to use the default backend: tdb
if (indexing_url == NULL) {
ictx = talloc_zero(mstore_ctx, struct indexing_context_list);
mapistore_indexing_tdb_init(mstore_ctx, username, &ictx->ctx);
} else if (strncmp(indexing_url, "mysql://", strlen("mysql://")) == 0) {
ictx = talloc_zero(mstore_ctx, struct indexing_context_list);
mapistore_indexing_mysql_init(mstore_ctx, username, indexing_url,
&ictx->ctx);
} else {
DEBUG(0, ("ERROR unknown indexing url %s\n", indexing_url));
return MAPISTORE_ERROR;
}
/* ictx->ref_count = 0; */
DLIST_ADD_END(mstore_ctx->indexing_list, ictx, struct indexing_context_list *);
*ictxp = ictx->ctx;
return MAPISTORE_SUCCESS;
}
/**
\details Add a folder or message record to the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param fmid the folder or message ID to add
\param type MAPISTORE_FOLDER or MAPISTORE_MESSAGE
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
enum mapistore_error mapistore_indexing_record_add_fmid(struct mapistore_context *mstore_ctx,
uint32_t context_id,
const char *username,
uint64_t fmid, int type)
{
int ret;
struct backend_context *backend_ctx;
struct indexing_context *ictx;
char *mapistore_URI = NULL;
/* Sanity checks */
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!context_id, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!fmid, MAPISTORE_ERROR, NULL);
/* Ensure the context exists */
backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
MAPISTORE_RETVAL_IF(!backend_ctx->indexing, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
/* Check if the fid/mid doesn't already exist within the database */
ret = mapistore_indexing_add(mstore_ctx, username, &ictx);
MAPISTORE_RETVAL_IF(ret, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERROR, NULL);
/* Retrieve the mapistore URI given context_id and fmid */
mapistore_backend_get_path(backend_ctx, NULL, fmid, &mapistore_URI);
/* DEBUG(0, ("mapistore_URI = %s\n", mapistore_URI)); */
MAPISTORE_RETVAL_IF(!mapistore_URI, MAPISTORE_ERROR, NULL);
/* Add the record given its fid and mapistore_uri */
switch(type) {
case MAPISTORE_FOLDER:
case MAPISTORE_MESSAGE:
ret = ictx->add_fmid(ictx, username, fmid, mapistore_URI);
break;
default:
return MAPISTORE_ERR_INVALID_PARAMETER;
}
talloc_free(mapistore_URI);
return ret;
}
/**
\details Remove a folder or message record from the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param fmid the folder or message ID to delete
\param flags the type of deletion MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE
\param type MAPISTORE_FOLDER or MAPISTORE_MESSAGE
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
enum mapistore_error mapistore_indexing_record_del_fmid(struct mapistore_context *mstore_ctx,
uint32_t context_id, const char *username, uint64_t fmid,
uint8_t flags, int type)
{
int ret;
struct backend_context *backend_ctx;
struct indexing_context *ictx;
/* Sanity checks */
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!context_id, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!fmid, MAPISTORE_ERROR, NULL);
/* Ensure the context exists */
backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
MAPISTORE_RETVAL_IF(!backend_ctx->indexing, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
/* Check if the fid/mid still exists within the database */
ret = mapistore_indexing_add(mstore_ctx, username, &ictx);
MAPISTORE_RETVAL_IF(ret, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERROR, NULL);
switch(type) {
case MAPISTORE_FOLDER:
case MAPISTORE_MESSAGE:
ret = ictx->del_fmid(ictx, username, fmid, flags);
break;
default:
return MAPISTORE_ERR_INVALID_PARAMETER;
}
return ret;
}
/**
\details Returns record data
\param mstore_ctx pointer to the mapistore context
\param username the name of the account where to look for the
indexing database
\param mem_ctx pointer to the memory context
\param fmid the fmid/key to the record
\param urip pointer to the uri pointer
\param soft_deletedp pointer to the soft deleted pointer
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_record_get_uri(struct mapistore_context *mstore_ctx, const char *username, TALLOC_CTX *mem_ctx, uint64_t fmid, char **urip, bool *soft_deletedp)
{
struct indexing_context *ictx;
int ret;
/* Sanity checks */
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!username, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!urip, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!soft_deletedp, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
/* Check if the fmid exists within the database */
ret = mapistore_indexing_add(mstore_ctx, username, &ictx);
MAPISTORE_RETVAL_IF(ret, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERROR, NULL);
return ictx->get_uri(ictx, username, mem_ctx, fmid, urip, soft_deletedp);
}
_PUBLIC_ enum mapistore_error mapistore_indexing_record_get_fmid(struct mapistore_context *mstore_ctx, const char *username, const char *uri, bool partial, uint64_t *fmidp, bool *soft_deletedp)
{
struct indexing_context *ictx;
int ret;
/* SANITY checks */
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!username, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!fmidp, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!soft_deletedp, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
ret = mapistore_indexing_add(mstore_ctx, username, &ictx);
MAPISTORE_RETVAL_IF(ret, MAPISTORE_ERROR, NULL);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERROR, NULL);
return ictx->get_fmid(ictx, username, uri, partial, fmidp, soft_deletedp);
}
/**
\details Add a fid record to the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param fid the fid to add
\note This is a wrapper to the internal common
mapistore_indexing_record_add_fmid function.
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_record_add_fid(struct mapistore_context *mstore_ctx,
uint32_t context_id, const char *username, uint64_t fid)
{
return mapistore_indexing_record_add_fmid(mstore_ctx, context_id, username, fid, MAPISTORE_FOLDER);
}
/**
\details Delete a fid record from the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param fid the fid to remove
\param flags the type of deletion MAPISTORE_SOFT_DELETE or
MAPISTORE_PERMANENT_DELETE
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_record_del_fid(struct mapistore_context *mstore_ctx,
uint32_t context_id, const char *username, uint64_t fid,
uint8_t flags)
{
return mapistore_indexing_record_del_fmid(mstore_ctx, context_id, username, fid, flags, MAPISTORE_FOLDER);
}
/**
\details Add a mid record to the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param mid the mid to add
\note This is a wrapper to the internal common
mapistore_indexing_record_add_fmid function.
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_record_add_mid(struct mapistore_context *mstore_ctx,
uint32_t context_id, const char *username, uint64_t mid)
{
return mapistore_indexing_record_add_fmid(mstore_ctx, context_id, username, mid, MAPISTORE_MESSAGE);
}
/**
\details Delete a mid record from the indexing database
\param mstore_ctx pointer to the mapistore context
\param context_id the context identifier referencing the indexing
database to update
\param mid the mid to remove
\param flags the type of deletion MAPISTORE_SOFT_DELETE or
MAPISTORE_PERMANENT_DELETE
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_record_del_mid(struct mapistore_context *mstore_ctx,
uint32_t context_id, const char *username, uint64_t mid,
uint8_t flags)
{
return mapistore_indexing_record_del_fmid(mstore_ctx, context_id, username, mid, flags, MAPISTORE_MESSAGE);
}
static enum mapistore_error mapistore_indexing_allocate_fid(struct mapistore_context *mstore_ctx,
const char *username,
uint64_t range_len, uint64_t *fid)
{
enum mapistore_error ret;
struct indexing_context *ictx;
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
MAPISTORE_RETVAL_IF(!fid, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
ictx = mapistore_indexing_search(mstore_ctx, username);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
ret = ictx->allocate_fmids(ictx, username, range_len, fid);
MAPISTORE_RETVAL_IF(ret != MAPISTORE_SUCCESS, ret, NULL);
return MAPISTORE_SUCCESS;
}
/**
\details Allocates a new FolderID for a specific user and returns it
\param mstore_ctx pointer to the mapistore context
\param username name of the mailbox
\param fid pointer to the fid value the function returns
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_get_new_folderID_as_user(struct mapistore_context *mstore_ctx,
const char *username, uint64_t *fid)
{
enum mapistore_error ret;
ret = mapistore_indexing_allocate_fid(mstore_ctx, username, 1, fid);
MAPISTORE_RETVAL_IF(ret != MAPISTORE_SUCCESS, ret, NULL);
*fid = (exchange_globcnt(*fid) << 16) | 0x0001;
return MAPISTORE_SUCCESS;
}
/**
\details Allocates a new FolderID and returns it
\param mstore_ctx pointer to the mapistore context
\param fid pointer to the fid value the function returns
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_get_new_folderID(struct mapistore_context *mstore_ctx,
uint64_t *fid)
{
return mapistore_indexing_get_new_folderID_as_user(mstore_ctx, mstore_ctx->conn_info->username, fid);
}
/**
\details Allocates a batch of new folder ids and returns them
\param mstore_ctx pointer to the mapistore context
\param mem_ctx memory context where the fid will be allocated
\param max number of fids to allocate
\param fids_p pointer array of fids values the function returns
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_get_new_folderIDs(struct mapistore_context *mstore_ctx,
TALLOC_CTX *mem_ctx,
uint64_t max,
struct UI8Array_r **fids_p)
{
uint64_t fid;
uint64_t count;
enum mapistore_error ret;
struct UI8Array_r *fids;
ret = mapistore_indexing_allocate_fid(mstore_ctx, mstore_ctx->conn_info->username, max, &fid);
MAPISTORE_RETVAL_IF(ret != MAPISTORE_SUCCESS, ret, NULL);
fids = talloc_zero(mem_ctx, struct UI8Array_r);
fids->cValues = max;
fids->lpui8 = talloc_array(fids, uint64_t, max);
for (count = 0; count < max; count++) {
fids->lpui8[count] = (exchange_globcnt(fid + count) << 16) | 0x0001;
}
*fids_p = fids;
return MAPISTORE_SUCCESS;
}
/**
\details Reserve a range of FMID
\param mstore_ctx pointer to the mapistore context
\param range_len size of the range of fmids to reserve
\param first_fmidp pointer to the first reserved fid value the function
returns
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
_PUBLIC_ enum mapistore_error mapistore_indexing_reserve_fmid_range(struct mapistore_context *mstore_ctx,
uint64_t range_len,
uint64_t *first_fmidp)
{
enum mapistore_error ret;
uint64_t fmid;
struct indexing_context *ictx;
const char *username;
MAPISTORE_RETVAL_IF(!mstore_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
MAPISTORE_RETVAL_IF(!first_fmidp, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
username = mstore_ctx->conn_info->username;
ictx = mapistore_indexing_search(mstore_ctx, username);
MAPISTORE_RETVAL_IF(!ictx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
ret = ictx->allocate_fmids(ictx, username, range_len, &fmid);
MAPISTORE_RETVAL_IF(ret != MAPISTORE_SUCCESS, ret, NULL);
*first_fmidp = (exchange_globcnt(fmid) << 16) | 0x0001;
return MAPISTORE_SUCCESS;
}
|
icandigitbaby/openchange
|
mapiproxy/libmapistore/mapistore_indexing.c
|
C
|
gpl-3.0
| 16,788
|
/*********************************************************************
Khitomer - Sistema de facturación
Copyright (C) <2012-2022> <Cristian Montano>
Este archivo es parte de Khitomer.
Khitomer es software libre: usted puede redistribuirlo y/o modificarlo
bajo los términos de la Licencia Pública General GNU publicada
por la Fundación para el Software Libre, ya sea la versión 3
de la Licencia, o (a su elección) cualquier versión posterior.
Este programa se distribuye con la esperanza de que sea útil, pero
SIN GARANTÍA ALGUNA; ni siquiera la garantía implícita
MERCANTIL o de APTITUD PARA UN PROPÓSITO DETERMINADO.
Consulte los detalles de la Licencia Pública General GNU para obtener
una información más detallada.
Debería haber recibido una copia de la Licencia Pública General GNU
junto a este programa.
En caso contrario, consulte <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef MODULOREPORTES_H
#define MODULOREPORTES_H
#include <QAbstractListModel>
#include <QSqlQuery>
class Reportes
{
public:
Q_INVOKABLE Reportes(const qlonglong &codigoReporte, const int &codigoMenuReporte,const QString &descripcionReporte,const QString &consultaSql,const QString &consultaSqlGraficas,const QString &consultaSqlCabezal);
qlonglong codigoReporte() const;
int codigoMenuReporte() const;
QString descripcionReporte() const;
QString consultaSql() const;
QString consultaSqlGraficas() const;
QString consultaSqlCabezal() const;
private:
qlonglong m_codigoReporte;
int m_codigoMenuReporte;
QString m_descripcionReporte;
QString m_consultaSql;
QString m_consultaSqlGraficas;
QString m_consultaSqlCabezal;
};
class ModuloReportes : public QAbstractListModel
{
Q_OBJECT
public:
enum IvasRoles {
CodigoReporteRole = Qt::UserRole + 1,
CodigoMenuReporteRole,
DescripcionReporteRole,
ConsultaSqlRole,
ConsultaSqlGraficasRole,
ConsultaSqlCabezalRole
};
ModuloReportes(QObject *parent = 0);
Q_INVOKABLE void agregarReportes(const Reportes &Reportes);
Q_INVOKABLE void limpiarListaReportes();
Q_INVOKABLE int rowCount(const QModelIndex & parent = QModelIndex()) const;
Q_INVOKABLE QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
Q_INVOKABLE void buscarReportes(QString , QString , QString );
Q_INVOKABLE bool retornaPermisosDelReporte(QString ,QString ) const;
Q_INVOKABLE QString generarReporte(QString, QString , QString, bool,QString) const;
Q_INVOKABLE QString generarReporteXLS(QString ,QString ) const;
Q_INVOKABLE QString retornaDirectorioReporteXLS(QString )const;
Q_INVOKABLE QString retornaDescripcionDelReporte(QString) const;
Q_INVOKABLE QString retornaConfiguracionAlineacionDeColumnaDelReporte(QString ,QString ) const;
Q_INVOKABLE QString retornaConfiguracionTotalizadorDeColumnaDelReporte(QString ,QString ) const;
Q_INVOKABLE QString retornaConfiguracionTipoDeDatoDeColumnaDelReporte(QString ,QString ) const;
Q_INVOKABLE bool retornaSiReportaEstaHabilitadoEnPerfil(QString ,QString ) const;
Q_INVOKABLE bool retornaReporteActivoPorPerfil(QString ,QString );
Q_INVOKABLE void eliminarReportesPerfil(QString ,QString ) const;
Q_INVOKABLE void insertarReportesPerfil(QString ,QString ) const ;
Q_INVOKABLE bool imprimirReporteEnImpresora(QString )const;
Q_INVOKABLE QString retornaDirectorioReporteWeb() const;
Q_INVOKABLE QString retornaDirectorioEstiloCssPDF() const;
Q_INVOKABLE QString retornaDirectorioEstiloCssHTML() const;
Q_INVOKABLE QString retornaDirectorioJquery_min_js() const;
Q_INVOKABLE QString retornaDirectorioJs_highcharts_js() const;
Q_INVOKABLE QString retornaDirectorioJs_modules_exporting_js() const;
QString totalizoSumando(QSqlQuery ,int ) const;
QVariant totalizoSumandoXLS(QSqlQuery ,int ) const;
QString totalizoContando(QSqlQuery ,int ) const;
Q_INVOKABLE bool imprimirReporteEnPDF(QString) const;
Q_INVOKABLE QString retornaSqlReporte(QString) const;
Q_INVOKABLE QString retornaSqlReporteGraficas(QString) const;
Q_INVOKABLE QString retornaSqlReporteCabezal(QString) const;
Q_INVOKABLE void abrirNavegadorArchivos()const;
private:
QList<Reportes> m_Reportes;
};
#endif // MODULOREPORTES_H
|
dreamsder/Khitomer
|
moduloreportes.h
|
C
|
gpl-3.0
| 4,431
|
package io.udash.web.guide.views.ext.demo
import io.udash._
import io.udash.bootstrap.utils.BootstrapStyles
import io.udash.bootstrap.utils.BootstrapStyles.ResponsiveBreakpoint
import io.udash.web.guide.styles.partials.GuideStyles
import org.scalajs.dom
import scala.collection.mutable.ListBuffer
import scalatags.JsDom.all._
object UrlLoggingDemo {
import io.udash.css.CssView._
val enabled = Property(false)
val history = SeqProperty[(String, Option[String])](ListBuffer.empty)
enabled.listen(b => if (!b) history.set(ListBuffer.empty))
def log(url: String, referrer: Option[String]): Unit =
if (enabled.get) history.append((url, referrer))
def apply(): dom.Element =
span(GuideStyles.frame, GuideStyles.useBootstrap)(
form(BootstrapStyles.containerFluid)(
div(BootstrapStyles.Grid.row)(
div(BootstrapStyles.Grid.col(4, ResponsiveBreakpoint.Medium))(
div(BootstrapStyles.InputGroup.inputGroup)(
div(BootstrapStyles.InputGroup.prepend)("Turn on logging:"),
div(BootstrapStyles.InputGroup.append)(Checkbox(UrlLoggingDemo.enabled)(cls := "checkbox-demo-a"))
)
)
)
), br,
form(BootstrapStyles.containerFluid)(
div(BootstrapStyles.Grid.row)(
div(BootstrapStyles.Grid.col(4, ResponsiveBreakpoint.Medium))(
b("Url")
),
div(BootstrapStyles.Grid.col(4, ResponsiveBreakpoint.Medium))(
b("Referrer")
)
),
produce(UrlLoggingDemo.history)(seq =>
div()(seq.map { case (url, refOpt) =>
div(BootstrapStyles.Grid.row)(
div(BootstrapStyles.Grid.col(4, ResponsiveBreakpoint.Medium))(
url
),
div(BootstrapStyles.Grid.col(4, ResponsiveBreakpoint.Medium))(
refOpt
)
)
}: _*).render
)
)
).render
}
|
UdashFramework/udash-guide
|
guide/src/main/scala/io/udash/web/guide/views/ext/demo/UrlLoggingDemo.scala
|
Scala
|
gpl-3.0
| 1,947
|
PrestaShop-Blog
===============
World Class Prestashop Blog, Developed By smartdatasoft
<h1>Version 2.0</h1>
License
Smart Prestashop Blog is released under GPLv3 - http://www.gnu.org/copyleft/gpl.html. You are free to redistribute & modify copies of the plugin under the following conditions:
All links & credits must be kept intact
For commercial usage (e.g in themes you're selling on any marketplace, or a commercial website), you are strongly recommended to link back to my Themeforest Profile Page using the following text: Smart Prestashop Blog by Smartdatasoft
<h1>Contacts</h1>
Twitter: http://twitter.com/smartdatasoft
Website: http://smartdatasoft.com
addons.prestashop.com : http://addons.prestashop.com/en/69_smartdatasoft
ThemeForest : http://themeforest.net/user/smartdatasoft/portfolio
Codecanyon : codecanyon.net/user/smartdatasoft/portfolio
|
smartdatasoft/PrestaShop-Blog
|
README.md
|
Markdown
|
gpl-3.0
| 876
|
// This file is part of LEDStick_TFT.
//
// LEDStick_TFT is free software : you can redistribute it and / or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// LEDStick_TFT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with LEDStick_TFT.If not, see <http://www.gnu.org/licenses/>.
#include "RGBController.h"
#include "RGBBitmap.h"
#define RGB_SCALE 10
void RGBController::create_interface_components(StickHardware hardware, uint32_t x, uint32_t y)
{
m_hardware = hardware;
m_xmin = x;
m_xmax = (COLOR_PICKER_WIDTH * RGB_SCALE) + x;
m_ymin = y;
m_ymax = (COLOR_PICKER_HEIGHT * RGB_SCALE) + y;
hardware.pTft->drawBitmap(x, y, COLOR_PICKER_WIDTH, COLOR_PICKER_HEIGHT, (unsigned int*)color_picker_bmp, RGB_SCALE);
}
void RGBController::check_point(uint32_t x, uint32_t y, RGB &rgb, boolean has_changed)
{
if (x < m_xmin || y < m_ymin || x > m_xmax || y > m_ymax)
{
has_changed = false;
return;
}
m_hardware.pTft->setColor(255, 0, 0);
uint32_t point_in_bitmap_x = (x - m_xmin) / RGB_SCALE;
uint32_t point_in_bitmap_y = (y - m_ymin) / RGB_SCALE;
uint32_t color = pgm_read_word(color_picker_bmp + (point_in_bitmap_y * COLOR_PICKER_WIDTH) + point_in_bitmap_x);
rgb.red = ((((color >> 11) & 0x1F) * 527) + 23) >> 6;
rgb.green = ((((color >> 5) & 0x3F) * 259) + 33) >> 6;
rgb.blue = (((color & 0x1F) * 527) + 23) >> 6;
has_changed = true;
}
|
dipsylala/LEDStick_TFT
|
RGBController.cpp
|
C++
|
gpl-3.0
| 1,772
|
package GUI;
import Logic.AI;
import Logic.Board;
import Logic.Player;
import Logic.SpecialCoord;
import Pieces.Coordinate;
import Pieces.MasterPiece;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.SnapshotParameters;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.PixelReader;
import javafx.scene.image.WritableImage;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Modality;
import javafx.stage.Stage;
import sun.java2d.loops.GraphicsPrimitive;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.Exchanger;
/***
* Controller Class
* This class is responsible for managing the logic behind the GUI.
* Intensive logic processes should be run in a separate thread as they will cause the GUI to freeze.
*
* @author Patrick Shinn
* @version 10/28/16
*/
public class Controller {
// FXML Objects
@FXML
Label statusLbl = new Label();
@FXML
Pane gamePane = new Pane();
@FXML
Button undoButton = new Button();
@FXML
Button redoButton = new Button();
@FXML
ImageView boardStateView = new ImageView();
@FXML
Label stateLbl = new Label();
@FXML
Canvas canvas = new Canvas();
// Board Shit and such
private Board board; // the board for the game.
private GraphicsContext graphics; // for drawing
private boolean clicked = false;
private boolean game = false;
private Coordinate[] currentMoveSet = null; // for making moves
private Coordinate currentPiece = null; // for making moves
private Stack<Board> undoBoard = new Stack<>(); // undo, redo stacks
private Stack<Image> undoImage = new Stack<>();
private Stack<Board> redoBoard = new Stack<>();
private Stack<Image> redoImage = new Stack<>();
private String boardTheme = "RedBrown"; // theme info
private String tableImage = "wooden";
private String pieceTheme = "default";
private boolean AI = false; // AI info
private int oldMouseX = 0;
private int oldMouseY = 0;
// pieces
private Image whitePawn = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whitePawn.png"));
private Image whiteKnight = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whiteKnight.png"));
private Image whiteRook = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whiteRook.png"));
private Image whiteBishop = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whiteBishop.png"));
private Image whiteQueen = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whiteQueen.png"));
private Image whiteKing = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/whiteKing.png"));
private Image blackPawn = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackPawn.png"));
private Image blackKnight = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackKnight.png"));
private Image blackRook = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackRook.png"));
private Image blackBishop = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackBishop.png"));
private Image blackQueen = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackQueen.png"));
private Image blackKing = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/blackKing.png"));
// this will initialize the change listeners and such at when the game is started.
public void initialize() {
try { // try to apply the users settings from the last game.
Scanner settingsReader = new Scanner(new File("Settings.txt"));
boardTheme = settingsReader.nextLine(); // read the first line of the settings file and apply it to the board theme
tableImage = settingsReader.nextLine(); // second line is the table image
pieceTheme = settingsReader.nextLine(); // third is piece theme.
settingsReader.close();
}catch (FileNotFoundException e){
// ignore, the game has never been played before or the default settings have never been changed.
}
// update the status label
statusLbl.setText("No game.");
// get the ability to draw on it
graphics = canvas.getGraphicsContext2D();
// painting on the table top and the empty board.
Image table = new Image(getClass().getResourceAsStream("/Graphics/Images/Tables/"+tableImage+"TableTop.png"));
graphics.drawImage(table, 0, 0); // draws from the top part of the canvas.
freshBoard();
}
// settings dialogue
public void settings() {
new SettingsWindow();
}
// shows the instructions on how to play
public void info(){new DirectionsWindow();}
// opens the about dialogue
public void about() {
new AboutWindow("About", "Wahjudi’s Highly Advanced Chess", "1.0",
"This is an insane version of chess!", "Can't Trump This", "https://github.com/shinn16/Chess");
}
// creates a new game
public void newGame() {
new NewGameWindow();
}
// undo the last move.
public void undo() {
// this stuff is heavily try catched so the popping of one does not interfere with the other.
if (!undoBoard.empty() && AI) { // if we are playing against an AI and the stack is not empty
try {
redoBoard.push(board.copyOf()); // skips the AI turn
board = undoBoard.pop(); // gets the last state of the board
} catch (Exception e) { // ignore
}
try {
redoImage.push(boardStateView.getImage());
boardStateView.setImage(undoImage.pop());
boardStateView.autosize();
} catch (Exception e) { // ignore
}
freshBoard();
drawPieces();
redoButton.setDisable(false);
if (undoBoard.empty()) undoButton.setDisable(true); // if we have emptied the stack, disable undo
// correcting the turn if we need to.
int correctTurn = 0;
for (Player player: board.getPlayers()){
if (!player.getType().equals("AI")) board.setTurnCounter(correctTurn);
else correctTurn ++;
}
}else{ // we disable the buttons
undoButton.setDisable(true);
redoButton.setDisable(true);
}
}
// redo the last move
public void redo(){
if (!redoBoard.empty() && AI) {
try {
undoBoard.push(board.copyOf()); // pushing current board then skipping AI moves
board = redoBoard.pop(); // gets the last state of the board
} catch (Exception e) { // ignore
}
try {
undoImage.push(redoImage.peek());
boardStateView.setImage(redoImage.pop()); // sets the old state image
boardStateView.autosize();
} catch (Exception e) { // ignore
}
freshBoard();
drawPieces();
undoButton.setDisable(false);
if (redoBoard.empty()) redoButton.setDisable(true);
// correcting the turn if we need to.
int correctTurn = 0;
for (Player player: board.getPlayers()){
if (!player.getType().equals("AI")) board.setTurnCounter(correctTurn);
else correctTurn ++;
}
}else redoButton.setDisable(true);
}
// draws the background table
private void drawTable(){
graphics.drawImage(new Image(getClass().getResourceAsStream("/Graphics/Images/Tables/"+tableImage+"TableTop.png")), 0, 0);
}
// redraws board
private void freshBoard(){
// draw the new board for the new game.
graphics.setStroke(Color.BLACK); // settings up to draw a black border for the board.
graphics.setLineWidth(5); // sets the weight of the line for the border
graphics.strokeRect(150, 50, 500, 500); // draws rectangle
if (boardTheme.equals("glass")){
graphics.setGlobalAlpha(.60); // reduce the opacity if we are painting on the glass.
drawTable(); // redraw the table on top so we don't lose our opacity due to us drawing over it multiple times.
}
// draws the board.
for (int y = 0; y < 5; y ++){ // for the y
for (int x = 0; x < 5; x ++){ // for the x
if ((x+y)%2 == 0){ // tells us which images to use for this spot on the board.
graphics.drawImage(new Image(getClass().getResourceAsStream("/Graphics/Images/"+boardTheme+"/blackSpot.png")), (x * 100) + 150, (y * 100) +50); // draws a 100X100 black spot centered
}else {
graphics.drawImage(new Image(getClass().getResourceAsStream("/Graphics/Images/"+boardTheme+"/whiteSpot.png")), (x * 100) + 150, (y * 100) + 50); // draws a 100X100 white spot centered
}
}
}
graphics.setGlobalAlpha(1);
graphics.setStroke(Color.AQUA); // new highlight color
graphics.setLineWidth(2); // new line width.
}
// redraws pieces
private void drawPieces(){
// draw the pieces on the board
// black side
if (game){ // if there is a game on, we will draw the pieces at their given coordinates.
for (Player player: board.getPlayers()){
for (MasterPiece[] row: board.getBoard()){
for (MasterPiece piece: row){
if (piece != null){
if (piece.getPlayerID() == 0){
try {
if (piece.toString().contains("King")) graphics.drawImage(blackKing, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 -50);
else if (piece.toString().contains("Queen")) graphics.drawImage(blackQueen, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 -50);
else if (piece.toString().contains("Rook")) graphics.drawImage(blackRook, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 - 50);
else if (piece.toString().contains("Knight")) graphics.drawImage(blackKnight, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 -50);
else if (piece.toString().contains("Bishop")) graphics.drawImage(blackBishop, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 - 50);
else if (piece.toString().contains("Pawn")) graphics.drawImage(blackPawn, (piece.getCoords().getX() + 1) * 100 + 50, (piece.getCoords().getY() + 1) * 100 - 50);
}catch (NullPointerException e) { // ignore
}
}else {
try{
if (piece.toString().contains("King"))graphics.drawImage(whiteKing, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
else if (piece.toString().contains("Queen")) graphics.drawImage(whiteQueen, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
else if (piece.toString().contains("Rook")) graphics.drawImage(whiteRook, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
else if (piece.toString().contains("Knight")) graphics.drawImage(whiteKnight, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
else if (piece.toString().contains("Bishop")) graphics.drawImage(whiteBishop, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
else if (piece.toString().contains("Pawn")) graphics.drawImage(whitePawn, (piece.getCoords().getX() + 1)*100 + 50, (piece.getCoords().getY() + 1)*100 - 50);
}catch (NullPointerException e) { // ignore
}
}
}
}
}
}
}else { // fresh set of pieces
graphics.drawImage(blackKing, 150, 50);
graphics.drawImage(blackQueen, 250, 50);
graphics.drawImage(blackBishop, 350, 50);
graphics.drawImage(blackKnight, 450, 50);
graphics.drawImage(blackRook, 550, 50);
for (int i = 1; i < 6; i++) graphics.drawImage(blackPawn, i * 100 + 50, 150);
// white side
graphics.drawImage(whiteRook, 150, 450);
graphics.drawImage(whiteKnight, 250, 450);
graphics.drawImage(whiteBishop, 350, 450);
graphics.drawImage(whiteQueen, 450, 450);
graphics.drawImage(whiteKing, 550, 450);
for (int i = 1; i < 6; i++) graphics.drawImage(whitePawn, i * 100 + 50, 350);
// reset the stroke color to be used for highlighting.
graphics.setStroke(Color.AQUA);
}
}
// updates the side pane image
private void updateLastMoveImage(){
//takes a snap shot to be used as last state image
WritableImage state = new WritableImage(700, 700);
state = canvas.snapshot(new SnapshotParameters(), state);
// cropping state
PixelReader reader =state.getPixelReader();
WritableImage currentState = new WritableImage(reader, 150, 50, 500, 500);
// shrinking image and displaying it, and adding it to the stack for undo
if (game) {
if (!board.getCurrentPlayer().getType().equals("AI"))undoImage.push(currentState);
boardStateView.setImage(currentState);
boardStateView.autosize();
}
}
// checks for winners
private void checkWinner(){
if (!board.gameOver()) {
String winner = null;
Image winnerKing = null;
// this portion determines the winner
int whitePlayerPieces = 0;
int blackPlayerPieces = 0;
for (MasterPiece[] row: board.getBoard()){
for (MasterPiece piece: row){
if (piece != null){
if (piece.getPlayerID() == 0) whitePlayerPieces ++;
else blackPlayerPieces ++;
}
}
}
if (whitePlayerPieces < blackPlayerPieces){
winner = "Black wins!";
winnerKing = blackKing;
}
else if (whitePlayerPieces > blackPlayerPieces){
winner = "White wins!";
winnerKing = whiteKing;
}
else{
winner = "Draw!";
winnerKing = new Image(getClass().getResourceAsStream("/Graphics/Images/"+pieceTheme+"/draw.png"));
}
new EndOfGameWindow(winner, winnerKing);
statusLbl.setText("Game over.");
board.setLocked(true);
game = false;
redoButton.setDisable(true);
undoButton.setDisable(true);
} else {
if (board.getCurrentPlayer().getPlayerNumber() == 0) statusLbl.setText("White's Turn");
else statusLbl.setText("Black's turn.");
if (AI) undoButton.setDisable(false);
board.nextTurn(); // advances to the next turn.
// now we check to see if the next turn is an AI, if so, let it run
AICheck();
}
}
// checks to see if an AI call is needed
private void AICheck(){
if (board.gameOver()){ // if we are still playing a game.
if (board.getCurrentPlayer().getType().equals("AI")){
board.setLocked(true); // locks the board so the user can't touch it.
for (Player player: board.getPlayers()){ // this will invert the players so the AI plays with the correct player
if (!player.equals(board.getCurrentPlayer())) new AIThread(player, board).run();
}
}
}
}
// gets the current mouse location
public void getMouseHover(MouseEvent event) {
try {
if (game){ // if we are currently in a game
int mouse_x = (int) event.getSceneX();
int mouse_y = (int) event.getSceneY();
// this will give us the index of the board position.
mouse_x = (mouse_x - 50) / 100 - 1;
mouse_y = (mouse_y + 20) / 100 - 1;
if (!board.isLocked()){ // if the board is not locked
if (!clicked) { // if the user has not already selected a piece to play with
if (board.getPiece(mouse_y, mouse_x).getPlayerID() == board.getTurnCounter() &&
mouse_x == oldMouseX && mouse_y == oldMouseY){ // if the current piece belongs to the player and this is the most recent spot we have been to
graphics.strokeRect((mouse_x + 1) * 100 + 52, (mouse_y + 1) * 100 - 48, 98, 98);// highlight the piece tile in blue
}else {
oldMouseX = mouse_x;
oldMouseY = mouse_y;
freshBoard();
drawPieces();
}
}
}
}
}catch (Exception e){
// ignore
}
}
//gets the current location of the mouse click and does the appropriate actions
public void getMouseClick(MouseEvent event) {
try {
int mouse_x = (int) event.getSceneX();
int mouse_y = (int) event.getSceneY();
// this will give us the index of the board position.
mouse_x = (mouse_x - 50) / 100 - 1;
mouse_y = (mouse_y + 20) / 100 - 1;
// now we try to get a piece at these coordinates.
// ensures we are on the board, otherwise resets all graphics in current state.
if (board.isLocked())
new WarningWindow("Game Over!", "The game is over or the AI is thinking, either make a \nnew game or be patient.");
else {
if (mouse_x < 0 || mouse_y < 0 || mouse_x > 4 || mouse_y > 4) {
if (game) {
freshBoard();
drawPieces();
}
if (clicked) undoBoard.pop();
clicked = false;
currentMoveSet = null;
currentPiece = null;
}else if (clicked && currentPiece.equals(new Coordinate(mouse_x, mouse_y))){ // for some reason this case needs to appear. Logically it shouldn't, but this is a quick fix.
clicked = false;
freshBoard(); // update the board.
drawPieces();
}else if (clicked) { // if we have already selected a piece
if (currentMoveSet.length == 0) { // if we have no moves, clear the board of move options.
clicked = false;
freshBoard();
drawPieces();
} else {
for (Coordinate move : currentMoveSet) {
if (mouse_x == move.getX() && mouse_y == move.getY()) { // if the current click is in the move set, make the move.
if (board.getPiece(move.getY(), move.getX()) != null) { // if there is an enemy piece at this point
int pieceAttacked = board.getPiece(move.getY(), move.getX()).getArrayIndex(); // gets the index of the piece
board.getPlayers()[board.getTurnCounter()].capturePiece(pieceAttacked); // remove the piece from the opponents list of pieces
}
board.makeMove(board.getPiece(currentPiece.getY(), currentPiece.getX()), mouse_y, mouse_x); // move the piece
redoBoard = new Stack<>(); // dump the redo stack
redoImage = new Stack<>(); // dump the redo images
redoButton.setDisable(true); // disable the redo button because the stack is now empty
updateLastMoveImage();
freshBoard(); // update the board.
drawPieces();
clicked = false; // reset click
checkWinner();
} else { // else, clear the stuff.
clicked = false;
freshBoard();
drawPieces();
}
}
}
// if we have not already selected a piece and there is a piece at the current position, we also enforce turns here.
} else if (board.getPiece(mouse_y, mouse_x) != null && board.getTurnCounter() == board.getPiece(mouse_y, mouse_x).getPlayerID()) { // if we have picked a piece of the current player.
graphics.strokeRect((mouse_x + 1) * 100 + 52, (mouse_y + 1) * 100 - 48, 98, 98);// highlight the piece tile in blue
if (board.hasAttack()) { // if the current player has an attack
if (board.getPiece(mouse_y, mouse_x).hasAttack(board)) { // if the selected piece has an attack
currentPiece = board.getPiece(mouse_y, mouse_x).getCoords(); // store this piece for the next run
currentMoveSet = board.getPiece(mouse_y, mouse_x).getMoves(board); // store the moveset for the next run
for (Coordinate coordinate : currentMoveSet) { //for every move in the move set, highlight the spots.
graphics.setStroke(Color.RED);
graphics.strokeRect((coordinate.getX() + 1) * 100 + 52, (coordinate.getY() + 1) * 100 - 48, 96, 96);
}
}
} else { // if there are no attacks to be made, so any piece can move
currentPiece = board.getPiece(mouse_y, mouse_x).getCoords(); // store this piece for the next run
currentMoveSet = board.getPiece(mouse_y, mouse_x).getMoves(board); // store the moveset for the next run
for (Coordinate coordinate : currentMoveSet) { //for every move in the move set, highlight the spots.
// highlight it yellow.
graphics.setStroke(Color.YELLOW); // set to yellow to highlight the moves
graphics.strokeRect((coordinate.getX() + 1) * 100 + 52, (coordinate.getY() + 1) * 100 - 48, 96, 96);
}
}
graphics.setStroke(Color.AQUA); // reset color
undoBoard.push(board.copyOf());
clicked = true; // we have clicked a piece
}
}
}catch (NullPointerException e){
// ignore
}
}
// ------------------------------ Private internal classes ------------------------------
private class AboutWindow {
private String windowName,
developer,
version,
appName,
website,
aboutApp;
private Stage window;
private AboutWindow(String windowName, String appName,
String version, String aboutApp,
String developer, String website) {
this.windowName = windowName;
this.appName = appName;
this.version = version;
this.aboutApp = aboutApp;
this.developer = developer;
this.website = website;
display();
}
private void display() {
// Stage setup
window = new Stage();
window.setTitle(windowName);
window.initModality(Modality.APPLICATION_MODAL); // means that while this window is open, you can't interact with the main program.
// buttons
Button closeBtn = new Button("Close");
closeBtn.setOnAction(e -> window.close());
// Labels
Label appNameLabel = new Label(appName);
Label websiteLabel = new Label("Website: " + website);
Label aboutAppLabel = new Label(aboutApp);
aboutAppLabel.setAlignment(Pos.CENTER);
Label developerLabel = new Label("Developers: " + developer);
Label versionLabel = new Label("Version: " + version);
// Images
ImageView imageView = new ImageView(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png")));
// Layout type
VBox layout = new VBox(10);
HBox closeBox = new HBox();
closeBox.getChildren().addAll(closeBtn);
closeBox.setAlignment(Pos.CENTER_RIGHT);
closeBox.setPadding(new Insets(5, 5, 5, 5));
layout.getChildren().addAll(imageView, appNameLabel, developerLabel, versionLabel, aboutAppLabel, websiteLabel, closeBox);
layout.setAlignment(Pos.CENTER);
// Building scene and displaying.
Scene scene = new Scene(layout);
scene.getStylesheets().addAll("/Graphics/CSS/StyleSheet.css");
window.setScene(scene);
window.setHeight(400);
window.setWidth(550);
window.setResizable(false);
window.getIcons().add(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png")));
window.show();
}
}
private class WarningWindow { // a warning window for when the user does something wrong.
private String windowTitle;
private String warning;
WarningWindow(String windowTitle, String warning) {
this.windowTitle = windowTitle;
this.warning = warning;
display();
}
private void display() {
// displays the window
Stage window = new Stage();
window.setTitle(windowTitle);
window.initModality(Modality.APPLICATION_MODAL); // means that while this window is open, you can't interact with the main program.
// buttons
Button closeBtn = new Button("Close");
closeBtn.setOnAction(e -> window.close());
// labels
Label warningLabel = new Label(warning);
// images
ImageView warningImage = new ImageView(new Image(getClass().getResourceAsStream("/Graphics/Images/warning.png")));
// Building the window
VBox layout = new VBox(10);
HBox closeBox = new HBox();
closeBox.getChildren().addAll(closeBtn);
closeBox.setAlignment(Pos.CENTER_RIGHT);
closeBox.setPadding(new Insets(5, 5, 5, 5));
HBox hBox = new HBox(10);
hBox.getChildren().addAll(warningImage, warningLabel);
hBox.setAlignment(Pos.CENTER);
layout.getChildren().addAll(hBox, closeBox);
layout.setAlignment(Pos.CENTER);
// Showing the window
Scene scene = new Scene(layout);
scene.getStylesheets().addAll("Graphics/CSS/StyleSheet.css");
window.setScene(scene);
window.setHeight(200.00);
window.setWidth(550.00);
window.getIcons().add(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png")));
window.show();
}
}
private class NewGameWindow {
private Stage primaryStage = new Stage();
private Button playBtn = new Button("Play");
private Button closeBtn = new Button("Cancel");
private Label whiteLbl = new Label("White");
private Label blackLbl = new Label("Black");
private ComboBox<String> whiteOptions = new ComboBox<>();
private ComboBox<String> blackOptions = new ComboBox<>();
private ComboBox<String> firstPlayer = new ComboBox<>();
private Label goesFirst = new Label("Goes First");
private NewGameWindow() {
statusLbl.setText("Setting up new game.");
display();
}
private void display() { // builds and displays the window.
// setting up the buttons
closeBtn.setOnAction(e -> cancelMethod());
playBtn.setOnAction(e -> playBtnMethod());
//settings up player options
whiteOptions.getItems().addAll("Human", "AI");
blackOptions.getItems().addAll("Human", "AI");
firstPlayer.getItems().addAll("White" , "Black");
firstPlayer.setValue("White");
// layout setup
VBox layout = new VBox(10);
// white options section
HBox whiteSection = new HBox(10);
whiteOptions.setValue("None"); // value
whiteSection.getChildren().addAll(whiteLbl, whiteOptions);
whiteSection.setAlignment(Pos.CENTER);
// black section options
HBox blackSection = new HBox(10);
blackOptions.setValue("None"); // initial value
blackSection.getChildren().addAll(blackLbl, blackOptions);
blackSection.setAlignment(Pos.CENTER);
// button section
HBox buttonsSection = new HBox(10);
buttonsSection.setAlignment(Pos.CENTER_RIGHT);
buttonsSection.getChildren().addAll(closeBtn, playBtn);
buttonsSection.setPadding(new Insets(5, 5, 5, 5)); // setting spacing around the Hbox
// building main layout
layout.getChildren().addAll(whiteSection, blackSection, goesFirst, firstPlayer, buttonsSection);
layout.setAlignment(Pos.CENTER);
// building window
Scene scene = new Scene(layout);
scene.getStylesheets().addAll("/Graphics/CSS/StyleSheet.css"); // sets the style sheet.
primaryStage.setScene(scene);
primaryStage.setTitle("New Game");
primaryStage.initModality(Modality.APPLICATION_MODAL); // sets the window to be modal, meaning the underlying window cannot be used until this one is closed.
primaryStage.setWidth(245);
primaryStage.setHeight(210);
primaryStage.setResizable(false); // this window cannot be resized.
primaryStage.show(); // displays the window
}
private void cancelMethod(){
primaryStage.close();
statusLbl.setText("No game.");
}
private void playBtnMethod() {
String playerOneType = whiteOptions.getValue();
String playerTwoType = blackOptions.getValue();
if (playerOneType.equals("None") || playerTwoType.equals("None"))// if the player failed to set one of the players properly
new WarningWindow("Looks like there is something wrong with your settings...", "You have to apply settings for both players!");
else { // if the player has set up the right options for the game
stateLbl.setOpacity(1); // makes this visible
Player white = new Player(playerTwoType, 0); // set the player types
Player black = new Player(playerOneType, 1);
board = new Board(white, black); // set the board up with white going first.
if (firstPlayer.getValue().equals("White")) statusLbl.setText("White's turn."); // sets the status label to who's turn it is
else {
board.setTurnCounter(0);
statusLbl.setText("Black's turn.");
}
// dump the stacks from last run
undoBoard = new Stack<>();
undoImage = new Stack<>();
redoBoard = new Stack<>();
redoImage = new Stack<>();
game = true; // we are now playing a game.
freshBoard(); // draw board and pieces, then update last board state
drawPieces();
updateLastMoveImage();
if ((playerOneType.equals("AI") || playerTwoType.equals("AI")) && (!(playerOneType.equals("AI") && playerTwoType.equals("AI")))) AI = true;
AICheck();
primaryStage.close();
}
}
}
private class EndOfGameWindow {
private double width = 400;
private Stage primaryStage = new Stage();
private Label messageLabel = new Label();
private Button okayButton = new Button("Okay");
private Image fireworks = new Image(getClass().getResourceAsStream("/Graphics/Images/fireworks.gif"));
private ImageView leftWorks = new ImageView(fireworks);
private ImageView rightWorks = new ImageView(fireworks);
private ImageView winnerKingView = new ImageView();
private EndOfGameWindow(String message, Image winnerKing) {
winnerKingView.setImage(winnerKing);
messageLabel.setText(message);
okayButton.setOnAction(e -> primaryStage.close());
if (message.equals("Draw!"))width = 500; // we need a bigger window to accommodate the draw image.
// vbox
VBox vertical = new VBox(20);
vertical.getChildren().addAll(winnerKingView, messageLabel, okayButton);
vertical.setPadding(new Insets(5, 5, 5, 5));
vertical.setAlignment(Pos.CENTER);
// main layout
HBox layout = new HBox(5);
layout.getChildren().addAll(leftWorks, vertical, rightWorks);
layout.setAlignment(Pos.CENTER);
Scene scene = new Scene(layout);
scene.getStylesheets().addAll("/Graphics/CSS/StyleSheet.css");
primaryStage.setScene(scene);
primaryStage.initModality(Modality.APPLICATION_MODAL); // sets the window to be modal, meaning the underlying window cannot be used until this one is closed.
primaryStage.setWidth(width);
primaryStage.setHeight(250);
primaryStage.setResizable(false); // this window cannot be resized.\
primaryStage.setTitle("End of Game"); // window title
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png"))); // window icon
primaryStage.show(); // displays the window
}
}
private class SettingsWindow {
private Stage primaryStage = new Stage(); // stages are basically windows
private ComboBox<String> tableThemes = new ComboBox<>(); // allows the user to pick the theme of choice
private ComboBox<String> boardThemes = new ComboBox<>();
private Label tableLabel = new Label("Table Themes");
private Label boardLabel = new Label("Board Themes");
private Button closeBtn = new Button("Close");
SettingsWindow(){
display();
}
private void display(){
// sets the action for the button (close the window)
closeBtn.setOnAction(e -> primaryStage.close());
closeBtn.setPadding(new Insets(2, 5, 5 ,5));
// adding objects to the comboBoxs, setting action of the box.
tableThemes.getItems().addAll("wooden", "marble", "space", "secret"); // add all elements of the box here :)
boardThemes.getItems().addAll("Grey and White", "Red and Brown", "Glass");
// setting up tableTheme box
tableThemes.setValue(tableImage); // sets the current value to the currently selected theme.
tableThemes.setPrefSize(125, 25);
tableThemes.setOnAction(event -> tableThemeMethod());
// setting up boardTheme board
if (boardTheme.equals("RedBrown")) boardThemes.setValue("Red and Brown");
else if (boardTheme.equals("default"))boardThemes.setValue("Grey and White");
else boardThemes.setValue("Glass");
boardThemes.setPrefSize(125, 25);
boardThemes.setOnAction(e -> boardThemeMethod());
// building the layout of the scene
VBox layout = new VBox(25); // main layout, will contain the others
// sub layouts for object placement
HBox labels = new HBox(23);
labels.getChildren().addAll(tableLabel, boardLabel);
labels.setAlignment(Pos.CENTER);
HBox combos = new HBox(10);
combos.getChildren().addAll(tableThemes, boardThemes);
combos.setAlignment(Pos.CENTER);
// building the layout
layout.getChildren().addAll(labels, combos, closeBtn);
layout.setAlignment(Pos.CENTER);
layout.setMargin(labels, new Insets(0,0,0 -20,0));
// building and displaying the window (primaryStage)
Scene scene = new Scene(layout);
scene.getStylesheets().addAll("/Graphics/CSS/StyleSheet.css");
primaryStage.setScene(scene);
primaryStage.initModality(Modality.APPLICATION_MODAL); // sets the window to be modal, meaning the underlying window cannot be used until this one is closed.
primaryStage.setWidth(300);
primaryStage.setHeight(200);
primaryStage.setResizable(false); // this window cannot be resized.\
primaryStage.setTitle("Settings"); // window title
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png"))); // window icon
primaryStage.show(); // displays the window
}
private void tableThemeMethod(){ // updates the table value, then redraws board.
tableImage = tableThemes.getValue();
System.out.println();
drawTable();
freshBoard();
if (game) drawPieces(); // if there is a game on, draw the pieces.
try { // save the user's settings
PrintWriter settingsWriter = new PrintWriter(new File("Settings.txt"));
settingsWriter.print(boardTheme + "\n" + tableImage + "\n" + pieceTheme);
settingsWriter.close();
}catch (FileNotFoundException e) { // ignore
}
}
private void boardThemeMethod(){
if (boardThemes.getValue().equals("Red and Brown")) boardTheme = "RedBrown";
else if (boardThemes.getValue().equals("Grey and White"))boardTheme = "default";
else boardTheme = "glass";
drawTable();
freshBoard();
if (game) drawPieces();
updateLastMoveImage();
try { // save the user's settings
PrintWriter settingsWriter = new PrintWriter(new File("Settings.txt"));
settingsWriter.print(boardTheme + "\n" + tableImage + "\n" + pieceTheme);
settingsWriter.close();
}catch (FileNotFoundException e) { // ignore
}
}
}
private class DirectionsWindow{
private Stage primaryStage = new Stage();
private Button closeButton = new Button("Close");
private VBox layout = new VBox(10);
private Label howTOPlay = new Label("How to Play");
private Text text = new Text();
private DirectionsWindow(){
display();
text.setText("This game is pretty much chess, but turned inside out... the rules are as follows:\n" +
"1. The board size is now 5 x 5.\n" +
"2. Each player will have five pawns, a rook, a knight, a bishop, a queen and a king.\n" +
"\t Piece movements are the same as the are in normal chess except the pawn can only advance one square at a time.\n" +
"3. Each chess piece follows the same movement/pattern as regular chess.\n" +
"4. Capturing is compulsory. When more than one capture is available, the player may choose.\n" +
"5. The king has no royal power and accordingly:\n" +
"\tIt may be captured like any other piece.\n" +
"\tThere is no check or checkmate.\n" +
"\tThere is no castling.\n" +
"6. A pawn will be promoted to a King when it reached the other side of the board.\n" +
"7. A player wins by losing all his pieces\n" +
"8. If a player cannot make a move, the winner is the player with the least number of piece (regardless of the piece).\n" +
"9. The game is also a stalemate when a win is impossible\n" +
"\tA player cannot make a move and there is the same number of piece for both players.\n" +
"10. The side to make the first move is determined prior to the start of a game.\n\n" +
"Board Rules:\n" +
"Undo and Redo buttons can only be used if you play against the AI. If someone outsmarts you in one on one,\n" +
" you don't deserve a redo :P.\n\n" +
"Final Thoughts: Enjoy the game! :)");
text.setFont(Font.font("Arial"));
}
private void display(){
// setting up close button function
closeButton.setOnAction(e -> primaryStage.close());
// building the layout
layout.getChildren().addAll(howTOPlay, text, closeButton);
layout.setAlignment(Pos.CENTER);
//setting up the window
Scene scene = new Scene(layout);
primaryStage.setScene(scene);
primaryStage.setTitle("Learn to Play!");
primaryStage.getIcons().addAll(new Image(getClass().getResourceAsStream("/Graphics/Images/App.png")));
primaryStage.setResizable(false);
primaryStage.setWidth(800);
primaryStage.setHeight(500);
primaryStage.show();
}
}
// ------------------------------ Threading classes -------------------------------------
private class AIThread implements Runnable{
private AI watson;
private AIThread(Player player, Board board){
this.watson = new AI(player, board);
Thread Watson = Thread.currentThread();
Watson.setName("AI Thread"); // Names this thead
}
@Override
public void run() {
SpecialCoord specialCoord = watson.play(board);
Platform.runLater(new Runnable() { // this will run the needed operations in the FX thread.
@Override
public void run() {
board.setLocked(false); // after the AI plays, unlock the board so the player can play
// updating the graphic elements
if (specialCoord == null) checkWinner();
else {
// now we highlight the piece at its move for the last state image
graphics.strokeRect((specialCoord.getPiece().getCoords().getX() + 1) * 100 + 52, (specialCoord.getPiece().getCoords().getY() + 1) * 100 - 48, 98, 98);// highlight the piece tile in blue
if (board.getPiece(specialCoord.getY(), specialCoord.getX()) == null){ // if the space we are going to is empty
graphics.setStroke(Color.YELLOW);
graphics.strokeRect((specialCoord.getX() + 1) * 100 + 52, (specialCoord.getY() + 1) * 100 - 48, 98, 98);// highlight the move yellow
}else{ // if the space we are going to is an attack
graphics.setStroke(Color.RED);
graphics.strokeRect((specialCoord.getX() + 1) * 100 + 52, (specialCoord.getY() + 1) * 100 - 48, 98, 98);// highlight the move red
}
graphics.setStroke(Color.AQUA); // reset color for next piece highlighting
board.makeMove(board.getPiece(specialCoord.getPiece().getCoords().getY(), specialCoord.getPiece().getCoords().getX()), specialCoord.getY(), specialCoord.getX());
updateLastMoveImage();
freshBoard();
drawPieces();
checkWinner();
if (board.getCurrentPlayer().getPlayerNumber() == 0) statusLbl.setText("Black's Turn");
else statusLbl.setText("White's turn.");
}
}
});
}
}
}
|
shinn16/Chess
|
src/GUI/Controller.java
|
Java
|
gpl-3.0
| 46,008
|
class A { def m() { var x = y } }
object Main { def main(args: Array[String]) { } }
|
tobast/compil-petitscala
|
tests/typing/bad/testfile-unbound_var-1.scala
|
Scala
|
gpl-3.0
| 84
|
/*
* Copyright 2016 Nathan Howard
*
* This file is part of OpenGrave
*
* OpenGrave is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenGrave is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenGrave. If not, see <http://www.gnu.org/licenses/>.
*/
package com.opengrave.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.UUID;
import com.opengrave.common.inventory.ItemMaterial;
import com.opengrave.common.inventory.ItemType;
import com.opengrave.common.world.CommonObject;
import com.opengrave.common.world.CommonProcess;
import com.opengrave.common.world.CommonWorld;
import com.opengrave.common.world.ProcessProvision;
public class ModSession {
boolean loadFinished = false;
ArrayList<ItemMaterial> materialList = new ArrayList<ItemMaterial>();
ArrayList<ItemType> itemTypes = new ArrayList<ItemType>();
ArrayList<CommonWorld> worldList = new ArrayList<CommonWorld>();
ArrayList<CommonProcess> processList = new ArrayList<CommonProcess>();
HashMap<UUID, ArrayList<ProcessProvision>> processHash = new HashMap<UUID, ArrayList<ProcessProvision>>();
ObjectStorage objectList = new ObjectStorage();
public CommonProcess addProcess(String processName, ArrayList<String> vars) {
CommonProcess process = new CommonProcess(processName, vars);
synchronized (processList) {
if (!processList.contains(process)) {
processList.add(process);
}
}
return process;
}
public CommonProcess getProcess(String processName) {
synchronized (processList) {
for (CommonProcess proc : processList) {
if (proc.getProcessName().equalsIgnoreCase(processName)) {
return proc;
}
}
}
return null;
}
public void addObjectProcess(UUID id, CommonProcess proc, ArrayList<Float> vars) {
CommonObject obj = getObjectStorage().getObject(id);
if (proc == null) {
System.out.println("No process : '" + proc + "'");
return;
}
if (obj == null) {
System.out.println("No object with id " + id.toString());
return;
}
if (vars.size() != proc.getVariables().size()) {
System.out.println("Variables for process don't match.");
return;
}
synchronized (processHash) {
if (!processHash.containsKey(id)) {
processHash.put(id, new ArrayList<ProcessProvision>());
}
ProcessProvision pp = new ProcessProvision(proc, vars);
processHash.get(id).add(pp);
}
}
public ArrayList<ProcessProvision> getProcessObject(UUID id) {
ArrayList<ProcessProvision> copyList = new ArrayList<ProcessProvision>();
synchronized (processHash) {
if (processHash.containsKey(id)) {
for (ProcessProvision prov : processHash.get(id)) {
copyList.add(prov);
}
}
}
return copyList;
}
public void add(ItemMaterial im) {
if (loadFinished) {
throw new RuntimeException("Can not add new materials after mods finish loading");
}
synchronized (materialList) {
materialList.add(im);
}
}
public void add(ItemType itemType) {
if (loadFinished) {
throw new RuntimeException("Can not add new item types after mods finish loading");
}
synchronized (itemTypes) {
itemTypes.add(itemType);
}
}
public ItemType getItemType(String id) {
synchronized (itemTypes) {
for (ItemType it : itemTypes) {
if (id.equalsIgnoreCase(it.getID())) {
return it;
}
}
}
return null;
}
public ArrayList<ItemMaterial> getMaterials() {
ArrayList<ItemMaterial> nM = new ArrayList<ItemMaterial>();
synchronized (materialList) {
for (ItemMaterial iM : materialList) {
nM.add(iM);
}
}
return nM;
}
public ArrayList<ItemType> getItemTypes() {
ArrayList<ItemType> iT = new ArrayList<ItemType>();
synchronized (itemTypes) {
for (ItemType it : itemTypes) {
iT.add(it);
}
}
return iT;
}
public CommonWorld addWorld(String string) {
if (loadFinished) {
throw new RuntimeException("Can not add new worlds after mods finish loading");
}
CommonWorld world = new CommonWorld(string);
synchronized (worldList) {
worldList.add(world);
}
world.loadInThread(this);
return world;
}
public ArrayList<CommonWorld> getWorlds() {
ArrayList<CommonWorld> newList = new ArrayList<CommonWorld>();
synchronized (worldList) {
for (CommonWorld world : worldList) {
newList.add(world);
}
}
return newList;
}
public ObjectStorage getObjectStorage() {
return objectList;
}
}
|
AperiStudios/OpenGrave
|
src/main/java/com/opengrave/common/ModSession.java
|
Java
|
gpl-3.0
| 4,818
|
package net.lomeli.magiks.api.machines;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.item.ItemStack;
public class OreCrusherManager
{
private static final OreCrusherManager instance = new OreCrusherManager();
@SuppressWarnings("rawtypes")
private Map crushableOre = new HashMap();
private HashMap<List<Integer>, ItemStack> metaCrushableOre = new HashMap<List<Integer>, ItemStack>();
public static final OreCrusherManager getInstance()
{
return instance;
}
private OreCrusherManager() { }
@SuppressWarnings("unchecked")
public void addCrushRecipe(int itemID, ItemStack itemStack)
{
this.crushableOre.put(Integer.valueOf(itemID), itemStack);
}
public void addCrushRecipe(int itemID, ItemStack itemStack, int metadata)
{
this.metaCrushableOre.put(Arrays.asList(itemID, metadata), itemStack);
}
public ItemStack getCrushResult(ItemStack item)
{
if(item == null)
return null;
ItemStack ret = metaCrushableOre.get(Arrays.asList(item.itemID, item.getItemDamage()));
if(ret != null)
return ret;
return (ItemStack)crushableOre.get(Integer.valueOf(item.itemID));
}
@SuppressWarnings("rawtypes")
public Map getCrushableList()
{
return this.crushableOre;
}
}
|
Lomeli12/MechroMagiks
|
common/net/lomeli/magiks/api/machines/OreCrusherManager.java
|
Java
|
gpl-3.0
| 1,412
|
/*
* Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.b3dgs.lionheart.object.feature;
import com.b3dgs.lionengine.Animation;
import com.b3dgs.lionengine.LionEngineException;
import com.b3dgs.lionengine.Medias;
import com.b3dgs.lionengine.Mirror;
import com.b3dgs.lionengine.Tick;
import com.b3dgs.lionengine.Updatable;
import com.b3dgs.lionengine.UtilMath;
import com.b3dgs.lionengine.game.AnimationConfig;
import com.b3dgs.lionengine.game.FeatureProvider;
import com.b3dgs.lionengine.game.feature.Animatable;
import com.b3dgs.lionengine.game.feature.FeatureGet;
import com.b3dgs.lionengine.game.feature.FeatureInterface;
import com.b3dgs.lionengine.game.feature.FeatureModel;
import com.b3dgs.lionengine.game.feature.Identifiable;
import com.b3dgs.lionengine.game.feature.Mirrorable;
import com.b3dgs.lionengine.game.feature.Recyclable;
import com.b3dgs.lionengine.game.feature.Routine;
import com.b3dgs.lionengine.game.feature.Services;
import com.b3dgs.lionengine.game.feature.Setup;
import com.b3dgs.lionengine.game.feature.Spawner;
import com.b3dgs.lionengine.game.feature.Transformable;
import com.b3dgs.lionengine.game.feature.launchable.Launcher;
import com.b3dgs.lionengine.game.feature.rasterable.Rasterable;
import com.b3dgs.lionengine.graphic.engine.SourceResolutionProvider;
import com.b3dgs.lionheart.Music;
import com.b3dgs.lionheart.MusicPlayer;
import com.b3dgs.lionheart.RasterType;
import com.b3dgs.lionheart.ScreenShaker;
import com.b3dgs.lionheart.Settings;
import com.b3dgs.lionheart.WorldType;
import com.b3dgs.lionheart.constant.Anim;
import com.b3dgs.lionheart.constant.Folder;
import com.b3dgs.lionheart.landscape.ForegroundWater;
/**
* Boss Underworld feature implementation.
* <ol>
* <li>Spawn from hole.</li>
* <li>Track player horizontally.</li>
* <li>Attack player.</li>
* <li>Move down.</li>
* <li>Spawn turtles.</li>
* <li>Rise.</li>
* </ol>
*/
@FeatureInterface
public final class BossUnderworld extends FeatureModel implements Routine, Recyclable
{
private static final int SPAWN_DELAY_MS = 6_000;
private static final int ATTACK_DELAY_MS = 10_000;
private static final int DOWN_DELAY_MS = 3_000;
private static final double RAISE_SPEED = 0.5;
private static final double RAISE_MAX = -8;
private static final double RAISE_MIN = -80;
private static final double EFFECT_SPEED = 4.0;
private static final double EFFECT_AMPLITUDE = 4.0;
private final Trackable target = services.get(Trackable.class);
private final SourceResolutionProvider source = services.get(SourceResolutionProvider.class);
private final MusicPlayer music = services.get(MusicPlayer.class);
private final ScreenShaker shaker = services.get(ScreenShaker.class);
private final Spawner spawner = services.get(Spawner.class);
private final ForegroundWater water = services.get(ForegroundWater.class);
private final Tick tick = new Tick();
private final Animation idle;
private Updatable updater;
private boolean attack;
private double effectY;
@FeatureGet private Transformable transformable;
@FeatureGet private Mirrorable mirrorable;
@FeatureGet private Animatable animatable;
@FeatureGet private Launcher launcher;
@FeatureGet private Rasterable rasterable;
@FeatureGet private Identifiable identifiable;
@FeatureGet private Stats stats;
/**
* Create feature.
*
* @param services The services reference (must not be <code>null</code>).
* @param setup The setup reference (must not be <code>null</code>).
* @throws LionEngineException If invalid arguments.
*/
public BossUnderworld(Services services, Setup setup)
{
super(services, setup);
idle = AnimationConfig.imports(setup).getAnimation(Anim.IDLE);
}
/**
* Update spawn delay.
*
* @param extrp The extrapolation value.
*/
private void updateSpawn(double extrp)
{
tick.update(extrp);
if (tick.elapsedTime(source.getRate(), SPAWN_DELAY_MS))
{
updater = this::updateRaise;
shaker.start();
attack = false;
}
}
/**
* Update raise phase until max.
*
* @param extrp The extrapolation value.
*/
private void updateRaise(double extrp)
{
transformable.moveLocationY(extrp, RAISE_SPEED);
if (transformable.getY() > RAISE_MAX)
{
transformable.teleportY(RAISE_MAX);
updater = this::updateAttack;
launcher.setLevel(attack ? 2 : 1);
launcher.fire();
tick.restart();
}
}
/**
* Update attack phase.
*
* @param extrp The extrapolation value.
*/
private void updateAttack(double extrp)
{
transformable.setLocationY(RAISE_MAX + UtilMath.sin(effectY) * EFFECT_AMPLITUDE);
effectY = UtilMath.wrapAngleDouble(effectY + EFFECT_SPEED);
tick.update(extrp);
if (tick.elapsedTime(source.getRate(), ATTACK_DELAY_MS))
{
updater = this::updateMoveDown;
shaker.start();
}
}
/**
* Update move down phase.
*
* @param extrp The extrapolation value.
*/
private void updateMoveDown(double extrp)
{
transformable.moveLocationY(extrp, -RAISE_SPEED);
if (transformable.getY() < RAISE_MIN)
{
transformable.teleportY(RAISE_MIN);
updater = this::updateAttackDown;
launcher.setLevel(0);
launcher.fire();
tick.restart();
}
}
/**
* Update attack once moved down.
*
* @param extrp The extrapolation value.
*/
private void updateAttackDown(double extrp)
{
tick.update(extrp);
if (tick.elapsedTime(source.getRate(), DOWN_DELAY_MS))
{
updater = this::updateRaise;
attack = !attack;
shaker.start();
tick.restart();
}
}
/**
* Update mirror depending on player location.
*/
private void updateMirror()
{
if (transformable.getX() > target.getX())
{
mirrorable.mirror(Mirror.NONE);
}
else
{
mirrorable.mirror(Mirror.HORIZONTAL);
}
}
@Override
public void prepare(FeatureProvider provider)
{
super.prepare(provider);
if (RasterType.CACHE == Settings.getInstance().getRaster())
{
launcher.addListener(l -> l.ifIs(Underwater.class, u -> u.loadRaster("raster/underworld/underworld/")));
}
identifiable.addListener(id -> music.playMusic(Music.BOSS_WIN));
stats.addListener(new StatsListener()
{
@Override
public void notifyNextSword(int level)
{
// Nothing to do
}
@Override
public void notifyDead()
{
water.stopRaise();
spawner.spawn(Medias.create(Folder.ENTITY, WorldType.UNDERWORLD.getFolder(), "Floater3.xml"), 208, 4);
spawner.spawn(Medias.create(Folder.ENTITY, WorldType.UNDERWORLD.getFolder(), "Floater3.xml"), 240, 4);
}
});
}
@Override
public void update(double extrp)
{
updater.update(extrp);
updateMirror();
}
@Override
public void recycle()
{
updater = this::updateSpawn;
animatable.play(idle);
effectY = 0.0;
tick.restart();
}
}
|
b3dgs/lionheart-remake
|
lionheart-game/src/main/java/com/b3dgs/lionheart/object/feature/BossUnderworld.java
|
Java
|
gpl-3.0
| 8,280
|
---
title: "आईपीकेएल : पुणे की पहली हार, पांडिचेरी की तीसरी जीत"
layout: item
category: ["sports"]
date: 2019-05-24T16:44:17.515Z
image: 1558716257515ipkl.jpg
---
<p>मैसुरू: पांडिचेरी प्रीडेटर्स ने शुक्रवार को यहां खेले गए पारले इंडो इंटरनेशनल प्रीमियर कबड्डी लीग (आईपीकेएल) के पहले सीजन के दूसरे चरण के पहले दिन के पहले मुकाबले में पुणे प्राइड को 41-33 से हरा दिया। यह इस सीजन में पुणे की पहली हार है जबकि पांडिचेरी ने तीसरी जीत हासिल की है।</p>
<p>इस रोमांचक मैच में पांडिचेरी की टीम ने पहले क्वार्टर में 10-9, दूसरे में 12-6, तीसरे में 7-12 और चौथे में 12-6 से जीत हासिल की। पांडिचेरी के लिए आर. सुरेश कुमार ने सबसे अधिक 11 अंक बटोरे जबकि सोमबीर ने छह तथा सोनी ने पांच अंक जुटाए। पुणे राउंड में अपने सभी मैच जीतने वाली पुणे की टीम की ओर से शेख अब्दुल और अमरजीत ने सात-सात अंक बनाए।</p>
<p>पहला क्वार्टर काफी रोमांचक रहा। पांडिचेरी की टीम ने 10-9 की बढ़त के साथ यह क्वार्टर समाप्त किया। उसने 3-0 के साथ शुरुआत की थी लेकनि एक समय पुणे ने 8-8 की बराबरी हासिल कर ली। अगले दो अंक हालांकि पांडिचेरी के नाम रहे और इस तरह उसने पहले क्वार्टर की समाप्ति दो अंकों की बढ़ते साथ की।</p>
<p>पांडिचेरी की टीम पुणे को कोई मौका नहीं देना चाहती थी और इसी कारण उसने दूसरे क्वार्टर की शुरुआत 4-0 की बढ़त के साथ की। स्कोर 14-9 हो चुका था। यहां पांडिचेरी ने पुणे को आॅलआउट कर स्कोर 17-9 कर दिया। इसके बाद भी पांडिचेरी के कदम नहीं रुके और उसने एक के बाद एक अंक लेते हुए 21-9 की बढ़त हासिल की। </p>
<p>बड़ी देर बार पुणे को दो अंक प्राप्त हुए और स्कोर 21-11 हुआ लेकिन पांडिचेरी ने एक अंक लेते हुए स्कोर 22-11 कर दिया। पुणे की टीम भी कम नहीं थी। उसने सुपर टैकल के माध्यम से दो अंक बटोरे और स्कोर 22-13 कर दिया। इसके बाद संदीप खरब ने दो अंक दिलाते हुए पुणे का स्कोर 15-22 कर दिया।</p>
<p>पुणे ने तीसरे क्वार्टर की धमाकेदार शुरुआत की और 7-2 की बढ़त हासिल कर ली। उसने पांडिचेरी को मैच में पहली बार आॅलआउट किया और स्कोर 22-24 कर लिया। और एक समय ऐसा भी आया जब पुणे की टीम ने बेहतरीन खेल के दम पर स्कोर 27-27 कर लिया लेकिन इस क्वार्टर के अंतिम रेड में मिले दो अंकों के साथ पांडिचेरी ने 29-27 की बढ़त हासिल कर ली। इस क्वार्टर में पुणे को 12 और पांडिचेरी को पांच अंक प्राप्त हुए।</p>
<p>अंतिम क्वार्टर में पांडिचेरी ने लगातार अंक लिए और एक समय 33-28 की बढ़त बना ली। इसके बाद उसने पुणे को दूसरी बार आॅलआउट कर अपनी बढ़त को 37-28 कर लिया लेकिन इसके बाद पुणे ने दो अंक लेकर स्कोर 37-30 कर मैच में रोमांच लाने की कोशिश की लेकिन उसके तमाम प्रयासों के बावजूद पुणे को अंक मिलते रहे और 39-31 हो गया। इसके बाद अंतिम पलो में दोनों टीमों के बीच जोरदार संघर्ष हुआ लेकिन पुणे की टीम फासले को नहीं भर सकी।</p>
<p>लीग का पहला चरण पुणे में हुआ था और पुणे की टीम अपने पांच के पांच मैच जीतकर 10 मैचों के साथ जोन-ए में पहले स्थान पर रही थी। पांडिचेरी की टीम ने पांच में से दो मैच जीतकर चार अंकों के साथ तालिका में दूसरा स्थान हासिल किया। इस पूल में बेंगलोर राइनोज और हरियाणा हीरोज टीमों भी हैं। बेंगलोर की चार अंकों के साथ तीसरे और हरियाणा दो अंकों के साथ चौथे स्थान पर है।</p>
|
InstantKhabar/_source
|
_source/news/2019-05-24-ipkl.html
|
HTML
|
gpl-3.0
| 6,768
|
from setuptools import setup
setup(name="waterworks",
version="0.0.0",
description="Message agregation daemon.",
url="https://github.com/Aeva/waterworks",
author="Aeva Palecek",
author_email="aeva.ntsc@gmail.com",
license="GPLv3",
packages=["waterworks"],
zip_safe=False,
entry_points = {
"console_scripts" : [
"waterworks=waterworks.waterworks:start_daemon",
],
},
install_requires = [
])
|
Aeva/waterworks
|
setup.py
|
Python
|
gpl-3.0
| 508
|
#Written by Keith Jolley
#Copyright (c) 2014-2019, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
#
#BIGSdb is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#BIGSdb is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::REST::Routes::Users;
use strict;
use warnings;
use 5.010;
use Dancer2 appname => 'BIGSdb::REST::Interface';
use BIGSdb::Utils;
#User routes
sub setup_routes {
my $self = setting('self');
foreach my $dir ( @{ setting('api_dirs') } ) {
get "$dir/db/:db/users/:user" => sub { _get_user() };
get "$dir/db/:db/curators" => sub { _get_curators() };
}
return;
}
sub _get_user {
my $self = setting('self');
my $user_id = param('user');
if ( !BIGSdb::Utils::is_int($user_id) ) {
send_error( 'User id must be an integer.', 400 );
}
my $user = $self->{'datastore'}->get_user_info($user_id);
if ( !defined $user->{'id'} ) {
send_error( "User $user_id does not exist.", 404 );
}
my $values = {};
foreach my $field (qw(id first_name surname affiliation email)) {
#Only include E-mail for curators/admins
next
if $field eq 'email'
&& ( ( !$self->{'system'}->{'privacy'} && $user->{'status'} eq 'user' )
|| $self->{'config'}->{'rest_hide_emails'} );
$values->{$field} = $user->{$field};
}
return $values;
}
sub _get_curators {
my $self = setting('self');
my $subdir = setting('subdir');
my $db = params->{'db'};
my $curators =
$self->{'datastore'}
->run_query( 'SELECT id FROM users WHERE status=? AND id>0 ORDER BY id', 'curator', { fetch => 'col_arrayref' } );
my $values = [];
foreach my $curator_id (@$curators) {
push @$values, request->uri_for("$subdir/db/$db/users/$curator_id");
}
return {
records => int(@$values),
curators => $values
};
}
1;
|
kjolley/BIGSdb
|
lib/BIGSdb/REST/Routes/Users.pm
|
Perl
|
gpl-3.0
| 2,322
|
<!DOCTYPE html>
<html>
<head></head>
<body>
<textarea id="textbox">Type something here</textarea>
<button id="cr">Create file</button>
<a download="info.txt" id="downloadlink" style="display: none">Download</a>
<script type="text/javascript" src="./main.js"></script>
</body>
</html>
|
td0/pokehax
|
dump/index.html
|
HTML
|
gpl-3.0
| 285
|
/**
* This file is part of BP generator.
*
* BP generator is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* BP generator is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* BP generator. If not, see <http://www.gnu.org/licenses/>.
*
* @link https://github.com/dsx75/bp-gen
* @copyright (C) Dominik Smatana 2014
*/
package eu.bp.gen1.pages;
import eu.bp.data.Data;
/**
*
* @author Dominik Smatana <dominik.smatana@gmail.com>
*/
public class SkLedS2720 extends BasePage implements Page {
public SkLedS2720() {
this.url = "sk/produkty/SMD5630_LED_ziarovka_E27_tepla/";
this.language = "sk";
this.title = "SMD5630 LED žiarovka E27 (teplá biela)";
this.h1 = "SMD5630 LED žiarovka E27 (teplá biela)";
this.product = Data.createProduct(13);
}
}
|
dsx75/bp-gen
|
src/eu/bp/gen1/pages/SkLedS2720.java
|
Java
|
gpl-3.0
| 1,263
|
#!/usr/bin/env ruby
#
# This plugin provides integration with OpenVAS. Written by kost and
# averagesecurityguy.
#
# Distributed under MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
require 'socket'
require 'timeout'
require 'openssl'
require 'rexml/document'
require 'rexml/text'
require 'base64'
# OpenVASOMP module
#
# Usage: require 'openvas-omp'
module OpenVASOMP
#------------------------------
# Error Classes
#------------------------------
class OMPError < :: RuntimeError
attr_accessor :reason
def initialize(reason = '')
self.reason = reason
end
def to_s
"OpenVAS OMP: #{self.reason}"
end
end
class OMPConnectionError < OMPError
def initialize
self.reason = "Could not connect to server"
end
end
class OMPResponseError < OMPError
def initialize
self.reason = "Error in OMP request/response"
end
end
class OMPAuthError < OMPError
def initialize
self.reason = "Authentication failed"
end
end
class XMLParsingError < OMPError
def initialize
self.reason = "XML parsing failed"
end
end
#------------------------------
# Connection Class
#------------------------------
class OpenVASConnection
attr_accessor :socket, :bufsize, :debug
def initialize(host="127.0.0.1", port=9390, debug=false)
@host = host
@port = port
@socket = nil
@bufsize = 16384
@debug = debug
end
def connect
if @debug then puts "Connecting to server #{@host} on port #{@port}" end
plain_socket = TCPSocket.open(@host, @port)
ssl_context = OpenSSL::SSL::SSLContext.new()
@socket = OpenSSL::SSL::SSLSocket.new(plain_socket, ssl_context)
@socket.sync_close = true
@socket.connect
end
def disconnect
if @debug then
puts "Closing connection to server #{@host} on port #{@port}" end
if @socket then @socket.close end
end
def sendrecv(data)
# Send the data
if @debug then puts "Preparing to send data" end
if not @socket then connect end
if @debug then puts "SENDING: " + data end
@socket.puts(data)
# Receive the response
resp = ''
size = 0
begin
begin
timeout(@read_timeout) {
a = @socket.sysread(@bufsize)
size = a.length
resp << a
}
rescue Timeout::Error
size = 0
rescue EOFError
raise OMPResponseError
end
end while size >= @bufsize
if @debug then puts "RECEIVED: " + resp end
return resp
end
end
#------------------------------
# OpenVASOMP class
#------------------------------
class OpenVASOMP
# initialize object: try to connect to OpenVAS using URL, user and password
attr_reader :targets, :tasks, :configs, :formats, :reports
def initialize(user="openvas", pass="openvas", host="localhost", port=9392, debug=false)
@debug = debug
@token = ''
@server = OpenVASConnection.new(host, port, debug)
@server.connect
login(user, pass)
@configs = nil
@tasks = nil
@targets = nil
@formats = nil
@reports = nil
config_get_all
task_get_all
target_get_all
format_get_all
report_get_all
end
#--------------------------
# Low level commands. Only
# used by OpenVASOMP class.
#--------------------------
# Nests a string inside an XML tag specified by root
def xml_str(root, str)
return "<#{root}>#{str}</#{root}>"
end
# Creates an XML root with child elements specified by a hash
def xml_elems(root, elems)
xml = REXML::Element.new(root)
elems.each do |key, val|
e = xml.add_element(key)
e.text = val
end
return xml.to_s
end
# Creates and XML element with attributes specified by a hash
def xml_attrs(elem, attribs)
xml = REXML::Element.new(elem)
attribs.each do |key, val|
xml.attributes[key] = val
end
return xml.to_s
end
# Send authentication string and return an XML object (authentication token)
def auth_request_xml(request)
if @debug
puts "Sending Request: #{request}"
end
resp = @server.sendrecv(request)
begin
docxml = REXML::Document.new(resp)
status = docxml.root.attributes['status'].to_i
status_text = docxml.root.attributes['status_text']
if @debug
puts "Status: #{status}"
puts "Status Text: #{status_text}"
end
rescue
raise XMLParsingError
end
return status, status_text
end
# Send string request wrapped with authentication XML and return
# an XML object
def omp_request_xml(request)
if @debug
puts "Sending Request: #{request}"
end
resp = @server.sendrecv(@token + request)
begin
# Wrap the response in XML tags to use next_element properly.
docxml = REXML::Document.new("<response>" + resp + "</response>")
resp = docxml.root.elements['authenticate_response'].next_element
status = resp.attributes['status'].to_i
status_text = resp.attributes['status_text']
if @debug
puts "Status: #{status}"
puts "Status Text: #{status_text}"
end
rescue
raise XMLParsingError
end
return status, status_text, resp
end
#--------------------------
# Class API methods.
#--------------------------
# Sets debug level
def debug(value)
if value == 0
@debug = false
@server.debug = false
return "Debug is deactivated."
else
@debug = true
@server.debug = true
return "Debug is activated."
end
end
# get OMP version (you don't need to be authenticated)
def get_version
status, status_text, resp = omp_request_xml("<get_version/>")
begin
version = resp.elements['version'].text
return version
rescue
raise XMLParsingError
end
end
# login to OpenVAS server.
# if successful returns authentication XML for further usage
# if unsuccessful returns empty string
def login(user, pass)
creds = xml_elems("credentials", {"username"=> user, "password" => pass})
req = xml_str("authenticate", creds)
status, status_text = auth_request_xml(req)
if status == 200
@token = req
else
raise OMPAuthError
end
end
# Logout by disconnecting from the server and deleting the
# authentication string. There are no sessions in OMP, must
# send the credentials every time.
def logout
@server.disconnect()
@token = ''
end
#------------------------------
# Target Functions
#------------------------------
# OMP - Get all targets for scanning and returns array of hashes
# with following keys: id,name,comment,hosts,max_hosts,in_use
#
# Usage:
# array_of_hashes = target_get_all()
#
def target_get_all()
begin
status, status_text, resp = omp_request_xml("<get_targets/>")
list = Array.new
resp.elements.each('//get_targets_response/target') do |target|
td = Hash.new
td["id"] = target.attributes["id"]
td["name"] = target.elements["name"].text
td["comment"] = target.elements["comment"].text
td["hosts"] = target.elements["hosts"].text
td["max_hosts"] = target.elements["max_hosts"].text
td["in_use"] = target.elements["in_use"].text
list.push td
end
@targets = list
return list
rescue
raise OMPResponseError
end
end
# OMP - Create target for scanning
#
# Usage:
#
# target_id = ov.target_create("name"=>"localhost",
# "hosts"=>"127.0.0.1","comment"=>"yes")
#
def target_create(name, hosts, comment)
req = xml_elems("create_target", {"name"=>name, "hosts"=>hosts, "comment"=>comment})
begin
status, status_text, resp = omp_request_xml(req)
target_get_all
return "#{status_text}: #{resp.attributes['id']}"
rescue
raise OMPResponseError
end
end
# OMP - Delete target
#
# Usage:
#
# ov.target_delete(target_id)
#
def target_delete(id)
target = @targets[id.to_i]
if not target
raise OMPError.new("Invalid target id.")
end
req = xml_attrs("delete_target",{"target_id" => target["id"]})
begin
status, status_text, resp = omp_request_xml(req)
target_get_all
return status_text
rescue
raise OMPResponseError
end
end
#--------------------------
# Task Functions
#--------------------------
# In short: Create a task.
#
# The client uses the create_task command to create a new task.
#
def task_create(name, comment, config_id, target_id)
config = @configs[config_id.to_i]
target = @targets[target_id.to_i]
config = xml_attrs("config", {"id"=>config["id"]})
target = xml_attrs("target", {"id"=>target["id"]})
namestr = xml_str("name", name)
commstr = xml_str("comment", comment)
req = xml_str("create_task", namestr + commstr + config + target)
begin
status, status_text, resp = omp_request_xml(req)
task_get_all
return "#{status_text}: #{resp.attributes['id']}"
rescue
raise OMPResponseError
end
end
# In short: Delete a task.
#
# The client uses the delete_task command to delete an existing task,
# including all reports associated with the task.
#
def task_delete(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("delete_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
task_get_all
return status_text
rescue
raise OMPResponseError
end
end
# In short: Get all tasks.
#
# The client uses the get_tasks command to get task information.
#
def task_get_all()
begin
status, status_text, resp = omp_request_xml("<get_tasks/>")
list = Array.new
resp.elements.each('//get_tasks_response/task') do |task|
td = Hash.new
td["id"] = task.attributes["id"]
td["name"] = task.elements["name"].text
td["comment"] = task.elements["comment"].text
td["status"] = task.elements["status"].text
td["progress"] = task.elements["progress"].text
list.push td
end
@tasks = list
return list
rescue
raise OMPResponseError
end
end
# In short: Manually start an existing task.
#
# The client uses the start_task command to manually start an existing
# task.
#
def task_start(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("start_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
return status_text
rescue
raise OMPResponseError
end
end
# In short: Stop a running task.
#
# The client uses the stop_task command to manually stop a running
# task.
#
def task_stop(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("stop_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
return status_text
rescue
raise OMPResponseError
end
end
# In short: Pause a running task.
#
# The client uses the pause_task command to manually pause a running
# task.
#
def task_pause(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("pause_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
return status_text
rescue
raise OMPResponseError
end
end
# In short: Resume task if stopped, else start task.
#
# The client uses the resume_or_start_task command to manually start
# an existing task, ensuring that the task will resume from its
# previous position if the task is in the Stopped state.
#
def task_resume_or_start(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("resume_or_start_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
return status_text
rescue
raise OMPResponseError
end
end
# In short: Resume a puased task
#
# The client uses the resume_paused_task command to manually resume
# a paused task.
#
def task_resume_paused(task_id)
task = @tasks[task_id.to_i]
if not task
raise OMPError.new("Invalid task id.")
end
req = xml_attrs("resume_paused_task",{"task_id" => task["id"]})
begin
status, status_text, resp = omp_request_xml(req)
return status_text
rescue
raise OMPResponseError
end
end
#--------------------------
# Config Functions
#--------------------------
# OMP - get configs and returns hash as response
# hash[config_id]=config_name
#
# Usage:
#
# array_of_hashes=ov.config_get_all()
#
def config_get_all()
begin
status, status_text, resp = omp_request_xml("<get_configs/>")
list = Array.new
resp.elements.each('//get_configs_response/config') do |config|
c = Hash.new
c["id"] = config.attributes["id"]
c["name"] = config.elements["name"].text
list.push c
end
@configs = list
return list
rescue
raise OMPResponseError
end
end
#--------------------------
# Format Functions
#--------------------------
# Get a list of report formats
def format_get_all()
begin
status, status_text, resp = omp_request_xml("<get_report_formats/>")
if @debug then print resp end
list = Array.new
resp.elements.each('//get_report_formats_response/report_format') do |report|
td = Hash.new
td["id"] = report.attributes["id"]
td["name"] = report.elements["name"].text
td["extension"] = report.elements["extension"].text
td["summary"] = report.elements["summary"].text
list.push td
end
@formats = list
return list
rescue
raise OMPResponseError
end
end
#--------------------------
# Report Functions
#--------------------------
# Get a list of reports
def report_get_all()
begin
status, status_text, resp = omp_request_xml("<get_reports/>")
list = Array.new
resp.elements.each('//get_reports_response/report') do |report|
td = Hash.new
td["id"] = report.attributes["id"]
td["task"] = report.elements["report/task/name"].text
td["start_time"] = report.elements["report/scan_start"].text
td["stop_time"] = report.elements["report/scan_end"].text
list.push td
end
@reports = list
return list
rescue
raise OMPResponseError
end
end
def report_delete(report_id)
report = @reports[report_id.to_i]
if not report
raise OMPError.new("Invalid report id.")
end
req = xml_attrs("delete_report",{"report_id" => report["id"]})
begin
status, status_text, resp = omp_request_xml(req)
report_get_all
return status_text
rescue
raise OMPResponseError
end
end
# Get a report by id. Must also specify the format_id
def report_get_by_id(report_id, format_id)
report = @reports[report_id.to_i]
if not report
raise OMPError.new("Invalid report id.")
end
format = @formats[format_id.to_i]
if not format
raise OMPError.new("Invalid format id.")
end
req = xml_attrs("get_reports", {"report_id"=>report["id"], "format_id"=>format["id"]})
begin
status, status_text, resp = omp_request_xml(req)
rescue
raise OMPResponseError
end
if status == "404"
raise OMPError.new(status_text)
end
content_type = resp.elements["report"].attributes["content_type"]
report = resp.elements["report"].to_s
if report == nil
raise OMPError.new("The report is empty.")
end
# XML reports are in XML format, everything else is base64 encoded.
if content_type == "text/xml"
return report
else
return Base64.decode64(report)
end
end
end
end
|
cSploit/android.MSF
|
lib/openvas/openvas-omp.rb
|
Ruby
|
gpl-3.0
| 17,262
|
/* CPU_X86_32.cpp
Copyright (C) 2008 Stephen Torri
This file is part of Libreverse.
Libreverse is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
Libreverse is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
*/
#include "CPU_X86_32.h"
#include "errors/IO_Exception.h"
namespace reverse
{
namespace mach_module
{
string CPU_X86_32::get_Register_Name ( uint32_t index )
{
// Bouml preserved body begin 0001F437
if ( index > GS )
{
throw errors::IO_Exception ( errors::IO_Exception::INVALID_INDEX );
}
std::string name = "";
switch ( index )
{
case EAX: name = "EAX"; break;
case EBX: name = "EBX"; break;
case ECX: name = "ECX"; break;
case EDX: name = "EDX"; break;
case EDI: name = "EDI"; break;
case ESI: name = "ESI"; break;
case EBP: name = "EBP"; break;
case ESP: name = "ESP"; break;
case SS: name = "SS"; break;
case EFLAGS: name = "EFLAGS"; break;
case EIP: name = "EIP"; break;
case DS: name = "DS"; break;
case ES: name = "ES"; break;
case FS: name = "FS"; break;
case GS: name = "GS"; break;
}
return name;
// Bouml preserved body end 0001F437
}
} /* namespace mach_module */
} /* namespace reverse */
|
storri/libreverse
|
reverse/io/input/file_readers/mac_mach/cpu_x86_32.cpp
|
C++
|
gpl-3.0
| 2,043
|
/**
Copyright 2012 John Cummens (aka Shadowmage, Shadowmage4513)
This software is distributed under the terms of the GNU General Public License.
Please see COPYING for precise license information.
This file is part of Ancient Warfare.
Ancient Warfare is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Ancient Warfare is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Ancient Warfare. If not, see <http://www.gnu.org/licenses/>.
*/
package shadowmage.ancient_warfare.common.item;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import shadowmage.ancient_warfare.common.research.IResearchGoal;
import shadowmage.ancient_warfare.common.research.ResearchGoal;
import shadowmage.ancient_warfare.common.tracker.ResearchTracker;
import shadowmage.ancient_warfare.common.utils.BlockPosition;
public class ItemResearchNote extends AWItemClickable
{
/**
* @param itemID
* @param hasSubTypes
*/
public ItemResearchNote(int itemID)
{
super(itemID, true);
this.hasLeftClick = false;
this.setCreativeTab(CreativeTabAW.researchTab);
this.maxStackSize = 1;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
super.addInformation(stack, player, list, par4);
list.add("Right Click to learn research.");
}
@Override
public boolean onUsedFinal(World world, EntityPlayer player, ItemStack stack, BlockPosition hit, int side)
{
IResearchGoal goal = ResearchGoal.getGoalByID(stack.getItemDamage());
if(world.isRemote)
{
player.addChatMessage("Learning research from notes: " + StatCollector.translateToLocal(goal.getDisplayName()));
return true;
}
if(goal!=null && !ResearchTracker.instance().getEntryFor(player).hasDoneResearch(goal))
{
ResearchTracker.instance().addResearchToPlayer(world, player.getEntityName(), goal.getGlobalResearchNum());
if(!player.capabilities.isCreativeMode)
{
stack.stackSize--;
if(stack.stackSize<=0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
return true;
}
}
return true;
}
@Override
public boolean onUsedFinalLeft(World world, EntityPlayer player, ItemStack stack, BlockPosition hit, int side)
{
return false;
}
}
|
shadowmage45/AncientWarfare
|
AncientWarfare/src/shadowmage/ancient_warfare/common/item/ItemResearchNote.java
|
Java
|
gpl-3.0
| 2,960
|
'use strict';
var async = require('async');
var rss = require('rss');
var nconf = require('nconf');
var validator = require('validator');
var posts = require('../posts');
var topics = require('../topics');
var user = require('../user');
var categories = require('../categories');
var meta = require('../meta');
var helpers = require('../controllers/helpers');
var privileges = require('../privileges');
var db = require('../database');
var utils = require('../utils');
var controllers404 = require('../controllers/404.js');
var terms = {
daily: 'day',
weekly: 'week',
monthly: 'month',
alltime: 'alltime',
};
module.exports = function (app, middleware) {
app.get('/topic/:topic_id.rss', middleware.maintenanceMode, generateForTopic);
app.get('/category/:category_id.rss', middleware.maintenanceMode, generateForCategory);
app.get('/recent.rss', middleware.maintenanceMode, generateForRecent);
app.get('/top.rss', middleware.maintenanceMode, generateForTop);
app.get('/top/:term.rss', middleware.maintenanceMode, generateForTop);
app.get('/popular.rss', middleware.maintenanceMode, generateForPopular);
app.get('/popular/:term.rss', middleware.maintenanceMode, generateForPopular);
app.get('/recentposts.rss', middleware.maintenanceMode, generateForRecentPosts);
app.get('/category/:category_id/recentposts.rss', middleware.maintenanceMode, generateForCategoryRecentPosts);
app.get('/user/:userslug/topics.rss', middleware.maintenanceMode, generateForUserTopics);
app.get('/tags/:tag.rss', middleware.maintenanceMode, generateForTag);
};
function validateTokenIfRequiresLogin(requiresLogin, cid, req, res, callback) {
var uid = req.query.uid;
var token = req.query.token;
if (!requiresLogin) {
return callback();
}
if (!uid || !token) {
return helpers.notAllowed(req, res);
}
async.waterfall([
function (next) {
db.getObjectField('user:' + uid, 'rss_token', next);
},
function (_token, next) {
if (token === _token) {
async.waterfall([
function (next) {
privileges.categories.get(cid, uid, next);
},
function (privileges, next) {
if (!privileges.read) {
return helpers.notAllowed(req, res);
}
next();
},
], callback);
return;
}
user.auth.logAttempt(uid, req.ip, next);
},
function () {
helpers.notAllowed(req, res);
},
], callback);
}
function generateForTopic(req, res, callback) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var tid = req.params.topic_id;
var userPrivileges;
var topic;
async.waterfall([
function (next) {
async.parallel({
privileges: function (next) {
privileges.topics.get(tid, req.uid, next);
},
topic: function (next) {
topics.getTopicData(tid, next);
},
}, next);
},
function (results, next) {
if (!results.topic || (parseInt(results.topic.deleted, 10) && !results.privileges.view_deleted)) {
return controllers404.send404(req, res);
}
userPrivileges = results.privileges;
topic = results.topic;
validateTokenIfRequiresLogin(!results.privileges['topics:read'], results.topic.cid, req, res, next);
},
function (next) {
topics.getTopicWithPosts(topic, 'tid:' + tid + ':posts', req.uid || req.query.uid || 0, 0, 25, false, next);
},
function (topicData) {
topics.modifyPostsByPrivilege(topicData, userPrivileges);
var description = topicData.posts.length ? topicData.posts[0].content : '';
var image_url = topicData.posts.length ? topicData.posts[0].picture : '';
var author = topicData.posts.length ? topicData.posts[0].username : '';
var feed = new rss({
title: utils.stripHTMLTags(topicData.title, utils.tags),
description: description,
feed_url: nconf.get('url') + '/topic/' + tid + '.rss',
site_url: nconf.get('url') + '/topic/' + topicData.slug,
image_url: image_url,
author: author,
ttl: 60,
});
var dateStamp;
if (topicData.posts.length > 0) {
feed.pubDate = new Date(parseInt(topicData.posts[0].timestamp, 10)).toUTCString();
}
topicData.posts.forEach(function (postData) {
if (!postData.deleted) {
dateStamp = new Date(parseInt(parseInt(postData.edited, 10) === 0 ? postData.timestamp : postData.edited, 10)).toUTCString();
feed.item({
title: 'Reply to ' + utils.stripHTMLTags(topicData.title, utils.tags) + ' on ' + dateStamp,
description: postData.content,
url: nconf.get('url') + '/post/' + postData.pid,
author: postData.user ? postData.user.username : '',
date: dateStamp,
});
}
});
sendFeed(feed, res);
},
], callback);
}
function generateForCategory(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var cid = req.params.category_id;
var category;
async.waterfall([
function (next) {
async.parallel({
privileges: function (next) {
privileges.categories.get(cid, req.uid, next);
},
category: function (next) {
categories.getCategoryById({
cid: cid,
set: 'cid:' + cid + ':tids',
reverse: true,
start: 0,
stop: 25,
uid: req.uid || req.query.uid || 0,
}, next);
},
}, next);
},
function (results, next) {
category = results.category;
validateTokenIfRequiresLogin(!results.privileges.read, cid, req, res, next);
},
function (next) {
generateTopicsFeed({
uid: req.uid || req.query.uid || 0,
title: category.name,
description: category.description,
feed_url: '/category/' + cid + '.rss',
site_url: '/category/' + category.cid,
}, category.topics, next);
},
function (feed) {
sendFeed(feed, res);
},
], next);
}
function generateForRecent(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
async.waterfall([
function (next) {
if (req.query.token && req.query.uid) {
db.getObjectField('user:' + req.query.uid, 'rss_token', next);
} else {
next(null, null);
}
},
function (token, next) {
generateForTopics({
uid: token && token === req.query.token ? req.query.uid : req.uid,
title: 'Recently Active Topics',
description: 'A list of topics that have been active within the past 24 hours',
feed_url: '/recent.rss',
site_url: '/recent',
}, 'topics:recent', req, res, next);
},
], next);
}
function generateForTop(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var term = terms[req.params.term] || 'day';
var uid;
async.waterfall([
function (next) {
if (req.query.token && req.query.uid) {
db.getObjectField('user:' + req.query.uid, 'rss_token', next);
} else {
next(null, null);
}
},
function (token, next) {
uid = token && token === req.query.token ? req.query.uid : req.uid;
topics.getSortedTopics({
uid: uid,
start: 0,
stop: 19,
term: term,
sort: 'votes',
}, next);
},
function (result, next) {
generateTopicsFeed({
uid: uid,
title: 'Top Voted Topics',
description: 'A list of topics that have received the most votes',
feed_url: '/top/' + (req.params.term || 'daily') + '.rss',
site_url: '/top/' + (req.params.term || 'daily'),
}, result.topics, next);
},
function (feed) {
sendFeed(feed, res);
},
], next);
}
function generateForPopular(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var term = terms[req.params.term] || 'day';
var uid;
async.waterfall([
function (next) {
if (req.query.token && req.query.uid) {
db.getObjectField('user:' + req.query.uid, 'rss_token', next);
} else {
next(null, null);
}
},
function (token, next) {
uid = token && token === req.query.token ? req.query.uid : req.uid;
topics.getSortedTopics({
uid: uid,
start: 0,
stop: 19,
term: term,
sort: 'posts',
}, next);
},
function (result, next) {
generateTopicsFeed({
uid: uid,
title: 'Popular Topics',
description: 'A list of topics that are sorted by post count',
feed_url: '/popular/' + (req.params.term || 'daily') + '.rss',
site_url: '/popular/' + (req.params.term || 'daily'),
}, result.topics, next);
},
function (feed) {
sendFeed(feed, res);
},
], next);
}
function generateForTopics(options, set, req, res, next) {
var start = options.hasOwnProperty('start') ? options.start : 0;
var stop = options.hasOwnProperty('stop') ? options.stop : 19;
async.waterfall([
function (next) {
topics.getTopicsFromSet(set, options.uid, start, stop, next);
},
function (data, next) {
generateTopicsFeed(options, data.topics, next);
},
function (feed) {
sendFeed(feed, res);
},
], next);
}
function generateTopicsFeed(feedOptions, feedTopics, callback) {
feedOptions.ttl = 60;
feedOptions.feed_url = nconf.get('url') + feedOptions.feed_url;
feedOptions.site_url = nconf.get('url') + feedOptions.site_url;
feedTopics = feedTopics.filter(Boolean);
var feed = new rss(feedOptions);
if (feedTopics.length > 0) {
feed.pubDate = new Date(parseInt(feedTopics[0].lastposttime, 10)).toUTCString();
}
async.each(feedTopics, function (topicData, next) {
var feedItem = {
title: utils.stripHTMLTags(topicData.title, utils.tags),
url: nconf.get('url') + '/topic/' + topicData.slug,
date: new Date(parseInt(topicData.lastposttime, 10)).toUTCString(),
};
if (topicData.teaser && topicData.teaser.user) {
feedItem.description = topicData.teaser.content;
feedItem.author = topicData.teaser.user.username;
feed.item(feedItem);
return next();
}
topics.getMainPost(topicData.tid, feedOptions.uid, function (err, mainPost) {
if (err) {
return next(err);
}
if (!mainPost) {
feed.item(feedItem);
return next();
}
feedItem.description = mainPost.content;
feedItem.author = mainPost.user.username;
feed.item(feedItem);
next();
});
}, function (err) {
callback(err, feed);
});
}
function generateForRecentPosts(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
async.waterfall([
function (next) {
posts.getRecentPosts(req.uid, 0, 19, 'month', next);
},
function (posts) {
var feed = generateForPostsFeed({
title: 'Recent Posts',
description: 'A list of recent posts',
feed_url: '/recentposts.rss',
site_url: '/recentposts',
}, posts);
sendFeed(feed, res);
},
], next);
}
function generateForCategoryRecentPosts(req, res, callback) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var cid = req.params.category_id;
var category;
var posts;
async.waterfall([
function (next) {
async.parallel({
privileges: function (next) {
privileges.categories.get(cid, req.uid, next);
},
category: function (next) {
categories.getCategoryData(cid, next);
},
posts: function (next) {
categories.getRecentReplies(cid, req.uid || req.query.uid || 0, 20, next);
},
}, next);
},
function (results, next) {
if (!results.category) {
return controllers404.send404(req, res);
}
category = results.category;
posts = results.posts;
validateTokenIfRequiresLogin(!results.privileges.read, cid, req, res, next);
},
function () {
var feed = generateForPostsFeed({
title: category.name + ' Recent Posts',
description: 'A list of recent posts from ' + category.name,
feed_url: '/category/' + cid + '/recentposts.rss',
site_url: '/category/' + cid + '/recentposts',
}, posts);
sendFeed(feed, res);
},
], callback);
}
function generateForPostsFeed(feedOptions, posts) {
feedOptions.ttl = 60;
feedOptions.feed_url = nconf.get('url') + feedOptions.feed_url;
feedOptions.site_url = nconf.get('url') + feedOptions.site_url;
var feed = new rss(feedOptions);
if (posts.length > 0) {
feed.pubDate = new Date(parseInt(posts[0].timestamp, 10)).toUTCString();
}
posts.forEach(function (postData) {
feed.item({
title: postData.topic ? postData.topic.title : '',
description: postData.content,
url: nconf.get('url') + '/post/' + postData.pid,
author: postData.user ? postData.user.username : '',
date: new Date(parseInt(postData.timestamp, 10)).toUTCString(),
});
});
return feed;
}
function generateForUserTopics(req, res, callback) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var userslug = req.params.userslug;
async.waterfall([
function (next) {
user.getUidByUserslug(userslug, next);
},
function (uid, next) {
if (!uid) {
return callback();
}
user.getUserFields(uid, ['uid', 'username'], next);
},
function (userData, next) {
generateForTopics({
uid: req.uid,
title: 'Topics by ' + userData.username,
description: 'A list of topics that are posted by ' + userData.username,
feed_url: '/user/' + userslug + '/topics.rss',
site_url: '/user/' + userslug + '/topics',
}, 'uid:' + userData.uid + ':topics', req, res, next);
},
], callback);
}
function generateForTag(req, res, next) {
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return controllers404.send404(req, res);
}
var tag = validator.escape(String(req.params.tag));
var page = parseInt(req.query.page, 10) || 1;
var topicsPerPage = meta.config.topicsPerPage || 20;
var start = Math.max(0, (page - 1) * topicsPerPage);
var stop = start + topicsPerPage - 1;
generateForTopics({
uid: req.uid,
title: 'Topics tagged with ' + tag,
description: 'A list of topics that have been tagged with ' + tag,
feed_url: '/tags/' + tag + '.rss',
site_url: '/tags/' + tag,
start: start,
stop: stop,
}, 'tag:' + tag + ':topics', req, res, next);
}
function sendFeed(feed, res) {
var xml = feed.xml();
res.type('xml').set('Content-Length', Buffer.byteLength(xml)).send(xml);
}
|
BenLubar/NodeBB
|
src/routes/feeds.js
|
JavaScript
|
gpl-3.0
| 14,110
|
<!DOCTYPE html>
<html>
<head>
<title>Washington State Courts - Supreme Court Calendar </title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<link rel="icon" type="image/vnd.microsoft.icon" href="//www.courts.wa.gov/favicon.ico">
<noscript>
<link href="/css/layoutStylesv3.css" type=text/css rel=stylesheet />
<link href="/css/stylesheetv2.css" type=text/css rel=stylesheet />
<link href="/css/tabStyles.css" type=text/css rel=stylesheet />
<link href="/css/subsite_stylesv2.css" rel=stylesheet type=text/css />
</noscript>
<script language="JavaScript" src="/includes/AOCScripts.js" type="text/javascript"></script>
<script type="text/javascript" language="JavaScript1.2" src="/includes/stm31.js"></script>
<script src="/scripts/jquery-1.11.2.min.js" type="text/javascript" language="JavaScript"></script>
<script src="/js/modernizr-custom.min.js"></script>
<script src="/js/featureDetection.js"></script>
<script src="/js/jqueryForForm.js" type="text/javascript"></script>
<script src="/js/multiFileUpload.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/css/libraryStylesv2.css" />
<link rel="stylesheet" type="text/css" href="/css/layoutStylesv3.css" />
<link rel="stylesheet" type="text/css" href="/css/stylesheetv2.css" />
<link rel="stylesheet" type="text/css" href="/css/subsite_stylesv2.css" />
</head>
<body>
<div id="topLayout">
<div id="newLayout">
<div id="newPageLayout">
<a name="top"></a>
<div id="topheader">
<div id="left"><a href="/"><img src="/images/waCourtsLogo.png" border="0" alt="Welcome to Washington State Courts" /></a></div>
<div id="right">
<div class="socialMediaBar">
<ul>
<li><a href="/notifications/" title="Sign up for Notifications"><img src="/images/iconEmailBlue.png" alt="Sign up for Email Notifications" border="0" /></a></li>
<li><a href="/notifications/" title="Sign up for Notifications">Get Email Updates</a></li>
<li>|</li>
<li><a href="https://aoc.custhelp.com/"><img src="/images/iconHelp_flatBlueSm2.png" border="0" /></a></li>
<li><a href="https://aoc.custhelp.com/">FAQs & eService Center</a></li>
</ul>
</div>
<div class="topSearchArea">
<form method="post" action="/search/index.cfm?fa=search.start_search">
<input type="text" name="searchTerms" size="36" maxlength="256" placeholder="Search WA Courts Site" class="searchField" value="Search WA Courts Site"
onfocus="if (this.value=='Search WA Courts Site'){this.value='';$(this).css('color','#000000','font-style','normal');}"
onblur="if (this.value==''){this.value='Search WA Courts Site';$(this).css('color', '#bbbbb7');}">
<input type="image" name="btnSearch" class="searchButton" alt="Search" src="/images/iconSearch.png">
</form>
</div>
</div>
</div>
<div id="mainNav">
<ul id="menuBar">
<a href="/forms/" ><li class="menuItem first" >Forms</li></a>
<a href="/court_dir/" ><li class="menuItem" >Court Directory</li></a>
<a href="/opinions/" ><li class="menuItem">Opinions</li></a>
<a href="/court_rules/" ><li class="menuItem">Rules</li></a>
<a href="/appellate_trial_courts/" ><li class="menuItem">Courts</li></a>
<a href="/programs_orgs/" ><li class="menuItem">Programs & Organizations</li></a>
<a href="/newsinfo/index.cfm?fa=newsinfo.displayContent&theFile=content/ResourcesPubsReports" ><li class="menuItem last">Resources</li></a>
</ul>
</div>
<div id="topline">
<div id="left" class="breadcrumb"><a href="/">Courts Home</a> > <a href="/appellate_trial_courts/" class="breadcrumb">Courts</a> > <a href="/appellate_trial_courts/supreme/calendar" class="breadcrumb">Supreme Court Calendar</a></div>
</div>
<a name="body"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="clear:both;">
<tr>
<td width="10"> </td>
<td valign="top" class="mainPage">
<table width="100%">
<tr>
<td valign="top"><h2>Supreme Court Calendar</h2></td>
<td valign="top" align="right" width="175"><div class="linkBox"><a href="/appellate_trial_courts/coaBriefs/index.cfm?fa=coaBriefs.ScHome&courtId=A08">Supreme Court Briefs</a></div></td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="2" title="Default Paragraph - Tables">
<tr>
<td width="50%" valign="top"><p><b>9:00 A.M. </b></p></td>
<td width="15%" valign="top"><p><b>Olympia </b></td>
<td valign="top"><p><b>May 7, 2009</b>
</td></tr></table>
<p align="center"><a name="P8_146"></a><b><u>THREE CASES ONLY – TWO IN A.M. & ONE IN P.M.</u></b>
<p>
<table width="100%" border="1" cellspacing="0" cellpadding="2" title="Heading 1 - Tables">
<tr>
<td width="50%" valign="top"><p><b>Case No. 1 - 81270-5</b>
</td>
<td width="50%" valign="top"><p><b><u>COUNSEL</u></b>
</td></tr>
<tr>
<td width="50%" valign="top"><p>STATE OF WASHINGTON
<br> v.
<br>RAYMOND CARL HUGHES
</td>
<td width="50%" valign="top"><p>Mark Lindsey
<p>David Gasch
</td></tr>
<tr>
<td width="50%" colspan="2" valign="top"><p><b>SYNOPSIS:</b><font color="#1f497d"> </font>Hughes was convicted of rape of a child in the second degree and rape in the second degree based on incapacity to consent. The convictions arose out of a single act. Do the convictions violate double jeopardy?
</td></tr></table>
<p>
<table width="100%" border="1" cellspacing="0" cellpadding="2" title="Default Paragraph - Tables">
<tr>
<td width="50%" valign="top"><p><b>Case No. 2 – 81750-2</b>
</td>
<td width="50%" valign="top"><p><b><u>COUNSEL</u></b>
</td></tr>
<tr>
<td width="50%" valign="top"><p>STATE OF WASHINGTON
<br> v.
<br>RICARDO INIGUEZ
</td>
<td width="50%" valign="top"><p>Frank Jenny, II
<p>James Egan
</td></tr>
<tr>
<td width="50%" colspan="2" valign="top"><p><b>SYNOPSIS:</b> Did a delay of more than eight months between arrest and trial violate Iniguez’s constitutional right to a speedy trial?
</td></tr></table>
<p><hr><b>1:30 P.M.</b><hr>
<p>
<table width="100%" border="1" cellspacing="0" cellpadding="2" title="Default Paragraph - Tables">
<tr>
<td width="50%" valign="top"><p><b>Case No. 3 – 81314-1</b>
</td>
<td width="50%" valign="top"><p><b><u>COUNSEL</u></b>
</td></tr>
<tr>
<td width="50%" valign="top"><p>STATE OF WASHINGTON
<br> v.
<br>MICHAEL KENNETH WEBB
</td>
<td width="50%" valign="top"><p>James Whisman/Brian McDonald
<p>Nancy Collins
</td></tr>
<tr>
<td width="50%" colspan="2" valign="top"><p><b>SYNOPSIS:</b> At issue is what should happen in a criminal defendant's case if the defendant dies when his appeal is pending?
</td></tr></table>
<p><hr>
<strong>These summaries are not formulated by the Court and are provided only for the convenience of the public.</b></strong>
</td>
<td width="10"> </td>
</tr>
</table>
<div class="footerOuter">
<div class="footerBg">
<div class="footerLayout">
<ul>
<span class="footerHeader">Access Records</span>
<li><a href="/jislink/">JIS LINK</a></li>
<li><a href="http://dw.courts.wa.gov?fa=home.fmcd">Find Your Court Date</a></li>
<li><a href="http://dw.courts.wa.gov">Search Case Records</a></li>
<li><a href="/newsinfo/publication/?fa=newsinfo_publication.recordsRequest">Records Request</a></li>
<li><a href="/jis/">Judicial Info System (JIS)</a></li>
<li><a href="https://odysseyportal.courts.wa.gov/odyportal">Odyssey Portal</a></li>
<li><a href="/caseload">Caseload Reports</a></li>
<li>
</li>
</ul>
<ul>
<span class="footerHeader">Find Resources</span>
<li><a href="/library/">State Law Library</a></li>
<li><a href="/education/">Civic Learning</a></li>
<li><a href="/newsinfo/index.cfm?fa=newsinfo.displayContent&theFile=content/ResourcesPubsReports">Resources, Publications, & Reports</a></li>
<li><a href="/committee/?fa=committee.home&committee_id=143">Court Program Accessibility (ADA)</a></li>
<li><a href="/newsinfo/resources/">Jury Service Information</a></li>
<li><a href="/Whistleblower/">Whistleblower</a></li>
<li><a href="/employ/">Employment</a></li>
<li><a href="/procure/">Procurement</a></li>
</ul>
<ul>
<span class="footerHeader">From the Courts</span>
<li><a href="/forms/">Court Forms</a></li>
<li><a href="/forms/?fa=forms.contribute&formID=16">Domestic Violence Forms</a></li>
<li><a href="/opinions/">Court Opinions</a></li>
<li><a href="/court_rules/">Court Rules</a></li>
<li><a href="/index.cfm?fa=home.contentDisplay&location=PatternJuryInstructions">Pattern Jury Instructions</a></li>
<li><a href="/emergency/">Emergency Procedures</a></li>
<li><a href="/index.cfm?fa=home.courtClosures">Notice of Court Closures</a></li>
</ul>
<ul>
<span class="footerHeader">Get Organizational Information</span>
<li><a href="/appellate_trial_courts/aocwho/">Administrative Office of the Courts</a></li>
<li><a href="/appellate_trial_courts/SupremeCourt/?fa=supremecourt.welcome">Supreme Court</a></li>
<li><a href="/appellate_trial_courts/">Appellate & Trial Courts</a></li>
<li><a href="/programs_orgs/">Programs & Organizations</a></li>
<li><a href="/newsinfo/">Washington Court News</a></li>
<li><a href="/court_dir/">Court Directory</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="stayConnected">
<ul style="float:left;">
<li><span class="stayConnectedHeader">Connect with us</span></li>
<li><a href="https://www.facebook.com/washingtoncourts"><img src="/images/iconFB_gray.png" alt="Find us on Facebook" border="0" /></a></li>
<li><a href="https://twitter.com/WACourts"><img src="/images/iconTwitter_gray.png" alt="Follow us on Twitter" border="0" /></a></li>
<li><a href="http://www.youtube.com/channel/UCx4B3hu7aZGPnYGKwph2M0w"><img src="/images/iconYT_gray.png" alt="Watch our YouTube Channel" border="0" /></a></li>
<li><a href="/notifications/?fa=notifications.rss"><img src="/images/iconRss_gray.png" alt="Use one of our RSS Feeds" border="0" /></a></li>
</ul>
<ul style="float:left; padding: 0 0 0 24px;">
<li><span class="stayConnectedHeader">Need Help?</span></li>
<li><a href="https://aoc.custhelp.com/"><img src="/images/iconHelp_lg.png" border="0"></a></li>
<li><span class="stayConnectedHeader"><a href="https://aoc.custhelp.com/">FAQs & eService Center</a></span></li>
</ul>
</div>
<div class="footerLower">
<ul>
<li class="footerText" style="float:left;"><a href="/?fa=home.notice">Privacy & Disclaimer Notices</a> | <a href="/index.cfm?fa=home.sitemap">Sitemap</a></li>
<li class="sealPos"><img src="/images/footerSeal.png" alt="WA State Seal" ></li>
<li class="footerText" style="float:right;">Copyright AOC © 2014</li>
</ul>
</div>
<div class="accessWA">
<div style="display:inline; padding:0 12px 0 8px;float:left;"><a href="http://access.wa.gov" target="_blank"><img src="/images/AWlogo2_150px.gif" border="0" /></a></div>
<div style="display:inline; padding:8px 0;float:left;">For Washington State laws, visit the <a href="http://www1.leg.wa.gov/Legislature/" class="external" target="_blank" style="text-decoration:underline;">Washington State Legislature</a></div>
<div style="display:inline; padding:8px 0;float:right; font-size:8px">S3</div>
</div>
</div>
</div>
</body>
</html>
|
jeffpar/courtcasts
|
sources/wasc/2009/05/07-docket.html
|
HTML
|
gpl-3.0
| 12,231
|
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def invertTree(self, root):
"""
:type root: TreeNode
:rtype: TreeNode
"""
if not root:
return
root.left, root.right = root.right, root.left
self.invertTree(root.left)
self.invertTree(root.right)
return root
|
zqfan/leetcode
|
algorithms/226. Invert Binary Tree/solution.py
|
Python
|
gpl-3.0
| 490
|
# Copyright (C) 2011 Pierre de Buyl
# This file is part of pyMPCD
# pyMPCD is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# pyMPCD is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with pyMPCD. If not, see <http://www.gnu.org/licenses/>.
"""
MPCD.py - This file contains the base class to perform MPCD simulations: MPCD_system.
"""
## \namespace pyMPCD::MPCD
# \brief MPCD.py - This file contains the base class to perform MPCD simulations: MPCD_system.
#
# MPCD methods define the basic
import numpy as np
from scipy.misc import factorial
from MPCD_f import mpcd_mod
## Defines all variables for a MPCD system
#
# A simulation box is either declared via MPCD_system or through one test_case or from a file.
#
# \b Example
# \code
#import pyMPCD # import the pyMPCD package
#box = pyMPCD.MPCD_system( (8,8,8), 10, 1.0) # Create a PBC system of 8x8x8 cells, density 10 and cell size 1.0
# \endcode
class MPCD_system():
"""
The MPCD_system class contains all variables relevant for MPCD simulations: box information, periodic boundaries, particles positions, ...
"""
## Initializes a MPCD_system
#
# \param N_cells a 3 elements list or tuple that contains the number of cells in each dimension.
# \param density an integer number that define the average number of particles per cell.
# \param a the linear cell size.
# \param N_species The number of solvent species to consider.
def __init__( self, N_cells , density , a , N_species = 1):
"""
Defines a MPCD_system with periodic boundary conditions.
N_cells is the number of cells in the 3 dimensions.
density is the reference density for initialization and for filling cells with virtual particles.
a is the linear cell size.
"""
## Number of physical cells for the simulation.
self.N_cells = np.array( N_cells , dtype=np.int32)
# Check the input for N_cells
if (len(self.N_cells) != 3): raise Exception
## The number of actual binning cells. Is higher than N_cells to allow for non-periodic systems.
self.N_grid = self.N_cells + 1
## The average density (number of particles per cell).
self.density = int(density)
## The total number of MPCD particles.
self.so_N = np.prod( self.N_cells ) * self.density
## The linear cell size.
self.a = float(a)
## The number of solvent species
self.N_species = N_species
# Check that N_species is valid
if (N_species < 1): raise Exception
## The shift applied to the system.
self.shift = np.zeros( (3,) , dtype=np.float64 )
## NumPy array for the position of the MPCD solvent.
self.so_r = np.zeros( (self.so_N , 3) , dtype=np.float64 )
## A view to so_r in Fortran order.
self.so_r_f = self.so_r.T
## NumPy array for the velocity of the MPCD solvent.
self.so_v = np.zeros( (self.so_N , 3) , dtype=np.float64 )
## A view to so_v in Fortran order.
self.so_v_f = self.so_v.T
## The local temperature in the cells.
self.cells_temperature = np.zeros( (self.N_grid[0], self.N_grid[1], self.N_grid[2]), dtype=np.float64 )
## NumPy array for the species.
self.so_species = np.zeros( (self.so_N, ), dtype=np.int32)
## NumPy array holding the mass of each species.
self.so_mass = np.ones( (self.N_species, ), dtype=np.float64)
## The size of the box.
self.L = self.N_cells*self.a
## The MPCD time step, used for streaming.
self.tau = float(0.)
## The number of particles in each cell.
self.cells = np.zeros( self.N_grid, dtype=np.int32 )
## A view to cells in Fortran order.
self.cells_f = self.cells.T
## The list of particles, per cell.
self.par_list = np.zeros( (self.N_grid[0], self.N_grid[1], self.N_grid[2], 64), dtype=np.int32 )
## A view to par_list in Fortran order.
self.par_list_f = self.par_list.T
## The cell-wise center-of-mass velocity.
self.v_com = np.zeros( (self.N_grid[0], self.N_grid[1], self.N_grid[2], 3), dtype=np.float64 )
## The origin of the grid.
self.root = np.zeros( (3,), dtype=np.float64)
## Boundary conditions, in the three directions. 0 = PBC , 1 = elastic collision with virtual particles.
self.BC = np.zeros( (3,) , dtype=np.int32 )
## Wall velocity, on each wall. indices = wall dir (x,y,z) , wall low/high , v.
self.wall_v0 = np.zeros( (3, 2, 3) , dtype=np.float64 )
## Wall temperature for the virtual particles on each wall side. indices = wall dir (x,y,z), wall low/high.
self.wall_temp = np.zeros( (3, 2) , dtype=np.float64 )
## Magnitude of the acceleration provided by gravity, if applicable.
self.gravity = float(0.)
## Number of chemical reactions to consider.
self.N_reactions = 0
## Kind of chemical reaction.
self.reaction_kind = []
## Rates for the chemical reactions.
self.rates = []
## Stoechiometry for reactants.
self.reactants = []
## Stoechiometry for products.
self.products = []
def __str__(self):
return str(type(self))+' size '+str(self.N_cells)+' , '+str(self.so_N)+' solvent particles'
def add_reaction(self, rate, reactants, products):
if ( not (len(reactants) == len(products) == self.N_species) ):
print("Bad input for add_reaction")
return
if ( (min(reactants)<0) or (min(products)<0) ):
print("Bad input for add_reaction")
return
N_reactants = np.sum(reactants)
N_products = np.sum(products)
if ( (N_reactants==1) and (N_products==1) ):
kind = 0
elif ( reactants[0]==1 and reactants[1]==2 and products[1]==3):
kind = 1
else:
print("reaction type not supported in add_reaction")
return
self.N_reactions += 1
self.reaction_kind.append(kind)
self.rates.append(rate)
self.reactants.append(reactants)
self.products.append(products)
def close_reaction(self):
if (self.N_reactions > 0):
self.rates = np.array(self.rates)
self.reactants = np.array(self.reactants,ndmin=2)
self.products = np.array(self.products,ndmin=2)
## Initializes the particles according to a normal or flat velocity profile.
# \param temp Initial temperature of the system.
# \param boltz if True or unset, use a normal velocity profile of temperature T.
# Else, use a flat profile.
def init_v(self, temp, boltz=True):
"""
Initializes the particles according to a normal distribution of
temperature temp and resets the total velocity of the system.
If boltz is set to False, a uniform distribution is used instead
"""
if boltz:
self.so_v[:,:] = np.random.randn( self.so_v.shape[0], self.so_v.shape[1] ) * np.sqrt(temp)
self.so_v /= np.sqrt(self.so_mass[self.so_species]).reshape( (self.so_N, 1) )
else:
self.so_v[:,:] = np.random.rand( self.so_v.shape[0], self.so_v.shape[1] )
self.so_v[:,:] -= 0.5
self.so_v[:,:] *= 2.*np.sqrt(6.*temp/2.)
tot_v = np.sum( self.so_v*(self.so_mass[self.so_species]).reshape( (self.so_N, 1) ) , axis=0 ) / self.so_mass[self.so_species].sum()
tot_v = tot_v.reshape( ( 1 , tot_v.shape[0] ) )
self.so_v -= tot_v
## Places particles in the simulation box at random according to a uniform distribution.
def init_r(self):
"""
Places particles in the simulation box at random according to a uniform distribution.
"""
self.so_r[:,:] = np.random.rand( self.so_r.shape[0], self.so_r.shape[1] )
self.so_r *= (self.a*self.N_cells).reshape( ( 1 , self.so_r.shape[1] ) )
## Advances the particles according to their velocities.
def stream(self):
"""Advances the particles according to their velocities."""
self.so_r[:] += self.so_v*self.tau
## Advances the particles according to their velocities by calling a Fortran routine.
def stream_f(self):
""""Advances the particles according to their velocities by calling a Fortran routine."""
mpcd_mod.stream(self.so_r_f, self.so_v_f, self.tau)
## Advances the particles according to their velocities and a constant acceleration in the z direction.
# Also updates the velocities to take into account the acceleration.
def accel(self):
"""
Advances the particles according to their velocities and a constant acceleration in the z direction.
Also updates the velocities to take into account the acceleration.
"""
self.so_r[:] += self.so_v*self.tau + np.array( [0., 0., self.gravity] ).reshape( (1, 3) )*0.5*self.tau**2
self.so_v[:] += np.array( [0., 0., self.gravity] ).reshape( (1, 3) )*self.tau
## Corrects particles positions and velocities to take into account the boundary conditions.
def boundaries(self):
"""
Corrects particles positions and velocities to take into account the boundary conditions.
PBC keep the particles in the box by sending them to their periodic in-box location.
Elastic walls reflect particles and reverse the velocities.
"""
for i in range(3): # take each dim
if (self.BC[i] == 0): # if PBC, simply appy x = mod( x , L ) to keep particles in the box
self.so_r[:,i] = np.remainder( self.so_r[:,i] , self.L[i] )
elif (self.BC[i] == 1): # if elastic wall, reflect "too high" particles around L and "too low" particles around 0
j_out = ( self.so_r[:,i] > self.L[i] )
self.so_r[j_out,i] = 2.*self.L[i] - self.so_r[j_out,i]
self.so_v[j_out,i] = - self.so_v[j_out,i]
j_out = ( self.so_r[:,i] < 0 )
self.so_r[j_out,i] = - self.so_r[j_out,i]
self.so_v[j_out,i] = - self.so_v[j_out,i]
else:
print "unknown boundary condition ", self.BC[i]
raise Exception
def check_in_box(self):
"""
A test routine to check that all particles are actually in the box [0:L]
"""
r_min = self.so_r.min(axis=0)
t_min = ( r_min >= 0. ).min()
r_max = self.so_r.max(axis=0)
t_max = ( r_max < self.L ).min()
if ( t_min and t_max ):
return True
else:
return False
def print_check_in_box(self):
if (self.check_in_box()):
print "All particles inside the box"
else:
print "Some particles outside the box"
def null_shift(self):
"""
Resets the shift to zero.
"""
self.shift[:] = 0.
self.root[:] = self.shift[:] - self.a
def rand_shift(self):
"""
Applies a random shift in [0:a[ to the system.
"""
self.shift[:] = np.random.random( self.shift.shape[0] )*self.a
self.root[:] = self.shift[:] - self.a
def idx(self, i , cijk):
"""
Returns in cijk the three cell indices for particle i.
"""
np.floor( (self.so_r[i,:] - self.root) / self.a , cijk )
for j in range(3):
my_n = self.N_cells[j]
if (self.BC[j] == 0):
if ( cijk[j] >= my_n ): cijk[j] -= my_n
## Bins the particles into the MPCD cells.
def fill_box(self):
"""
Bins the particles into the MPCD cells.
"""
cijk = np.zeros( (3,) , dtype=np.int32 )
self.cells[:] = 0
self.par_list[:] = 0
for i in range(self.so_N):
self.idx( i , cijk )
my_n = self.cells[ cijk[0] , cijk[1] , cijk[2] ]
self.par_list[ cijk[0] , cijk[1] , cijk[2] , my_n ] = i
self.cells[ cijk[0] , cijk[1] , cijk[2] ] = my_n + 1
## Bins the particles into the MPCD cells by calling a Fortran routine.
def fill_box_f(self):
""""Bins the particles into the MPCD cells by calling a Fortran routine."""
mpcd_mod.fill_box(self.so_r_f, self.cells_f, self.par_list_f, self.a, self.root)
## Computes the center of mass velocity for all the cells in the system.
# \param self A MPCD_system instance.
def compute_v_com(self):
"""
Computes the c.o.m. velocity for all cells.
"""
self.v_com[:] = 0
for ci in range(self.N_grid[0]):
for cj in range(self.N_grid[1]):
for ck in range(self.N_grid[2]):
mass_local = 0.
v_local = np.zeros( (3, ) , dtype=np.float64)
n_local = self.cells[ci,cj,ck]
for i in range( n_local ):
part = self.par_list[ci,cj,ck,i]
v_local += self.so_v[part,:]*self.so_mass[self.so_species[part]]
mass_local += self.so_mass[self.so_species[part]]
if (n_local > 0): self.v_com[ci,cj,ck,:] = v_local/mass_local
## Computes the temperature of the cells.
# The temperature is computed as \f$ \frac{ \sum_{i=1}^{N^\xi} m_i (v_i-v_0) ^2 }{N^\xi-1} \f$
# where \f$ v_0 \f$ is the center of mass velocity of the cell.
# \param self A MPCD_system instance.
def compute_cells_temperature(self):
for ci in range(self.N_grid[0]):
for cj in range(self.N_grid[1]):
for ck in range(self.N_grid[2]):
v_local = self.v_com[ci,cj,ck,:]
T_local = 0.
n_local = self.cells[ci,cj,ck]
for i in range(n_local):
part = self.par_list[ci,cj,ck,i]
T_local += self.so_mass[self.so_species[part]]*((self.so_v[part,:]-v_local)**2).sum()
if (n_local>1):
T_local /= 3.*(n_local-1)
self.cells_temperature[ci,cj,ck] = T_local
def MPCD_step_axis(self):
"""
Performs a MPCD collision step where the axis is one of x, y or z, chosen at random.
"""
v_therm = np.zeros((3,))
nn = self.N_cells.copy()
nn += self.BC
is_wall = False
v_wall = np.zeros( (3,) )
local_N = np.zeros( (self.N_species,) , dtype=np.int32)
amu = np.zeros( (self.N_reactions,), dtype=np.float64)
for ci in range(nn[0]):
for cj in range(nn[1]):
for ck in range(nn[2]):
# Choose an axis to perform the rotation
rand_axis = np.random.randint(0,3)
axis1 = ( rand_axis + 1 ) % 3
axis2 = ( rand_axis + 2 ) % 3
if (np.random.randint(2)==0):
r_sign = 1
else:
r_sign = -1
# test if is a wall
is_wall = False
local_i = [ ci , cj , ck ]
for i in range(3):
if (self.BC[i]==1):
if ( (local_i[i]==0) or (local_i[i]==nn[i]-1) ):
is_wall=True
v_wall[:] = self.wall_v0[ i , min( local_i[i], 1 ) , : ]
v_temp = float(self.wall_temp[ i , min( local_i[i] , 1 ) ])
# number of particles in the cell
local_n = self.cells[ci,cj,ck]
# c.o.m. velocity in the cell
local_v = self.v_com[ci,cj,ck,:].copy()
# if cell is a wall, add virtual particles
if (is_wall):
if (local_n < self.density):
local_v = (
(np.random.randn(3) * np.sqrt(v_temp * (self.density - local_n) ) )
+ v_wall*(self.density - local_n)
+ local_v * local_n
) / self.density
v_therm +=local_v
# perform cell-wise collisions
local_N *= 0
for i in range(local_n):
part = self.par_list[ci,cj,ck,i]
self.so_v[part,:] -= local_v
temp = self.so_v[part,axis2]
self.so_v[part,axis2] = r_sign*self.so_v[part,axis1]
self.so_v[part,axis1] = -r_sign*temp
self.so_v[part,:] += local_v
local_N[self.so_species[part]] += 1
# evaluate reaction probability
a0 = 0.
for i in range(self.N_reactions):
amu[i] = self.combi( i, local_N )*self.rates[i]
a0 += amu[i]
P_something = a0*self.tau
reac = -1
if (np.random.rand() < P_something):
amu /= a0
amu = np.cumsum(amu)
x = np.random.rand()
for i in range(self.N_reactions):
if (x < amu[i]):
reac = i
break
# apply reaction reac
if (reac>=0):
if (self.reaction_kind[reac]==0):
reac_s = np.where(self.reactants[i]==1)[0][0]
prod_s = np.where(self.products[i]==1)[0][0]
for i in range(local_n):
part = self.par_list[ci,cj,ck,i]
if (self.so_species[part]==reac_s):
self.so_species[part] = prod_s
break
elif (self.reaction_kind[reac]==1):
reac_s = np.where(self.reactants[i]==1)[0][0]
prod_s = np.where(self.products[i]==3)[0][0]
for i in range(local_n):
part = self.par_list[ci,cj,ck,i]
if (self.so_species[part]==reac_s):
self.so_species[part] = prod_s
break
else:
raise Exception
def combi(self, reac, N):
R = self.reactants[reac]
P = self.products[reac]
r = 1.0
for i in range(self.N_species):
if ( N[i] < R[i] ):
return 0
r *= factorial(N[i],exact=1)
r /= factorial(N[i]-R[i],exact=1)
return r
## Exchanges the positions, momenta and species of two solvent particles.
# \param i index of the first particle to be exchanged.
# \param j index of the second particle to be exchanged.
def exchange_solvent(self,i,j):
"""
Exchanges the positions, momenta and species of two solvent particles.
"""
tmp_copy = self.so_r[i,:].copy()
self.so_r[i,:] = self.so_r[j,:]
self.so_r[j,:] = tmp_copy
tmp_copy = self.so_v[i,:].copy()
self.so_v[i,:] = self.so_v[j,:]
self.so_v[j,:] = tmp_copy
tmp_copy = self.so_species[i].copy()
self.so_species[i] = self.so_species[j]
self.so_species[j] = tmp_copy
## Sorts the solvent in the x,y,z cell order.
def sort_solvent(self):
"""
Sorts the solvent in the x,y,z cell order.
"""
nn = self.N_cells.copy()
nn += self.BC
array_idx = 0
for ci in range(nn[0]):
for cj in range(nn[1]):
for ck in range(nn[2]):
local_n = self.cells[ci,cj,ck]
for i in range(local_n):
self.exchange_solvent(self.par_list[ci,cj,ck,i],array_idx)
array_idx += 1
def one_full_step(self):
"""
Performs a full step of MPCD without gravitation, including the
streaming, taking into account the boundary conditions and the MPCD
collision step.
"""
self.stream()
self.boundaries()
self.rand_shift()
self.fill_box()
self.compute_v_com()
self.MPCD_step_axis()
def one_full_accel(self):
"""
Performs a full step of MPCD with gravitation, including the
streaming, taking into account the boundary conditions and the MPCD
collision step.
"""
self.accel()
self.boundaries()
self.rand_shift()
self.fill_box()
self.compute_v_com()
self.MPCD_step_axis()
def one_full_step_f(self):
"""
Performs a full step of MPCD without gravitation, including the
streaming, taking into account the boundary conditions and the MPCD
collision step.
The streaming and binning steps are performed in Fortran.
"""
self.stream_f()
self.boundaries()
self.rand_shift()
self.fill_box_f()
self.compute_v_com()
self.MPCD_step_axis()
|
pdebuyl/pyMPCD
|
pyMPCD/MPCD.py
|
Python
|
gpl-3.0
| 21,970
|
<?php
namespace Tests\PhpCmplr\Core\Reflection;
use PhpCmplr\Core\Container;
use PhpCmplr\Core\FileStoreInterface;
use PhpCmplr\Core\SourceFile\SourceFile;
use PhpCmplr\Core\Parser\Parser;
use PhpCmplr\Core\DocComment\DocCommentParser;
use PhpCmplr\Core\NameResolver\NameResolver;
use PhpCmplr\Core\Reflection\FileReflection;
use PhpCmplr\Core\Reflection\LocatorReflection;
use PhpCmplr\Core\Reflection\LocatorInterface;
use PhpCmplr\Core\Reflection\Element\Class_;
use PhpCmplr\Core\Reflection\Element\ClassLike;
use PhpCmplr\Core\Reflection\Element\Function_;
use PhpCmplr\Core\Reflection\Element\Interface_;
use PhpCmplr\Core\Reflection\Element\Trait_;
use PhpCmplr\Util\FileIOInterface;
use PhpCmplr\Core\Parser\PositionsReconstructor;
/**
* @covers \PhpCmplr\Core\Reflection\LocatorReflection
*/
class LocatorReflectionTest extends \PHPUnit_Framework_TestCase
{
protected function loadFile($contents, $path = 'qaz.php')
{
$container = new Container();
$container->set('file', new SourceFile($container, $path, $contents));
$container->set('parser', new Parser($container));
$container->set('parser.positions_reconstructor', new PositionsReconstructor($container));
$container->set('doc_comment', new DocCommentParser($container));
$container->set('name_resolver', new NameResolver($container));
$container->set('reflection.file', new FileReflection($container));
return $container;
}
public function test_findClass()
{
$cont1 = $this->loadFile('<?php class CC { public function f() {} }', '/qaz.php');
$cont2 = $this->loadFile('<?php ;', '/wsx.php');
$fileStore = $this->getMockForAbstractClass(FileStoreInterface::class);
$fileStore->expects($this->exactly(1))
->method('getFile')
->with($this->equalTo('/qaz.php'))
->willReturn($cont1);
$cont2->set('file_store', $fileStore);
$locator = $this->getMockForAbstractClass(LocatorInterface::class);
$locator->expects($this->once())
->method('getPathsForClass')
->with($this->equalTo('\\CC'))
->willReturn(['/qaz.php']);
$cont2->set('locator', $locator, ['reflection.locator']);
$io = $this->getMockForAbstractClass(FileIOInterface::class);
$cont2->set('io', $io);
$refl = new LocatorReflection($cont2);
$classes = $refl->findClass('\\CC');
$this->assertCount(1, $classes);
$this->assertSame('\\CC', $classes[0]->getName());
$this->assertSame('f', $classes[0]->getMethods()[0]->getName());
$classesCaseInsensitive = $refl->findClass('\\cC');
$this->assertSame($classes, $classesCaseInsensitive);
}
public function test_findFunction()
{
$cont1 = $this->loadFile('<?php function fff() {}', '/qaz.php');
$cont2 = $this->loadFile('<?php ;', '/wsx.php');
$fileStore = $this->getMockForAbstractClass(FileStoreInterface::class);
$fileStore->expects($this->exactly(1))
->method('getFile')
->with($this->equalTo('/qaz.php'))
->willReturn($cont1);
$cont2->set('file_store', $fileStore);
$locator = $this->getMockForAbstractClass(LocatorInterface::class);
$locator->expects($this->once())
->method('getPathsForFunction')
->with($this->equalTo('\\fff'))
->willReturn(['/qaz.php']);
$cont2->set('locator', $locator, ['reflection.locator']);
$io = $this->getMockForAbstractClass(FileIOInterface::class);
$cont2->set('io', $io);
$refl = new LocatorReflection($cont2);
$functions = $refl->findFunction('\\fff');
$this->assertCount(1, $functions);
$this->assertSame('\\fff', $functions[0]->getName());
$functionsCaseInsensitive = $refl->findFunction('\\fFf');
$this->assertSame($functions, $functionsCaseInsensitive);
}
public function test_findConst()
{
$cont1 = $this->loadFile('<?php const ZZ = 7;', '/qaz.php');
$cont2 = $this->loadFile('<?php ;', '/wsx.php');
$fileStore = $this->getMockForAbstractClass(FileStoreInterface::class);
$fileStore->expects($this->exactly(1))
->method('getFile')
->with($this->equalTo('/qaz.php'))
->willReturn($cont1);
$cont2->set('file_store', $fileStore);
$locator = $this->getMockForAbstractClass(LocatorInterface::class);
$locator->expects($this->exactly(2))
->method('getPathsForConst')
->withConsecutive([$this->equalTo('\\ZZ')], [$this->equalTo('\\zZ')])
->will($this->onConsecutiveCalls(['/qaz.php'], []));
$cont2->set('locator', $locator, ['reflection.locator']);
$io = $this->getMockForAbstractClass(FileIOInterface::class);
$cont2->set('io', $io);
$refl = new LocatorReflection($cont2);
$consts = $refl->findConst('\\ZZ');
$this->assertCount(1, $consts);
$this->assertSame('\\ZZ', $consts[0]->getName());
$constsCaseSensitive = $refl->findConst('\\zZ');
$this->assertCount(0, $constsCaseSensitive);
}
}
|
tsufeki/phpcmplr
|
tests/PhpCmplr/Core/Reflection/LocatorReflectionTest.php
|
PHP
|
gpl-3.0
| 5,229
|
//
// JMSPitchScale+Vexpa.h
// JMSCompositionNetwork
//
// Created by Matt Rankin on 27/03/2015.
// Copyright (c) 2015 Sudoseng. All rights reserved.
//
#import "JMSPitchScale.h"
#import "JMSVexpa.h"
@interface JMSPitchScale (Vexpa) <JMSVexpaParser>
+ (JMSPitchScale *)pitchScaleWithVexpaString:(NSString *)vexpaString;
@end
|
kazoompah/JMSCompositionNetwork
|
JMSCompositionNetwork/TypeObjects/Vexpa/JMSPitchScale+Vexpa.h
|
C
|
gpl-3.0
| 333
|
var Gpio = function (physicalPin, wiringPiPin, name) {
this.id = physicalPin;
this.physicalPin = physicalPin;
this.wiringPiPin = wiringPiPin;
this.name = name;
}
Gpio.fromGpioDefinition = function (definition) {
return new Gpio(definition.physicalPin, definition.wiringPiPin, definition.name);
}
module.exports = Gpio;
|
jvandervelden/rasp-train
|
src/node/models/gpio.js
|
JavaScript
|
gpl-3.0
| 340
|
#include "Granulizer.h"
#include <iostream>
Granulizer::Granulizer()
: grainIdx_(0),
straightIdx_(0),
grainLen_(0.0f),
generator(std::chrono::system_clock::now().time_since_epoch().count())
{
}
bool Granulizer::loadLoop(char* filename)
{
grainIdx_ = 0;
grainLen_ = 0;
SNDFILE* sfFile = sf_open(filename, SFM_READ, &sfInfo_);
if (sfFile) {
sf_command(sfFile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE);
loop_.resize(sfInfo_.frames * sfInfo_.channels);
sf_read_float(sfFile, loop_.data(), sfInfo_.frames * sfInfo_.channels);
sf_close(sfFile);
std::cout << "Successfully loaded " << filename << "." << std::endl;
grainLen_ = float(sfInfo_.frames) / sfInfo_.samplerate * 1000.0f;
return true;
}
else {
std::cerr << "Error: cannot open " << filename << "." << std::endl;
}
return false;
}
const Granulizer::Frame& Granulizer::grainedFrame()
{
Frame frame;
frame.first = loop_[(grainStart_ + grainIdx_) % loop_.size()];
frame.second = loop_[(grainStart_ + grainIdx_ + 1) % loop_.size()];
grainIdx_ += 2;
if (grainIdx_ > grainLen_ * sfInfo_.samplerate) {
newGrain();
}
return frame;
}
const Granulizer::Frame& Granulizer::straightFrame()
{
Frame frame;
frame.first = loop_[straightIdx_++];
frame.second = loop_[straightIdx_++];
straightIdx_ %= loop_.size();
return frame;
}
void Granulizer::newGrain()
{
grainIdx_ = 0;
grainStart_ = (generator() % int(sfInfo_.frames * 0.5 * sfInfo_.channels)) * 2;
}
|
vooku/Generate-festival-music-demo
|
src/Granulizer.cpp
|
C++
|
gpl-3.0
| 1,629
|
/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
* 2020-2021 Evan Nemerson <evan@nemerson.com>
*/
#if !defined(SIMDE_ARM_NEON_DUP_LANE_H)
#define SIMDE_ARM_NEON_DUP_LANE_H
#include "dup_n.h"
#include "types.h"
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t
simde_vdup_lane_f32(simde_float32x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_f32(simde_float32x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_f32(vec, lane) vdup_lane_f32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_f32(vec, lane) (__extension__ ({ \
simde_float32x2_private simde_vdup_lane_f32_vec_ = simde_float32x2_to_private(vec); \
simde_float32x2_private simde_vdup_lane_f32_r_; \
simde_vdup_lane_f32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 8, \
simde_vdup_lane_f32_vec_.values, \
simde_vdup_lane_f32_vec_.values, \
lane, lane \
); \
simde_float32x2_from_private(simde_vdup_lane_f32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_f32
#define vdup_lane_f32(vec, lane) simde_vdup_lane_f32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x1_t
simde_vdup_lane_f64(simde_float64x1_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
(void) lane;
return vec;
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_lane_f64(vec, lane) vdup_lane_f64(vec, lane)
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_f64
#define vdup_lane_f64(vec, lane) simde_vdup_lane_f64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int8x8_t
simde_vdup_lane_s8(simde_int8x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdup_n_s8(simde_int8x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_s8(vec, lane) vdup_lane_s8(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_s8(vec, lane) (__extension__ ({ \
simde_int8x8_private simde_vdup_lane_s8_vec_ = simde_int8x8_to_private(vec); \
simde_int8x8_private simde_vdup_lane_s8_r_; \
simde_vdup_lane_s8_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
8, 8, \
simde_vdup_lane_s8_vec_.values, \
simde_vdup_lane_s8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_int8x8_from_private(simde_vdup_lane_s8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_s8
#define vdup_lane_s8(vec, lane) simde_vdup_lane_s8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int16x4_t
simde_vdup_lane_s16(simde_int16x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdup_n_s16(simde_int16x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_s16(vec, lane) vdup_lane_s16(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_s16(vec, lane) (__extension__ ({ \
simde_int16x4_private simde_vdup_lane_s16_vec_ = simde_int16x4_to_private(vec); \
simde_int16x4_private simde_vdup_lane_s16_r_; \
simde_vdup_lane_s16_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
16, 8, \
simde_vdup_lane_s16_vec_.values, \
simde_vdup_lane_s16_vec_.values, \
lane, lane, lane, lane \
); \
simde_int16x4_from_private(simde_vdup_lane_s16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_s16
#define vdup_lane_s16(vec, lane) simde_vdup_lane_s16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x2_t
simde_vdup_lane_s32(simde_int32x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_s32(simde_int32x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_s32(vec, lane) vdup_lane_s32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_s32(vec, lane) (__extension__ ({ \
simde_int32x2_private simde_vdup_lane_s32_vec_ = simde_int32x2_to_private(vec); \
simde_int32x2_private simde_vdup_lane_s32_r_; \
simde_vdup_lane_s32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 8, \
simde_vdup_lane_s32_vec_.values, \
simde_vdup_lane_s32_vec_.values, \
lane, lane \
); \
simde_int32x2_from_private(simde_vdup_lane_s32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_s32
#define vdup_lane_s32(vec, lane) simde_vdup_lane_s32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int64x1_t
simde_vdup_lane_s64(simde_int64x1_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
return simde_vdup_n_s64(simde_int64x1_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_s64(vec, lane) vdup_lane_s64(vec, lane)
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_s64
#define vdup_lane_s64(vec, lane) simde_vdup_lane_s64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint8x8_t
simde_vdup_lane_u8(simde_uint8x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdup_n_u8(simde_uint8x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_u8(vec, lane) vdup_lane_u8(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_u8(vec, lane) (__extension__ ({ \
simde_uint8x8_private simde_vdup_lane_u8_vec_ = simde_uint8x8_to_private(vec); \
simde_uint8x8_private simde_vdup_lane_u8_r_; \
simde_vdup_lane_u8_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
8, 8, \
simde_vdup_lane_u8_vec_.values, \
simde_vdup_lane_u8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_uint8x8_from_private(simde_vdup_lane_u8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_u8
#define vdup_lane_u8(vec, lane) simde_vdup_lane_u8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x4_t
simde_vdup_lane_u16(simde_uint16x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdup_n_u16(simde_uint16x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_u16(vec, lane) vdup_lane_u16(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_u16(vec, lane) (__extension__ ({ \
simde_uint16x4_private simde_vdup_lane_u16_vec_ = simde_uint16x4_to_private(vec); \
simde_uint16x4_private simde_vdup_lane_u16_r_; \
simde_vdup_lane_u16_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
16, 8, \
simde_vdup_lane_u16_vec_.values, \
simde_vdup_lane_u16_vec_.values, \
lane, lane, lane, lane \
); \
simde_uint16x4_from_private(simde_vdup_lane_u16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_u16
#define vdup_lane_u16(vec, lane) simde_vdup_lane_u16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t
simde_vdup_lane_u32(simde_uint32x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_u32(simde_uint32x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_u32(vec, lane) vdup_lane_u32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdup_lane_u32(vec, lane) (__extension__ ({ \
simde_uint32x2_private simde_vdup_lane_u32_vec_ = simde_uint32x2_to_private(vec); \
simde_uint32x2_private simde_vdup_lane_u32_r_; \
simde_vdup_lane_u32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 8, \
simde_vdup_lane_u32_vec_.values, \
simde_vdup_lane_u32_vec_.values, \
lane, lane \
); \
simde_uint32x2_from_private(simde_vdup_lane_u32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_u32
#define vdup_lane_u32(vec, lane) simde_vdup_lane_u32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint64x1_t
simde_vdup_lane_u64(simde_uint64x1_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
return simde_vdup_n_u64(simde_uint64x1_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vdup_lane_u64(vec, lane) vdup_lane_u64(vec, lane)
#endif
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vdup_lane_u64
#define vdup_lane_u64(vec, lane) simde_vdup_lane_u64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t
simde_vdup_laneq_f32(simde_float32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdup_n_f32(simde_float32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_f32(vec, lane) vdup_laneq_f32(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_f32(vec, lane) (__extension__ ({ \
simde_float32x4_private simde_vdup_laneq_f32_vec_ = simde_float32x4_to_private(vec); \
simde_float32x2_private simde_vdup_laneq_f32_r_; \
simde_vdup_laneq_f32_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_f32_vec_.values, \
simde_vdup_laneq_f32_vec_.values, \
lane, lane \
); \
simde_float32x2_from_private(simde_vdup_laneq_f32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_f32
#define vdup_laneq_f32(vec, lane) simde_vdup_laneq_f32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x1_t
simde_vdup_laneq_f64(simde_float64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_f64(simde_float64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_f64(vec, lane) vdup_laneq_f64(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_f64(vec, lane) (__extension__ ({ \
simde_float64x2_private simde_vdup_laneq_f64_vec_ = simde_float64x2_to_private(vec); \
simde_float64x1_private simde_vdup_laneq_f64_r_; \
simde_vdup_laneq_f64_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_f64_vec_.values, \
simde_vdup_laneq_f64_vec_.values, \
lane \
); \
simde_float64x1_from_private(simde_vdup_laneq_f64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_f64
#define vdup_laneq_f64(vec, lane) simde_vdup_laneq_f64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int8x8_t
simde_vdup_laneq_s8(simde_int8x16_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
return simde_vdup_n_s8(simde_int8x16_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_s8(vec, lane) vdup_laneq_s8(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_s8(vec, lane) (__extension__ ({ \
simde_int8x16_private simde_vdup_laneq_s8_vec_ = simde_int8x16_to_private(vec); \
simde_int8x8_private simde_vdup_laneq_s8_r_; \
simde_vdup_laneq_s8_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_s8_vec_.values, \
simde_vdup_laneq_s8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_int8x8_from_private(simde_vdup_laneq_s8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_s8
#define vdup_laneq_s8(vec, lane) simde_vdup_laneq_s8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int16x4_t
simde_vdup_laneq_s16(simde_int16x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdup_n_s16(simde_int16x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_s16(vec, lane) vdup_laneq_s16(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_s16(vec, lane) (__extension__ ({ \
simde_int16x8_private simde_vdup_laneq_s16_vec_ = simde_int16x8_to_private(vec); \
simde_int16x4_private simde_vdup_laneq_s16_r_; \
simde_vdup_laneq_s16_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_s16_vec_.values, \
simde_vdup_laneq_s16_vec_.values, \
lane, lane, lane, lane \
); \
simde_int16x4_from_private(simde_vdup_laneq_s16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_s16
#define vdup_laneq_s16(vec, lane) simde_vdup_laneq_s16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x2_t
simde_vdup_laneq_s32(simde_int32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdup_n_s32(simde_int32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_s32(vec, lane) vdup_laneq_s32(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_s32(vec, lane) (__extension__ ({ \
simde_int32x4_private simde_vdup_laneq_s32_vec_ = simde_int32x4_to_private(vec); \
simde_int32x2_private simde_vdup_laneq_s32_r_; \
simde_vdup_laneq_s32_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_s32_vec_.values, \
simde_vdup_laneq_s32_vec_.values, \
lane, lane \
); \
simde_int32x2_from_private(simde_vdup_laneq_s32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_s32
#define vdup_laneq_s32(vec, lane) simde_vdup_laneq_s32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int64x1_t
simde_vdup_laneq_s64(simde_int64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_s64(simde_int64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_s64(vec, lane) vdup_laneq_s64(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_s64(vec, lane) (__extension__ ({ \
simde_int64x2_private simde_vdup_laneq_s64_vec_ = simde_int64x2_to_private(vec); \
simde_int64x1_private simde_vdup_laneq_s64_r_; \
simde_vdup_laneq_s64_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_s64_vec_.values, \
simde_vdup_laneq_s64_vec_.values, \
lane \
); \
simde_int64x1_from_private(simde_vdup_laneq_s64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_s64
#define vdup_laneq_s64(vec, lane) simde_vdup_laneq_s64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint8x8_t
simde_vdup_laneq_u8(simde_uint8x16_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
return simde_vdup_n_u8(simde_uint8x16_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_u8(vec, lane) vdup_laneq_u8(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_u8(vec, lane) (__extension__ ({ \
simde_uint8x16_private simde_vdup_laneq_u8_vec_ = simde_uint8x16_to_private(vec); \
simde_uint8x8_private simde_vdup_laneq_u8_r_; \
simde_vdup_laneq_u8_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_u8_vec_.values, \
simde_vdup_laneq_u8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_uint8x8_from_private(simde_vdup_laneq_u8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_u8
#define vdup_laneq_u8(vec, lane) simde_vdup_laneq_u8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x4_t
simde_vdup_laneq_u16(simde_uint16x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdup_n_u16(simde_uint16x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_u16(vec, lane) vdup_laneq_u16(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_s16(vec, lane) (__extension__ ({ \
simde_int16x8_private simde_vdup_laneq_s16_vec_ = simde_int16x8_to_private(vec); \
simde_int16x4_private simde_vdup_laneq_s16_r_; \
simde_vdup_laneq_s16_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_s16_vec_.values, \
simde_vdup_laneq_s16_vec_.values, \
lane, lane, lane, lane \
); \
simde_int16x4_from_private(simde_vdup_laneq_s16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_u16
#define vdup_laneq_u16(vec, lane) simde_vdup_laneq_u16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t
simde_vdup_laneq_u32(simde_uint32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdup_n_u32(simde_uint32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_u32(vec, lane) vdup_laneq_u32(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_u32(vec, lane) (__extension__ ({ \
simde_uint32x4_private simde_vdup_laneq_u32_vec_ = simde_uint32x4_to_private(vec); \
simde_uint32x2_private simde_vdup_laneq_u32_r_; \
simde_vdup_laneq_u32_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_u32_vec_.values, \
simde_vdup_laneq_u32_vec_.values, \
lane, lane \
); \
simde_uint32x2_from_private(simde_vdup_laneq_u32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_u32
#define vdup_laneq_u32(vec, lane) simde_vdup_laneq_u32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint64x1_t
simde_vdup_laneq_u64(simde_uint64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdup_n_u64(simde_uint64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdup_laneq_u64(vec, lane) vdup_laneq_u64(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdup_laneq_u64(vec, lane) (__extension__ ({ \
simde_uint64x2_private simde_vdup_laneq_u64_vec_ = simde_uint64x2_to_private(vec); \
simde_uint64x1_private simde_vdup_laneq_u64_r_; \
simde_vdup_laneq_u64_r_.values = \
__builtin_shufflevector( \
simde_vdup_laneq_u64_vec_.values, \
simde_vdup_laneq_u64_vec_.values, \
lane \
); \
simde_uint64x1_from_private(simde_vdup_laneq_u64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdup_laneq_u64
#define vdup_laneq_u64(vec, lane) simde_vdup_laneq_u64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t
simde_vdupq_lane_f32(simde_float32x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdupq_n_f32(simde_float32x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_lane_f32(vec, lane) vdupq_lane_f32(vec, lane)
#elif HEDLEY_HAS_BUILTIN(__builtin_shufflevector)
#define simde_vdupq_lane_f32(vec, lane) (__extension__ ({ \
simde_float32x2_private simde_vdupq_lane_f32_vec_ = simde_float32x2_to_private(vec); \
simde_float32x4_private simde_vdupq_lane_f32_r_; \
simde_vdupq_lane_f32_r_.values = \
__builtin_shufflevector( \
simde_vdupq_lane_f32_vec_.values, \
simde_vdupq_lane_f32_vec_.values, \
lane, lane, lane, lane \
); \
simde_float32x4_from_private(simde_vdupq_lane_f32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_lane_f32
#define vdupq_lane_f32(vec, lane) simde_vdupq_lane_f32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t
simde_vdupq_laneq_f32(simde_float32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdupq_n_f32(simde_float32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_f32(vec, lane) vdupq_laneq_f32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_f32(vec, lane) (__extension__ ({ \
simde_float32x4_private simde_vdupq_laneq_f32_vec_ = simde_float32x4_to_private(vec); \
simde_float32x4_private simde_vdupq_laneq_f32_r_; \
simde_vdupq_laneq_f32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 16, \
simde_vdupq_laneq_f32_vec_.values, \
simde_vdupq_laneq_f32_vec_.values, \
lane, lane, lane, lane \
); \
simde_float32x4_from_private(simde_vdupq_laneq_f32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_f32
#define vdupq_laneq_f32(vec, lane) simde_vdupq_laneq_f32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x2_t
simde_vdupq_laneq_f64(simde_float64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdupq_n_f64(simde_float64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_f64(vec, lane) vdupq_laneq_f64(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_f64(vec, lane) (__extension__ ({ \
simde_float64x2_private simde_vdupq_laneq_f64_vec_ = simde_float64x2_to_private(vec); \
simde_float64x2_private simde_vdupq_laneq_f64_r_; \
simde_vdupq_laneq_f64_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
64, 16, \
simde_vdupq_laneq_f64_vec_.values, \
simde_vdupq_laneq_f64_vec_.values, \
lane, lane \
); \
simde_float64x2_from_private(simde_vdupq_laneq_f64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_f64
#define vdupq_laneq_f64(vec, lane) simde_vdupq_laneq_f64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int8x16_t
simde_vdupq_laneq_s8(simde_int8x16_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
return simde_vdupq_n_s8(simde_int8x16_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_s8(vec, lane) vdupq_laneq_s8(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_s8(vec, lane) (__extension__ ({ \
simde_int8x16_private simde_vdupq_laneq_s8_vec_ = simde_int8x16_to_private(vec); \
simde_int8x16_private simde_vdupq_laneq_s8_r_; \
simde_vdupq_laneq_s8_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
8, 16, \
simde_vdupq_laneq_s8_vec_.values, \
simde_vdupq_laneq_s8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_int8x16_from_private(simde_vdupq_laneq_s8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_s8
#define vdupq_laneq_s8(vec, lane) simde_vdupq_laneq_s8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int16x8_t
simde_vdupq_laneq_s16(simde_int16x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdupq_n_s16(simde_int16x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_s16(vec, lane) vdupq_laneq_s16(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_s16(vec, lane) (__extension__ ({ \
simde_int16x8_private simde_vdupq_laneq_s16_vec_ = simde_int16x8_to_private(vec); \
simde_int16x8_private simde_vdupq_laneq_s16_r_; \
simde_vdupq_laneq_s16_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
16, 16, \
simde_vdupq_laneq_s16_vec_.values, \
simde_vdupq_laneq_s16_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_int16x8_from_private(simde_vdupq_laneq_s16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_s16
#define vdupq_laneq_s16(vec, lane) simde_vdupq_laneq_s16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x4_t
simde_vdupq_laneq_s32(simde_int32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdupq_n_s32(simde_int32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_s32(vec, lane) vdupq_laneq_s32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_s32(vec, lane) (__extension__ ({ \
simde_int32x4_private simde_vdupq_laneq_s32_vec_ = simde_int32x4_to_private(vec); \
simde_int32x4_private simde_vdupq_laneq_s32_r_; \
simde_vdupq_laneq_s32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 16, \
simde_vdupq_laneq_s32_vec_.values, \
simde_vdupq_laneq_s32_vec_.values, \
lane, lane, lane, lane \
); \
simde_int32x4_from_private(simde_vdupq_laneq_s32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_s32
#define vdupq_laneq_s32(vec, lane) simde_vdupq_laneq_s32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int64x2_t
simde_vdupq_laneq_s64(simde_int64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdupq_n_s64(simde_int64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_s64(vec, lane) vdupq_laneq_s64(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_s64(vec, lane) (__extension__ ({ \
simde_int64x2_private simde_vdupq_laneq_s64_vec_ = simde_int64x2_to_private(vec); \
simde_int64x2_private simde_vdupq_laneq_s64_r_; \
simde_vdupq_laneq_s64_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
64, 16, \
simde_vdupq_laneq_s64_vec_.values, \
simde_vdupq_laneq_s64_vec_.values, \
lane, lane \
); \
simde_int64x2_from_private(simde_vdupq_laneq_s64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_s64
#define vdupq_laneq_s64(vec, lane) simde_vdupq_laneq_s64((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint8x16_t
simde_vdupq_laneq_u8(simde_uint8x16_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
return simde_vdupq_n_u8(simde_uint8x16_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_u8(vec, lane) vdupq_laneq_u8(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_u8(vec, lane) (__extension__ ({ \
simde_uint8x16_private simde_vdupq_laneq_u8_vec_ = simde_uint8x16_to_private(vec); \
simde_uint8x16_private simde_vdupq_laneq_u8_r_; \
simde_vdupq_laneq_u8_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
8, 16, \
simde_vdupq_laneq_u8_vec_.values, \
simde_vdupq_laneq_u8_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_uint8x16_from_private(simde_vdupq_laneq_u8_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_u8
#define vdupq_laneq_u8(vec, lane) simde_vdupq_laneq_u8((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x8_t
simde_vdupq_laneq_u16(simde_uint16x8_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
return simde_vdupq_n_u16(simde_uint16x8_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_u16(vec, lane) vdupq_laneq_u16(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_u16(vec, lane) (__extension__ ({ \
simde_uint16x8_private simde_vdupq_laneq_u16_vec_ = simde_uint16x8_to_private(vec); \
simde_uint16x8_private simde_vdupq_laneq_u16_r_; \
simde_vdupq_laneq_u16_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
16, 16, \
simde_vdupq_laneq_u16_vec_.values, \
simde_vdupq_laneq_u16_vec_.values, \
lane, lane, lane, lane, lane, lane, lane, lane \
); \
simde_uint16x8_from_private(simde_vdupq_laneq_u16_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_u16
#define vdupq_laneq_u16(vec, lane) simde_vdupq_laneq_u16((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t
simde_vdupq_laneq_u32(simde_uint32x4_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
return simde_vdupq_n_u32(simde_uint32x4_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_u32(vec, lane) vdupq_laneq_u32(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_u32(vec, lane) (__extension__ ({ \
simde_uint32x4_private simde_vdupq_laneq_u32_vec_ = simde_uint32x4_to_private(vec); \
simde_uint32x4_private simde_vdupq_laneq_u32_r_; \
simde_vdupq_laneq_u32_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
32, 16, \
simde_vdupq_laneq_u32_vec_.values, \
simde_vdupq_laneq_u32_vec_.values, \
lane, lane, lane, lane \
); \
simde_uint32x4_from_private(simde_vdupq_laneq_u32_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_u32
#define vdupq_laneq_u32(vec, lane) simde_vdupq_laneq_u32((vec), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint64x2_t
simde_vdupq_laneq_u64(simde_uint64x2_t vec, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
return simde_vdupq_n_u64(simde_uint64x2_to_private(vec).values[lane]);
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vdupq_laneq_u64(vec, lane) vdupq_laneq_u64(vec, lane)
#elif defined(SIMDE_SHUFFLE_VECTOR_)
#define simde_vdupq_laneq_u64(vec, lane) (__extension__ ({ \
simde_uint64x2_private simde_vdupq_laneq_u64_vec_ = simde_uint64x2_to_private(vec); \
simde_uint64x2_private simde_vdupq_laneq_u64_r_; \
simde_vdupq_laneq_u64_r_.values = \
SIMDE_SHUFFLE_VECTOR_( \
64, 16, \
simde_vdupq_laneq_u64_vec_.values, \
simde_vdupq_laneq_u64_vec_.values, \
lane, lane \
); \
simde_uint64x2_from_private(simde_vdupq_laneq_u64_r_); \
}))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdupq_laneq_u64
#define vdupq_laneq_u64(vec, lane) simde_vdupq_laneq_u64((vec), (lane))
#endif
SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP
#endif /* !defined(SIMDE_ARM_NEON_DUP_LANE_H) */
|
soedinglab/hh-suite
|
lib/simde/simde/arm/neon/dup_lane.h
|
C
|
gpl-3.0
| 31,649
|
package org.remipassmoilesel.bookme.services;
import org.remipassmoilesel.bookme.utils.Utils;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Objects;
/**
* Created by remipassmoilesel on 30/01/17.
*/
public class MerchantServiceForm {
@NotNull
@Min(0)
private double totalPrice;
@NotNull
private long id = -1;
@NotNull
@Size(max = 2000)
private String comment;
@NotNull
@Size(min = 2, max = 50)
private String customerFirstname;
@NotNull
@Size(min = 2, max = 50)
private String customerLastname;
@NotNull
@Size(min = 2, max = 50)
@Pattern(regexp = "\\+?[0-9]+")
private String customerPhonenumber;
@NotNull
private Long customerId = -1l;
@NotNull
@Pattern(regexp = "([0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{2}:[0-9]{2})?")
private String executionDate;
@NotNull
private Long serviceType = -1l;
@NotNull
private Boolean paid = false;
@NotNull
private Boolean scheduled = false;
@NotNull
private Long token;
public MerchantServiceForm() {
}
/**
* Load a service in form
*
* @param service
*/
public void load(MerchantService service) {
if (service == null) {
return;
}
setTotalPrice(service.getTotalPrice());
setId(service.getId());
if (service.getCustomer() != null) {
setCustomerId(service.getCustomer().getId());
setCustomerFirstname(service.getCustomer().getFirstname());
setCustomerLastname(service.getCustomer().getLastname());
setCustomerPhonenumber(service.getCustomer().getPhonenumber());
}
if (service.getExecutionDate() != null) {
setExecutionDate(Utils.dateToString(service.getExecutionDate(), "dd/MM/YYYY HH:mm"));
}
if (service.getServiceType() != null) {
setServiceType(service.getServiceType().getId());
}
setComment(service.getComment());
setPaid(service.isPaid());
setScheduled(service.isScheduled());
}
public double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(double totalPrice) {
this.totalPrice = totalPrice;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String getCustomerFirstname() {
return customerFirstname;
}
public void setCustomerFirstname(String customerFirstname) {
this.customerFirstname = customerFirstname;
}
public String getCustomerLastname() {
return customerLastname;
}
public void setCustomerLastname(String customerLastname) {
this.customerLastname = customerLastname;
}
public String getCustomerPhonenumber() {
return customerPhonenumber;
}
public void setCustomerPhonenumber(String customerPhonenumber) {
this.customerPhonenumber = customerPhonenumber;
}
public long getCustomerId() {
return customerId;
}
public void setCustomerId(long customerId) {
this.customerId = customerId;
}
public String getExecutionDate() {
return executionDate;
}
public void setExecutionDate(String executionDate) {
this.executionDate = executionDate;
}
public long getServiceType() {
return serviceType;
}
public void setServiceType(long serviceType) {
this.serviceType = serviceType;
}
public boolean isPaid() {
return paid;
}
public void setPaid(boolean paid) {
this.paid = paid;
}
public boolean isScheduled() {
return scheduled;
}
public void setScheduled(boolean scheduled) {
this.scheduled = scheduled;
}
public Long getToken() {
return token;
}
public void setToken(Long token) {
this.token = token;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MerchantServiceForm that = (MerchantServiceForm) o;
return totalPrice == that.totalPrice &&
id == that.id &&
customerId == that.customerId &&
serviceType == that.serviceType &&
paid == that.paid &&
scheduled == that.scheduled &&
Objects.equals(comment, that.comment) &&
Objects.equals(customerFirstname, that.customerFirstname) &&
Objects.equals(customerLastname, that.customerLastname) &&
Objects.equals(customerPhonenumber, that.customerPhonenumber) &&
Objects.equals(executionDate, that.executionDate) &&
Objects.equals(token, that.token);
}
@Override
public int hashCode() {
return Objects.hash(totalPrice, id, comment, customerFirstname, customerLastname, customerPhonenumber, customerId, executionDate, serviceType, paid, scheduled, token);
}
}
|
remipassmoilesel/simple-hostel-management
|
src/main/java/org/remipassmoilesel/bookme/services/MerchantServiceForm.java
|
Java
|
gpl-3.0
| 5,356
|
# Monkey-patch OpenSSL to skip checking the hostname of the remote certificate.
# We need to enable VERIFY_PEER in order to get hands on the remote certificate
# to check the fingerprint. But we don't care for the matching of the
# hostnames. Unfortunately this patch is apparently the only way to achieve
# that.
module OpenSSL
module SSL
def self.verify_certificate_identity(peer_cert, hostname)
Rails.logger.debug "Ignoring check for hostname (verify_certificate_identity())."
true
end
end
end
|
schleuder/schleuder-web
|
lib/openssl_ssl_patch.rb
|
Ruby
|
gpl-3.0
| 521
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MECS.Core.Engraving
{
public class EngraverPosition
{
public int X { get; set; }
public int Y { get; set; }
}
}
|
Mr-Alicates/MECS
|
MECS/MECS.Core/Engraving/EngraverPosition.cs
|
C#
|
gpl-3.0
| 270
|
#include "chessgame.h"
#include <QUrl>
#include <QQmlContext>
#include <QDebug>
#include "validator/pawnvalidator.h"
#include "validator/rookvalidator.h"
#include "validator/knightvalidator.h"
#include "validator/bishopvalidator.h"
#include "validator/queenvalidator.h"
#include "validator/kingvalidator.h"
#define HISTORY_MARKER 0xDADA
ChessGame::ChessGame(QObject *parent)
: QObject(parent)
, m_screenId(Screen_1)
, m_pEngine(nullptr)
, m_pChessboard(nullptr)
, m_lastMovedIdx(0)
{}
void ChessGame::initialize(QQmlApplicationEngine *pEngine)
{
m_pEngine = pEngine;
m_pChessboard = pEngine->rootObjects().first()->findChild<QQuickItem *>("chessboard");
foreach (QQuickItem *pItem, m_pChessboard->findChildren<QQuickItem *>(QRegExp("chesspiece\\d\\d?")))
setValidatorByIdx(pItem);
}
void ChessGame::start()
{
m_history.clear();
QMetaObject::invokeMethod(m_pChessboard, "init", Q_ARG(QVariant, true));
m_field.resetField(m_pChessboard);
m_lastMovedIdx = 0;
setScreenId(Screen_2);
qDebug("The Game is STARTED");
}
void ChessGame::stop()
{
QMetaObject::invokeMethod(m_pChessboard, "clear");
setScreenId(Screen_1);
qDebug("The Game is STOPPED");
}
void ChessGame::load(const QUrl &filepath)
{
QString name = filepath.toLocalFile();
QFile f(name);
if (!f.open(QFile::ReadOnly)) {
qDebug() << "Can't open file:" << name;
return;
}
QDataStream s(&f);
quint16 marker;
s >> marker;
if (static_cast<quint16>(HISTORY_MARKER) == marker) {
s >> m_history;
QMetaObject::invokeMethod(m_pChessboard, "init", Q_ARG(QVariant, false));
setScreenId(Screen_3);
qDebug() << "LOADED:" << name;
}
}
void ChessGame::save(const QUrl &filepath)
{
QString name = filepath.toLocalFile();
QFile f(name);
if (!f.open(QFile::WriteOnly)) {
qDebug() << "Can't open file:" << name;
return;
}
QDataStream s(&f);
s << static_cast<quint16>(HISTORY_MARKER) << m_history;
qDebug() << "SAVED:" << name;
}
bool ChessGame::prev()
{
Move *pMove = m_history.getPrev();
if (pMove) {
QQuickItem *pItem = getChessPieceByIdx(pMove->getMovedIdx());
QMetaObject::invokeMethod(pItem, "moveToCell", Q_ARG(QVariant, pMove->getBefore()));
if (pMove->getDeletedIdx()) {
QQuickItem *pDelItem = getChessPieceByIdx(pMove->getDeletedIdx());
pDelItem->setProperty("visible", true);
}
qDebug() << "PREV:" << pMove->getMovedIdx() << pMove->getBefore() << pMove->getAfter()
<< pMove->getDeletedIdx();
}
return pMove;
}
bool ChessGame::next()
{
Move *pMove = m_history.getNext();
if (pMove) {
QQuickItem *pItem = getChessPieceByIdx(pMove->getMovedIdx());
QMetaObject::invokeMethod(pItem, "moveToCell", Q_ARG(QVariant, pMove->getAfter()));
if (pMove->getDeletedIdx()) {
QQuickItem *pDelItem = getChessPieceByIdx(pMove->getDeletedIdx());
pDelItem->setProperty("visible", false);
}
qDebug() << "NEXT:" << pMove->getMovedIdx() << pMove->getBefore() << pMove->getAfter()
<< pMove->getDeletedIdx();
}
return pMove;
}
bool ChessGame::move(int sIdx, int sCell, int dCell)
{
bool isValidColor = (m_lastMovedIdx <= 16 && sIdx > 16)
|| (m_lastMovedIdx > 16 && sIdx <= 16);
int deletedIdx = 0;
if (isValidColor && m_field.makeMove(sCell, dCell, &deletedIdx)) {
m_history.addStep(Move(sIdx, sCell, dCell, deletedIdx));
m_lastMovedIdx = sIdx;
return true;
}
return false;
}
void ChessGame::setValidatorByIdx(QQuickItem *pChessPiece)
{
static IValidator *pPawnValidator = new PawnValidator(&m_field, m_pChessboard);
static IValidator *pRookValidator = new RookValidator(&m_field, m_pChessboard);
static IValidator *pKnightValidator = new KnightValidator(&m_field, m_pChessboard);
static IValidator *pBishopValidator = new BishopValidator(&m_field, m_pChessboard);
static IValidator *pQueenValidator = new QueenValidator(&m_field, m_pChessboard);
static IValidator *pKingValidator = new KingValidator(&m_field, m_pChessboard);
int idx = pChessPiece->property("idx").toInt();
if ((idx >= 9 && idx <= 16) || (idx >= 49 && idx <= 56)) {
pChessPiece->setProperty("validator", QVariant::fromValue(pPawnValidator));
}
else {
switch (idx) {
case 1: case 8: case 57: case 64:
pChessPiece->setProperty("validator", QVariant::fromValue(pRookValidator));
break;
case 2: case 7: case 58: case 63:
pChessPiece->setProperty("validator", QVariant::fromValue(pKnightValidator));
break;
case 3: case 6: case 59: case 62:
pChessPiece->setProperty("validator", QVariant::fromValue(pBishopValidator));
break;
case 4: case 60:
pChessPiece->setProperty("validator", QVariant::fromValue(pQueenValidator));
break;
case 5: case 61:
pChessPiece->setProperty("validator", QVariant::fromValue(pKingValidator));
break;
}
}
}
QQuickItem *ChessGame::getChessPieceByIdx(int idx)
{ return m_pChessboard->findChild<QQuickItem *>(QString("chesspiece%1").arg(idx)); }
|
remico/dai-chess
|
src/chessgame.cpp
|
C++
|
gpl-3.0
| 5,364
|
<?php
/**
* Dashboard - Products
*
* @package FrozrCoreLibrary
* @subpackage FrozrmarketTemplates
*/
if ( ! defined( 'ABSPATH' ) ) exit; /* Exit if accessed directly*/
frozr_redirect_login();
frozr_redirect_if_not_seller();
$action = isset( $_GET['action'] ) ? wc_clean($_GET['action']) : 'listing';
if ( $action == 'edit' ) {
frozr_get_template( FROZR_WOO_TMP . '/dish-edit.php');
} else {
frozr_get_template( FROZR_WOO_TMP . '/dishes-listing.php');
}
|
MahmudHamid/LazyEater
|
templates/dishes.php
|
PHP
|
gpl-3.0
| 471
|
/*********************************************************************
CombLayer : MCNP(X) Input builder
* File: cosaxsInc/cosaxsFrontEnd.h
*
* Copyright (c) 2004-2020 by Stuart Ansell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************/
#ifndef xraySystem_cosaxsFrontEnd_h
#define xraySystem_cosaxsFrontEnd_h
/*!
\namespace xraySystem
\brief General xray optics system
\version 1.0
\date January 2018
\author S. Ansell
*/
namespace xraySystem
{
class UTubePipe;
class Undulator;
/*!
\class cosaxsFrontEnd
\version 1.0
\author S. Ansell
\date March 2018
\brief General constructor front end optics
*/
class cosaxsFrontEnd :
public R3FrontEnd
{
private:
/// Pipe in undulator
std::shared_ptr<xraySystem::UTubePipe> undulatorPipe;
/// Undulator in vacuum box
std::shared_ptr<xraySystem::Undulator> undulator;
virtual const attachSystem::FixedComp&
buildUndulator(Simulation&,
const attachSystem::FixedComp&,const long int);
void createSurfaces();
void buildObjects(Simulation&);
virtual void createLinks();
public:
cosaxsFrontEnd(const std::string&);
cosaxsFrontEnd(const cosaxsFrontEnd&);
cosaxsFrontEnd& operator=(const cosaxsFrontEnd&);
virtual ~cosaxsFrontEnd();
};
}
#endif
|
SAnsell/CombLayer
|
Model/MaxIV/cosaxsInc/cosaxsFrontEnd.h
|
C
|
gpl-3.0
| 1,952
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Fri Nov 25 00:19:10 BRST 2016 -->
<title>Uses of Class br.com.codecode.workix.security.JAASUser</title>
<meta content="2016-11-25" name="date">
<link href="../../../../../../stylesheet.css" rel="stylesheet"
title="Style" type="text/css">
<script src="../../../../../../script.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title = "Uses of Class br.com.codecode.workix.security.JAASUser";
}
} catch (err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav">
<a name="navbar.top"> <!-- -->
</a>
<div class="skipNav">
<a href="#skip.navbar.top" title="Skip navigation links">Skip
navigation links</a>
</div>
<a name="navbar.top.firstrow"> <!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a
href="../../../../../../index.html?br/com/codecode/workix/security/class-use/JAASUser.html"
target="_top">Frames</a></li>
<li><a href="JAASUser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if (window == top) {
allClassesLink.style.display = "block";
} else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top"> <!-- -->
</a>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 class="title"
title="Uses of Class br.com.codecode.workix.security.JAASUser">
Uses of Class<br>br.com.codecode.workix.security.JAASUser
</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" class="useSummary"
summary="Use table, listing packages, and an explanation">
<caption>
<span>Packages that use <a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a></span><span
class="tabEnd"> </span>
</caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a
href="#br.com.codecode.workix.security">br.com.codecode.workix.security</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a
name="br.com.codecode.workix.security"> <!-- -->
</a>
<h3>
Uses of <a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a> in
<a
href="../../../../../../br/com/codecode/workix/security/package-summary.html">br.com.codecode.workix.security</a>
</h3>
<table border="0" cellpadding="3" cellspacing="0"
class="useSummary"
summary="Use table, listing fields, and an explanation">
<caption>
<span>Fields in <a
href="../../../../../../br/com/codecode/workix/security/package-summary.html">br.com.codecode.workix.security</a>
with type parameters of type <a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a></span><span
class="tabEnd"> </span>
</caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>
static javax.persistence.metamodel.SingularAttribute<<a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a>,java.lang.Long>
</code></td>
<td class="colLast"><span class="typeNameLabel">JAASUser_.</span>
<code>
<span class="memberNameLink"><a
href="../../../../../../br/com/codecode/workix/security/JAASUser_.html#id">id</a></span>
</code>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>
static javax.persistence.metamodel.CollectionAttribute<<a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a>,java.lang.Object>
</code></td>
<td class="colLast"><span class="typeNameLabel">JAASUser_.</span>
<code>
<span class="memberNameLink"><a
href="../../../../../../br/com/codecode/workix/security/JAASUser_.html#roles">roles</a></span>
</code>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0"
class="useSummary"
summary="Use table, listing methods, and an explanation">
<caption>
<span>Methods in <a
href="../../../../../../br/com/codecode/workix/security/package-summary.html">br.com.codecode.workix.security</a>
that return <a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a></span><span
class="tabEnd"> </span>
</caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>
<a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a>
</code></td>
<td class="colLast"><span class="typeNameLabel">CurrentUserMB.</span>
<code>
<span class="memberNameLink"><a
href="../../../../../../br/com/codecode/workix/security/CurrentUserMB.html#get--">get</a></span>()
</code>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>
<a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">JAASUser</a>
</code></td>
<td class="colLast"><span class="typeNameLabel">SecurityDao.</span>
<code>
<span class="memberNameLink"><a
href="../../../../../../br/com/codecode/workix/security/SecurityDao.html#loadUserByUsername-java.lang.String-">loadUserByUsername</a></span>(java.lang.String userName)
</code>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav">
<a name="navbar.bottom"> <!-- -->
</a>
<div class="skipNav">
<a href="#skip.navbar.bottom" title="Skip navigation links">Skip
navigation links</a>
</div>
<a name="navbar.bottom.firstrow"> <!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a
href="../../../../../../br/com/codecode/workix/security/JAASUser.html"
title="class in br.com.codecode.workix.security">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a
href="../../../../../../index.html?br/com/codecode/workix/security/class-use/JAASUser.html"
target="_top">Frames</a></li>
<li><a href="JAASUser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if (window == top) {
allClassesLink.style.display = "block";
} else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom"> <!-- -->
</a>
</div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
frmichetti/workix
|
src/main/webapp/static/workix-static-demo/docs/java-docs/br/com/codecode/workix/security/class-use/JAASUser.html
|
HTML
|
gpl-3.0
| 12,638
|
$(function(){$('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var t=$(this.hash);if((t=t.length?t:$("[name="+this.hash.slice(1)+"]")).length)return $("html, body").animate({scrollTop:t.offset().top},500),!1}})});
|
david-ma/Thalia
|
websites/example/public/js/scripts.min.js
|
JavaScript
|
gpl-3.0
| 321
|
window.saveData = function (key, data) {
if(!localStorage.savedData)
localStorage.savedData = JSON.stringify({});
var savedData = JSON.parse(localStorage.savedData)
var type = typeof data;
savedData[key] = {
type: type,
data: (type === 'object') ? JSON.stringify(data) : data
};
localStorage.savedData = JSON.stringify(savedData);
}
window.getData = function (key) {
var savedData = JSON.parse(localStorage.savedData)
if(savedData[key] !== undefined) {
var value = savedData[key];
if(value.type === 'number') {
return parseFloat(value.data)
} else if (value.type === 'string') {
return value.data;
} else if (value.type === 'object') {
return JSON.parse(value.data);
}
} else {
throw (new Error(key + " does not exist in saved data."))
}
}
|
zrispo/wick
|
lib/localstoragewrapper.js
|
JavaScript
|
gpl-3.0
| 780
|
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// SCHED_SHMEM is the structure of a chunk of memory shared between
// the feeder (which reads from the database)
// and instances of the scheduling server
#include "config.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
using std::vector;
#include "boinc_db.h"
#include "error_numbers.h"
#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
#endif
#include "sched_config.h"
#include "sched_msgs.h"
#include "sched_types.h"
#include "sched_util.h"
#include "sched_shmem.h"
void SCHED_SHMEM::init(int nwu_results) {
int size = sizeof(SCHED_SHMEM) + nwu_results*sizeof(WU_RESULT);
memset(this, 0, size);
ss_size = size;
platform_size = sizeof(PLATFORM);
app_size = sizeof(APP);
app_version_size = sizeof(APP_VERSION);
assignment_size = sizeof(ASSIGNMENT);
wu_result_size = sizeof(WU_RESULT);
max_platforms = MAX_PLATFORMS;
max_apps = MAX_APPS;
max_app_versions = MAX_APP_VERSIONS;
max_assignments = MAX_ASSIGNMENTS;
max_wu_results = nwu_results;
}
static int error_return(const char* p) {
fprintf(stderr, "Error in structure: %s\n", p);
return ERR_SCHED_SHMEM;
}
int SCHED_SHMEM::verify() {
int size = sizeof(SCHED_SHMEM) + max_wu_results*sizeof(WU_RESULT);
if (ss_size != size) return error_return("shmem");
if (platform_size != sizeof(PLATFORM)) return error_return("platform");
if (app_size != sizeof(APP)) return error_return("app");
if (app_version_size != sizeof(APP_VERSION)) return error_return("app_version");
if (assignment_size != sizeof(ASSIGNMENT)) return error_return("assignment");
if (wu_result_size != sizeof(WU_RESULT)) return error_return("wu_result");
if (max_platforms != MAX_PLATFORMS) return error_return("max platform");
if (max_apps != MAX_APPS) return error_return("max apps");
if (max_app_versions != MAX_APP_VERSIONS) return error_return("max app versions");
if (max_assignments != MAX_ASSIGNMENTS) return error_return("max assignments");
return 0;
}
static void overflow(const char* table, const char* param_name) {
log_messages.printf(MSG_CRITICAL,
"The SCHED_SHMEM structure is too small for the %s table.\n"
"Either increase the %s parameter in sched_shmem.h and recompile,\n"
"or prune old rows from the table.\n"
"Then restart the project.\n",
table, param_name
);
exit(1);
}
int SCHED_SHMEM::scan_tables() {
DB_PLATFORM platform;
DB_APP app;
DB_APP_VERSION app_version;
DB_ASSIGNMENT assignment;
int i, j, n;
n = 0;
while (!platform.enumerate()) {
if (platform.deprecated) continue;
platforms[n++] = platform;
if (n == MAX_PLATFORMS) {
overflow("platforms", "MAX_PLATFORMS");
}
}
nplatforms = n;
n = 0;
app_weight_sum = 0;
while (!app.enumerate()) {
if (app.deprecated) continue;
apps[n++] = app;
if (n == MAX_APPS) {
overflow("apps", "MAX_APPS");
}
app_weight_sum += app.weight;
if (app.locality_scheduling == LOCALITY_SCHED_LITE) {
locality_sched_lite = true;
}
if (app.non_cpu_intensive) {
have_nci_app = true;
}
if (config.non_cpu_intensive) {
have_nci_app = true;
app.non_cpu_intensive = true;
}
}
napps = n;
n = 0;
// for each (app, platform) pair,
// get all versions with numbers maximal in their plan class.
//
for (i=0; i<nplatforms; i++) {
PLATFORM& splatform = platforms[i];
for (j=0; j<napps; j++) {
APP& sapp = apps[j];
vector<APP_VERSION> avs;
char query[1024];
sprintf(query,
"where appid=%d and platformid=%d and deprecated=0",
sapp.id, splatform.id
);
while (!app_version.enumerate(query)) {
avs.push_back(app_version);
}
for (unsigned int k=0; k<avs.size(); k++) {
APP_VERSION& av1 = avs[k];
for (unsigned int kk=0; kk<avs.size(); kk++) {
if (k == kk) continue;
APP_VERSION& av2 = avs[kk];
if (!strcmp(av1.plan_class, av2.plan_class) && av1.version_num > av2.version_num) {
av2.deprecated = 1;
}
}
}
for (unsigned int k=0; k<avs.size(); k++) {
APP_VERSION& av1 = avs[k];
if (av1.deprecated) continue;
if (av1.min_core_version && av1.min_core_version < 10000) {
fprintf(stderr, "min core version too small - multiplying by 100\n");
av1.min_core_version *= 100;
}
if (av1.max_core_version && av1.max_core_version < 10000) {
fprintf(stderr, "max core version too small - multiplying by 100\n");
av1.max_core_version *= 100;
}
app_versions[n++] = av1;
if (n == MAX_APP_VERSIONS) {
overflow("app_versions", "MAX_APP_VERSIONS");
}
}
}
}
napp_versions = n;
// see which resources we have app versions for
//
for (i=0; i<NPROC_TYPES; i++) {
have_apps_for_proc_type[i] = false;
}
for (i=0; i<napp_versions; i++) {
APP_VERSION& av = app_versions[i];
if (strstr(av.plan_class, "cuda") || strstr(av.plan_class, "nvidia")) {
have_apps_for_proc_type[PROC_TYPE_NVIDIA_GPU] = true;
} else if (strstr(av.plan_class, "ati")) {
have_apps_for_proc_type[PROC_TYPE_AMD_GPU] = true;
} else if (strstr(av.plan_class, "intel_gpu")) {
have_apps_for_proc_type[PROC_TYPE_INTEL_GPU] = true;
} else {
have_apps_for_proc_type[PROC_TYPE_CPU] = true;
}
}
n = 0;
while (!assignment.enumerate("where multi <> 0")) {
assignments[n++] = assignment;
if (n == MAX_ASSIGNMENTS) {
overflow("assignments", "MAX_ASSIGNMENTS");
}
}
nassignments = n;
return 0;
}
PLATFORM* SCHED_SHMEM::lookup_platform(char* name) {
for (int i=0; i<nplatforms; i++) {
if (!strcmp(platforms[i].name, name)) {
return &platforms[i];
}
}
return NULL;
}
PLATFORM* SCHED_SHMEM::lookup_platform_id(int id) {
for (int i=0; i<nplatforms; i++) {
if (platforms[i].id == id) return &platforms[i];
}
return NULL;
}
APP* SCHED_SHMEM::lookup_app(int id) {
for (int i=0; i<napps; i++) {
if (apps[i].id == id) return &apps[i];
}
return NULL;
}
APP* SCHED_SHMEM::lookup_app_name(char* name) {
for (int i=0; i<napps; i++) {
if (!strcmp(name, apps[i].name)) return &apps[i];
}
return NULL;
}
APP_VERSION* SCHED_SHMEM::lookup_app_version(int id) {
APP_VERSION* avp;
for (int i=0; i<napp_versions; i++) {
avp = &app_versions[i];
if (avp->id == id) {
return avp;
}
}
return NULL;
}
APP_VERSION* SCHED_SHMEM::lookup_app_version_platform_plan_class(
int platformid, char* plan_class
) {
APP_VERSION* avp;
for (int i=0; i<napp_versions; i++) {
avp = &app_versions[i];
if (avp->platformid == platformid && !strcmp(avp->plan_class, plan_class)) {
return avp;
}
}
return NULL;
}
// see if there's any work.
// If there is, reserve it for this process
// (if we don't do this, there's a race condition where lots
// of servers try to get a single work item)
//
bool SCHED_SHMEM::no_work(int pid) {
if (!ready) return true;
for (int i=0; i<max_wu_results; i++) {
if (wu_results[i].state == WR_STATE_PRESENT) {
wu_results[i].state = pid;
return false;
}
}
return true;
}
void SCHED_SHMEM::restore_work(int pid) {
for (int i=0; i<max_wu_results; i++) {
if (wu_results[i].state == pid) {
wu_results[i].state = WR_STATE_PRESENT;
return;
}
}
}
void SCHED_SHMEM::show(FILE* f) {
fprintf(f, "app versions:\n");
for (int i=0; i<napp_versions; i++) {
APP_VERSION av = app_versions[i];
fprintf(f, "appid: %d platformid: %d version_num: %d plan_class: %s\n",
av.appid, av.platformid, av.version_num, av.plan_class
);
}
for (int i=0; i<NPROC_TYPES; i++) {
fprintf(f,
"have %s apps: %s\n",
proc_type_name(i),
have_apps_for_proc_type[i]?"yes":"no"
);
}
fprintf(f,
"Jobs; key:\n"
"ap: app ID\n"
"ic: infeasible count\n"
"wu: workunit ID\n"
"rs: result ID\n"
"hr: HR class\n"
"nr: need reliable\n"
);
fprintf(f,
"host fpops mean %f stddev %f\n",
perf_info.host_fpops_mean, perf_info.host_fpops_stddev
);
fprintf(f,
"host fpops 50th pctile %f 95th pctile %f\n",
perf_info.host_fpops_50_percentile, perf_info.host_fpops_95_percentile
);
fprintf(f, "ready: %d\n", ready);
fprintf(f, "max_wu_results: %d\n", max_wu_results);
for (int i=0; i<max_wu_results; i++) {
if (i%24 == 0) {
fprintf(f,
"%4s %12s %10s %10s %10s %8s %10s %8s %12s %12s %9s\n",
"slot",
"app",
"WU ID",
"result ID",
"batch",
"HR class",
"priority",
"in shmem",
"size (stdev)",
"need reliable",
"inf count"
);
}
WU_RESULT& wu_result = wu_results[i];
APP* app;
const char* appname;
int delta_t;
switch(wu_result.state) {
case WR_STATE_PRESENT:
app = lookup_app(wu_result.workunit.appid);
appname = app?app->name:"missing";
delta_t = dtime() - wu_result.time_added_to_shared_memory;
fprintf(f,
"%4d %12.12s %10d %10d %10d %8d %10d %7ds %12f %12s %9d\n",
i,
appname,
wu_result.workunit.id,
wu_result.resultid,
wu_result.workunit.batch,
wu_result.workunit.hr_class,
wu_result.res_priority,
delta_t,
wu_result.fpops_size,
wu_result.need_reliable?"yes":"no",
wu_result.infeasible_count
);
break;
case WR_STATE_EMPTY:
fprintf(f, "%4d: ---\n", i);
break;
default:
fprintf(f, "%4d: PID %d: result %u\n", i, wu_result.state, wu_result.resultid);
}
}
}
const char *BOINC_RCSID_e548c94703 = "$Id$";
|
MestreLion/boinc-debian
|
sched/sched_shmem.cpp
|
C++
|
gpl-3.0
| 11,690
|
import request from '@/utils/request'
export function fetchCommon() {
return request({
url: '/setting/common/cron/',
method: 'get'
})
}
export function editCommon(formData) {
const data = formData
return request({
url: '/setting/common/cron/',
method: 'put',
data
})
}
export function fetchBotedu() {
return request({
url: '/setting/botedu/cron/',
method: 'get'
})
}
export function editBotedu(formData) {
const data = formData
return request({
url: '/setting/botedu/cron/',
method: 'put',
data
})
}
export function fetchStats() {
return request({
url: '/setting/stats/cron/',
method: 'get'
})
}
export function editStats(formData) {
const data = formData
return request({
url: '/setting/stats/cron/',
method: 'put',
data
})
}
|
wdxtub/Patriots
|
frontend/src/api/setting.js
|
JavaScript
|
gpl-3.0
| 823
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace QTTabBarLib {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources_Image {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources_Image() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QTTabBarLib.Resources_Image", typeof(Resources_Image).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
public static System.Drawing.Bitmap ButtonStrip16 {
get {
object obj = ResourceManager.GetObject("ButtonStrip16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap ButtonStrip24 {
get {
object obj = ResourceManager.GetObject("ButtonStrip24", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Icon icoEmpty {
get {
object obj = ResourceManager.GetObject("icoEmpty", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
public static System.Drawing.Icon icoOption {
get {
object obj = ResourceManager.GetObject("icoOption", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
public static System.Drawing.Bitmap imgBack {
get {
object obj = ResourceManager.GetObject("imgBack", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCapture {
get {
object obj = ResourceManager.GetObject("imgCapture", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCloseButton_Cold {
get {
object obj = ResourceManager.GetObject("imgCloseButton_Cold", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCloseButton_ColdAlt {
get {
object obj = ResourceManager.GetObject("imgCloseButton_ColdAlt", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCloseButton_Hot {
get {
object obj = ResourceManager.GetObject("imgCloseButton_Hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCloseButton_Press {
get {
object obj = ResourceManager.GetObject("imgCloseButton_Press", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCurrent {
get {
object obj = ResourceManager.GetObject("imgCurrent", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCurTabCloning {
get {
object obj = ResourceManager.GetObject("imgCurTabCloning", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgCurTabDrag {
get {
object obj = ResourceManager.GetObject("imgCurTabDrag", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgFolIconBG {
get {
object obj = ResourceManager.GetObject("imgFolIconBG", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgForward {
get {
object obj = ResourceManager.GetObject("imgForward", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgGroupRoot {
get {
object obj = ResourceManager.GetObject("imgGroupRoot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgInsertL {
get {
object obj = ResourceManager.GetObject("imgInsertL", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgInsertR {
get {
object obj = ResourceManager.GetObject("imgInsertR", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgLocked {
get {
object obj = ResourceManager.GetObject("imgLocked", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgNavBack {
get {
object obj = ResourceManager.GetObject("imgNavBack", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgNavFwd {
get {
object obj = ResourceManager.GetObject("imgNavFwd", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgNewTab {
get {
object obj = ResourceManager.GetObject("imgNewTab", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgNewWindow {
get {
object obj = ResourceManager.GetObject("imgNewWindow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgNoCapture {
get {
object obj = ResourceManager.GetObject("imgNoCapture", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgOptions_Hot {
get {
object obj = ResourceManager.GetObject("imgOptions_Hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgOptions_NoFocus {
get {
object obj = ResourceManager.GetObject("imgOptions_NoFocus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgOptions_SelAndHot {
get {
object obj = ResourceManager.GetObject("imgOptions_SelAndHot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgOptions_Selected {
get {
object obj = ResourceManager.GetObject("imgOptions_Selected", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgPlugin16 {
get {
object obj = ResourceManager.GetObject("imgPlugin16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgPlugin24 {
get {
object obj = ResourceManager.GetObject("imgPlugin24", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgSubDirBtnCold {
get {
object obj = ResourceManager.GetObject("imgSubDirBtnCold", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgSubDirBtnPress {
get {
object obj = ResourceManager.GetObject("imgSubDirBtnPress", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabAbout {
get {
object obj = ResourceManager.GetObject("imgTabAbout", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabApps {
get {
object obj = ResourceManager.GetObject("imgTabApps", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabBBar {
get {
object obj = ResourceManager.GetObject("imgTabBBar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabDeskop {
get {
object obj = ResourceManager.GetObject("imgTabDeskop", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabGroups {
get {
object obj = ResourceManager.GetObject("imgTabGroups", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabKeys {
get {
object obj = ResourceManager.GetObject("imgTabKeys", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabLang {
get {
object obj = ResourceManager.GetObject("imgTabLang", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabMisc {
get {
object obj = ResourceManager.GetObject("imgTabMisc", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabMouse {
get {
object obj = ResourceManager.GetObject("imgTabMouse", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabPlugin {
get {
object obj = ResourceManager.GetObject("imgTabPlugin", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabSkin {
get {
object obj = ResourceManager.GetObject("imgTabSkin", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabTabs {
get {
object obj = ResourceManager.GetObject("imgTabTabs", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabTooltips {
get {
object obj = ResourceManager.GetObject("imgTabTooltips", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabTweaks {
get {
object obj = ResourceManager.GetObject("imgTabTweaks", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgTabWindow {
get {
object obj = ResourceManager.GetObject("imgTabWindow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgUserAppsRoot {
get {
object obj = ResourceManager.GetObject("imgUserAppsRoot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_Check {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_Check", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LB {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LB", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LB_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LB_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LM {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LM_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LM_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LT {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LT", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_LT_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_LT_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MB {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MB", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MB_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MB_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MM {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MM_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MM_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MT {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MT", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_MT_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_MT_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RB {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RB", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RB_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RB_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RM {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RM_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RM_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RT {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RT", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap imgVistaMenu_RT_hot {
get {
object obj = ResourceManager.GetObject("imgVistaMenu_RT_hot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap menuClose {
get {
object obj = ResourceManager.GetObject("menuClose", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap menuOpen {
get {
object obj = ResourceManager.GetObject("menuOpen", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap paypalBtn {
get {
object obj = ResourceManager.GetObject("paypalBtn", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap TitleBar {
get {
object obj = ResourceManager.GetObject("TitleBar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
|
svn2github/QTTabBar
|
QTTabBar/Resources_Image.Designer.cs
|
C#
|
gpl-3.0
| 21,577
|
package net.BukkitPE.item.enchantment.bow;
import net.BukkitPE.item.enchantment.Enchantment;
/**
* BukkitPE Project
*/
public class EnchantmentBowInfinity extends EnchantmentBow {
public EnchantmentBowInfinity() {
super(Enchantment.ID_BOW_INFINITY, "arrowInfinite", 1);
}
@Override
public int getMinEnchantAbility(int level) {
return 20;
}
@Override
public int getMaxEnchantAbility(int level) {
return 50;
}
@Override
public int getMaxLevel() {
return 1;
}
}
|
BukkitPE/BukkitPE
|
src/main/java/net/BukkitPE/item/enchantment/bow/EnchantmentBowInfinity.java
|
Java
|
gpl-3.0
| 542
|
class AddStatusToUsers < ActiveRecord::Migration
def self.up
add_column :users, :status, :string, :default => "U"
remove_column :users, :approved
end
def self.down
remove_column :users, :status
add_column :users, :approved, :boolean, :default => false
end
end
|
IntersectAustralia/nedb
|
db/migrate/20101015032903_add_status_to_users.rb
|
Ruby
|
gpl-3.0
| 285
|
#include <stdlib.h>
#include <iostream>
#include "boats/FloatingObject.hpp"
using namespace std;
// Quelques conseils avant de commencer...
// * N'oubliez pas de tracer (cout << ...) tous les constructeurs et le destructeur !!! Ca, c'est pas un conseil,
// c'est obligatoire :-)
// * N'essayez pas de compiler ce programme entierement immediatement. Mettez tout en commentaires
// sauf le point (1) et creez votre classe (dans ce fichier pour commencer) afin de compiler et tester
// le point (1). Une fois que cela fonctionne, decommentez le point (2) et modifier votre classe en
// consequence. Vous developpez, compilez et testez donc etape par etape. N'attendez pas d'avoir encode
// 300 lignes pour compiler...
// * Une fois que tout le programme compile et fonctionne correctement, creez le .h contenant la declaration
// de la classe, le .cxx contenant la definition des methodes, et ensuite le makefile permettant de compiler
// le tout grace a la commande make
int main()
{
cout << endl << "(1) ***** Test constructeur par defaut + affiche *****" << endl;
{
FloatingObject objetFlottant;
objetFlottant.display();
} // La presence des accolades assure que le destructeur de avion sera appele --> a tracer !
cout << endl << "(2) ***** Test des setters et getters *****" << endl;
{
FloatingObject objetFlottant;
objetFlottant.setIdentifier("HC-1716");
objetFlottant.setModel("HobieCat16Easy");
objetFlottant.display();
cout << "Identifiant = " << objetFlottant.getIdentifier() << endl;
cout << "Modele = " << objetFlottant.getModel() << endl;
}
cout << endl << "(3) ***** Test du constructeur d'initialisation *****" << endl;
{
FloatingObject objetFlottant("HC-1821","HobieCat21Hard");
objetFlottant.display();
}
cout << endl << "(4) ***** Test du constructeur de copie *****" << endl;
{
FloatingObject objetFlottant1("HC-2110","HobieCat10Easy");
cout << "objetFlottant1 (AVANT) :" << endl;
objetFlottant1.display();
{
FloatingObject objetFlottant2(objetFlottant1);
cout << "objetFlottant2 :" << endl;
objetFlottant2.display();
objetFlottant2.setIdentifier("HC-2112");
objetFlottant2.display();
} // de nouveau, les {} assurent que objetFlottant2 sera detruit avant la suite
cout << "objetFlottant1 (APRES) :" << endl;
objetFlottant1.display();
}
cout << endl << "(5) ***** Test d'allocation dynamique (constructeur par defaut) *****" << endl;
{
FloatingObject *p = new FloatingObject();
p->setIdentifier("BI-4115");
p->setModel("BicCat15Easy");
p->display();
cout << "Le modele de cet objet flottant est : " << p->getModel() << endl;
delete p;
}
cout << endl << "(6) ***** Test d'allocation dynamique (constructeur de copie) *****" << endl;
{
FloatingObject objetFlottant1("BI-7415","BicCat21Hard");
cout << "objetFlottant1 (AVANT) :" << endl;
objetFlottant1.display();
FloatingObject* p = new FloatingObject(objetFlottant1);
cout << "La copie :" << endl;
p->display();
cout << "Destruction de la copie..." << endl;
delete p;
cout << "objetFlottant1 (APRES) :" << endl;
objetFlottant1.display();
}
return 0;
}
|
bendem/SchoolBoats
|
Test1.cpp
|
C++
|
gpl-3.0
| 3,245
|
package com.creativemd.opf.gui;
import java.util.ArrayList;
import com.creativemd.creativecore.common.gui.GuiRenderHelper;
import com.creativemd.creativecore.common.gui.client.style.ColoredDisplayStyle;
import com.creativemd.creativecore.common.gui.client.style.Style;
import com.creativemd.creativecore.common.gui.controls.gui.GuiTextfield;
import com.creativemd.opf.OPFrame;
import com.google.common.collect.Lists;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
public class GuiUrlTextfield extends GuiTextfield {
public static final Style DISABLED = new Style("disabled", new ColoredDisplayStyle(50, 0, 0), new ColoredDisplayStyle(150, 90, 90), new ColoredDisplayStyle(180, 100, 100), new ColoredDisplayStyle(220, 198, 198), new ColoredDisplayStyle(50, 0, 0, 100));
public static final Style WARNING = new Style("warning", new ColoredDisplayStyle(50, 50, 0), new ColoredDisplayStyle(150, 150, 90), new ColoredDisplayStyle(180, 180, 100), new ColoredDisplayStyle(220, 220, 198), new ColoredDisplayStyle(50, 50, 0, 100));
private SubGuiPic gui;
public GuiUrlTextfield(SubGuiPic gui, String name, String text, int x, int y, int width, int height) {
super(name, text, x, y, width, height);
this.gui = gui;
}
@Override
protected void renderBackground(GuiRenderHelper helper, Style style) {
if (!canUse(true)) {
style = OPFrame.CONFIG.whitelistEnabled ? DISABLED : WARNING;
}
super.renderBackground(helper, style);
}
@Override
public boolean onKeyPressed(char character, int key) {
boolean pressed = super.onKeyPressed(character, key);
gui.save.setEnabled(canUse(false));
return pressed;
}
@Override
public ArrayList<String> getTooltip() {
if (!canUse(false)) {
return Lists.newArrayList(TextFormatting.RED.toString() + TextFormatting.BOLD.toString() + I18n.translateToLocal("label.opframe.not_whitelisted.name"));
} else if (!canUse(true)) {
return Lists.newArrayList(TextFormatting.GOLD + I18n.translateToLocal("label.opframe.whitelist_warning.name"));
}
return Lists.newArrayList();
}
protected boolean canUse(boolean ignoreToggle) {
return OPFrame.CONFIG.canUse(mc.player, text, ignoreToggle);
}
}
|
CreativeMD/OnlinePictureFrame
|
src/main/java/com/creativemd/opf/gui/GuiUrlTextfield.java
|
Java
|
gpl-3.0
| 2,213
|
const errorHandler = require('../../../src/controllers/middlewares/error')
describe('Error Handler', () => {
describe('with generic error', () => {
const error = {
code: '007',
stack: 'StackTrace',
}
const req = { id: 'request_id' }
const res = {
locals: {},
}
const next = () => {}
errorHandler(error, req, res, next)
test('should include standard error payload on `res.locals`', () => {
expect(res.locals.payload).toMatchObject({
type: 'error',
statusCode: 500,
data: [{
message: 'Internal server error',
type: 'internal_server_error',
code: '007',
}],
})
})
})
describe('with custom made error', () => {
const error = {
type: 'fake_error',
statusCode: 418,
message: 'I\'m a teapot',
code: '007',
stack: 'StackTrace',
}
const req = { id: 'request_id' }
const res = {
locals: {},
}
const next = () => {}
errorHandler(error, req, res, next)
test('should include standard error payload on `res.locals`', () => {
expect(res.locals.payload).toMatchObject({
type: 'error',
statusCode: 418,
data: [{
message: 'I\'m a teapot',
type: 'fake_error',
code: '007',
}],
})
})
})
describe('with validation error', () => {
const error = {
type: 'validation',
statusCode: 400,
fields: [{
type: 'invalid_field',
message: 'This field is invalid',
field: 'fake_field',
}],
stack: 'StackTrace',
}
const req = { id: 'request_id' }
const res = {
locals: {},
}
const next = () => {}
errorHandler(error, req, res, next)
test('should include standard error payload on `res.locals`', () => {
expect(res.locals.payload).toMatchObject({
type: 'error',
statusCode: 400,
data: [{
message: 'This field is invalid',
type: 'invalid_field',
field: 'fake_field',
}],
})
})
})
})
|
hails/tane
|
tests/unit/middlewares/error.test.js
|
JavaScript
|
gpl-3.0
| 2,113
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
<meta name="description" content="ESID - European Social innovation database">
<meta name="keywords" content="social media, social media following">
<meta name="author" content="Nikola Milošević">
<meta property="og:title" content="SocialSpy - A framework for following information on social media">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
</style>
<title>ESID</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
</head>
<body>
<div id="content_text">
Project successfully added.
</div>
<!-- FOOTER -->
<div class="navbar-inverse navbar-fixed-bottom">
<div style="text-align: center; color: white;">
<p class="small">Developed at <a href="http://www.research.mbs.ac.uk/innovation" target="_blank">Manchester Institute of Innovation Research, The University of Manchester</a></p>
</div>
</div>
</body>
</html>
|
EuropeanSocialInnovationDatabase/ESID-main
|
WebInterfaces/templates/success.html
|
HTML
|
gpl-3.0
| 1,619
|
<?php
echo file_get_contents(HERE."install".DS."install-header.html");
if (URI == "install") {
inc("install".DS."install");
} else {
inc("install".DS."must-install");
}
?>
|
mkg20001/website-cms
|
sys/install/index.php
|
PHP
|
gpl-3.0
| 174
|
package com.mycompany.control;
import com.mycompany.entidades.Demanda;
import com.mycompany.control.util.JsfUtil;
import com.mycompany.control.util.PaginationHelper;
import com.mycompany.facade.DemandaFacade;
import java.io.Serializable;
import java.util.ResourceBundle;
import javax.ejb.EJB;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem;
@Named("demandaController")
@SessionScoped
public class DemandaController implements Serializable {
private Demanda current;
private DataModel items = null;
@EJB
private com.mycompany.facade.DemandaFacade ejbFacade;
private PaginationHelper pagination;
private int selectedItemIndex;
public DemandaController() {
}
public Demanda getSelected() {
if (current == null) {
current = new Demanda();
selectedItemIndex = -1;
}
return current;
}
private DemandaFacade getFacade() {
return ejbFacade;
}
public PaginationHelper getPagination() {
if (pagination == null) {
pagination = new PaginationHelper(10) {
@Override
public int getItemsCount() {
return getFacade().count();
}
@Override
public DataModel createPageDataModel() {
return new ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(), getPageFirstItem() + getPageSize()}));
}
};
}
return pagination;
}
public String prepareList() {
recreateModel();
return "List";
}
public String prepareView() {
current = (Demanda) getItems().getRowData();
selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
return "View";
}
public String prepareCreate() {
current = new Demanda();
selectedItemIndex = -1;
return "Create";
}
public String create() {
try {
getFacade().create(current);
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("DemandaCreated"));
return prepareCreate();
} catch (Exception e) {
JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
return null;
}
}
public String prepareEdit() {
current = (Demanda) getItems().getRowData();
selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
return "Edit";
}
public String update() {
try {
getFacade().edit(current);
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("DemandaUpdated"));
return "View";
} catch (Exception e) {
JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
return null;
}
}
public String destroy() {
current = (Demanda) getItems().getRowData();
selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
performDestroy();
recreatePagination();
recreateModel();
return "List";
}
public String destroyAndView() {
performDestroy();
recreateModel();
updateCurrentItem();
if (selectedItemIndex >= 0) {
return "View";
} else {
// all items were removed - go back to list
recreateModel();
return "List";
}
}
private void performDestroy() {
try {
getFacade().remove(current);
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("DemandaDeleted"));
} catch (Exception e) {
JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
}
}
private void updateCurrentItem() {
int count = getFacade().count();
if (selectedItemIndex >= count) {
// selected index cannot be bigger than number of items:
selectedItemIndex = count - 1;
// go to previous page if last page disappeared:
if (pagination.getPageFirstItem() >= count) {
pagination.previousPage();
}
}
if (selectedItemIndex >= 0) {
current = getFacade().findRange(new int[]{selectedItemIndex, selectedItemIndex + 1}).get(0);
}
}
public DataModel getItems() {
if (items == null) {
items = getPagination().createPageDataModel();
}
return items;
}
private void recreateModel() {
items = null;
}
private void recreatePagination() {
pagination = null;
}
public String next() {
getPagination().nextPage();
recreateModel();
return "List";
}
public String previous() {
getPagination().previousPage();
recreateModel();
return "List";
}
public SelectItem[] getItemsAvailableSelectMany() {
return JsfUtil.getSelectItems(ejbFacade.findAll(), false);
}
public SelectItem[] getItemsAvailableSelectOne() {
return JsfUtil.getSelectItems(ejbFacade.findAll(), true);
}
public Demanda getDemanda(java.lang.Integer id) {
return ejbFacade.find(id);
}
@FacesConverter(forClass = Demanda.class)
public static class DemandaControllerConverter implements Converter {
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0) {
return null;
}
DemandaController controller = (DemandaController) facesContext.getApplication().getELResolver().
getValue(facesContext.getELContext(), null, "demandaController");
return controller.getDemanda(getKey(value));
}
java.lang.Integer getKey(String value) {
java.lang.Integer key;
key = Integer.valueOf(value);
return key;
}
String getStringKey(java.lang.Integer value) {
StringBuilder sb = new StringBuilder();
sb.append(value);
return sb.toString();
}
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null) {
return null;
}
if (object instanceof Demanda) {
Demanda o = (Demanda) object;
return getStringKey(o.getIdDemanda());
} else {
throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: " + Demanda.class.getName());
}
}
}
}
|
OscarMiticanoy/NuestraPLaza-java
|
NuestraPlaza/src/main/java/com/mycompany/control/DemandaController.java
|
Java
|
gpl-3.0
| 7,210
|
#ifndef SystemEnums_H
#define SystemEnums_H
namespace Andromeda
{
namespace System
{
enum PlatformTypeEnum
{
Windows,
Vita,
Android
};
}
}
#endif
|
DrakonPL/Andromeda
|
Andromeda/System/SystemEnums.h
|
C
|
gpl-3.0
| 166
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Abide.HaloLibrary.Halo2.Retail.Tag.Generated
{
using System;
using Abide.HaloLibrary;
using Abide.HaloLibrary.Halo2.Retail.Tag;
/// <summary>
/// Represents the generated grenade_hud_sound_block tag block.
/// </summary>
public sealed class GrenadeHudSoundBlock : Block
{
/// <summary>
/// Initializes a new instance of the <see cref="GrenadeHudSoundBlock"/> class.
/// </summary>
public GrenadeHudSoundBlock()
{
this.Fields.Add(new TagReferenceField("sound^", -3));
this.Fields.Add(new LongFlagsField("latched to", "low grenade count", "no grenades left", "throw on no grenades"));
this.Fields.Add(new RealField("scale"));
this.Fields.Add(new PadField("", 32));
}
/// <summary>
/// Gets and returns the name of the grenade_hud_sound_block tag block.
/// </summary>
public override string BlockName
{
get
{
return "grenade_hud_sound_block";
}
}
/// <summary>
/// Gets and returns the display name of the grenade_hud_sound_block tag block.
/// </summary>
public override string DisplayName
{
get
{
return "grenade_hud_sound_block";
}
}
/// <summary>
/// Gets and returns the maximum number of elements allowed of the grenade_hud_sound_block tag block.
/// </summary>
public override int MaximumElementCount
{
get
{
return 12;
}
}
/// <summary>
/// Gets and returns the alignment of the grenade_hud_sound_block tag block.
/// </summary>
public override int Alignment
{
get
{
return 4;
}
}
}
}
|
MikeMatt16/Abide
|
Abide Tag Definitions/Generated/Library/GrenadeHudSoundBlock.Generated.cs
|
C#
|
gpl-3.0
| 2,335
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Abide.Tag.Guerilla.Generated
{
using System;
using Abide.HaloLibrary;
using Abide.Tag;
/// <summary>
/// Represents the generated hud_globals (hudg) tag group.
/// </summary>
public class HudGlobals : Group
{
/// <summary>
/// Initializes a new instance of the <see cref="HudGlobals"/> class.
/// </summary>
public HudGlobals()
{
// Add tag block to list.
this.TagBlocks.Add(new HudGlobalsBlock());
}
/// <summary>
/// Gets and returns the name of the hud_globals tag group.
/// </summary>
public override string GroupName
{
get
{
return "hud_globals";
}
}
/// <summary>
/// Gets and returns the group tag of the hud_globals tag group.
/// </summary>
public override TagFourCc GroupTag
{
get
{
return "hudg";
}
}
}
}
|
MikeMatt16/Abide
|
Abide Tag Definitions/Generated/Guerilla/HudGlobals.Generated.cs
|
C#
|
gpl-3.0
| 1,437
|
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0499 */
/* Compiler settings for mscoree.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __mscoree_h__
#define __mscoree_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IObjectHandle_FWD_DEFINED__
#define __IObjectHandle_FWD_DEFINED__
typedef interface IObjectHandle IObjectHandle;
#endif /* __IObjectHandle_FWD_DEFINED__ */
#ifndef __IAppDomainBinding_FWD_DEFINED__
#define __IAppDomainBinding_FWD_DEFINED__
typedef interface IAppDomainBinding IAppDomainBinding;
#endif /* __IAppDomainBinding_FWD_DEFINED__ */
#ifndef __IGCThreadControl_FWD_DEFINED__
#define __IGCThreadControl_FWD_DEFINED__
typedef interface IGCThreadControl IGCThreadControl;
#endif /* __IGCThreadControl_FWD_DEFINED__ */
#ifndef __IGCHostControl_FWD_DEFINED__
#define __IGCHostControl_FWD_DEFINED__
typedef interface IGCHostControl IGCHostControl;
#endif /* __IGCHostControl_FWD_DEFINED__ */
#ifndef __ICorThreadpool_FWD_DEFINED__
#define __ICorThreadpool_FWD_DEFINED__
typedef interface ICorThreadpool ICorThreadpool;
#endif /* __ICorThreadpool_FWD_DEFINED__ */
#ifndef __IDebuggerThreadControl_FWD_DEFINED__
#define __IDebuggerThreadControl_FWD_DEFINED__
typedef interface IDebuggerThreadControl IDebuggerThreadControl;
#endif /* __IDebuggerThreadControl_FWD_DEFINED__ */
#ifndef __IDebuggerInfo_FWD_DEFINED__
#define __IDebuggerInfo_FWD_DEFINED__
typedef interface IDebuggerInfo IDebuggerInfo;
#endif /* __IDebuggerInfo_FWD_DEFINED__ */
#ifndef __ICorConfiguration_FWD_DEFINED__
#define __ICorConfiguration_FWD_DEFINED__
typedef interface ICorConfiguration ICorConfiguration;
#endif /* __ICorConfiguration_FWD_DEFINED__ */
#ifndef __ICorRuntimeHost_FWD_DEFINED__
#define __ICorRuntimeHost_FWD_DEFINED__
typedef interface ICorRuntimeHost ICorRuntimeHost;
#endif /* __ICorRuntimeHost_FWD_DEFINED__ */
#ifndef __ICLRMemoryNotificationCallback_FWD_DEFINED__
#define __ICLRMemoryNotificationCallback_FWD_DEFINED__
typedef interface ICLRMemoryNotificationCallback ICLRMemoryNotificationCallback;
#endif /* __ICLRMemoryNotificationCallback_FWD_DEFINED__ */
#ifndef __IHostMalloc_FWD_DEFINED__
#define __IHostMalloc_FWD_DEFINED__
typedef interface IHostMalloc IHostMalloc;
#endif /* __IHostMalloc_FWD_DEFINED__ */
#ifndef __IHostMemoryManager_FWD_DEFINED__
#define __IHostMemoryManager_FWD_DEFINED__
typedef interface IHostMemoryManager IHostMemoryManager;
#endif /* __IHostMemoryManager_FWD_DEFINED__ */
#ifndef __ICLRTask_FWD_DEFINED__
#define __ICLRTask_FWD_DEFINED__
typedef interface ICLRTask ICLRTask;
#endif /* __ICLRTask_FWD_DEFINED__ */
#ifndef __ICLRTask2_FWD_DEFINED__
#define __ICLRTask2_FWD_DEFINED__
typedef interface ICLRTask2 ICLRTask2;
#endif /* __ICLRTask2_FWD_DEFINED__ */
#ifndef __IHostTask_FWD_DEFINED__
#define __IHostTask_FWD_DEFINED__
typedef interface IHostTask IHostTask;
#endif /* __IHostTask_FWD_DEFINED__ */
#ifndef __ICLRTaskManager_FWD_DEFINED__
#define __ICLRTaskManager_FWD_DEFINED__
typedef interface ICLRTaskManager ICLRTaskManager;
#endif /* __ICLRTaskManager_FWD_DEFINED__ */
#ifndef __IHostTaskManager_FWD_DEFINED__
#define __IHostTaskManager_FWD_DEFINED__
typedef interface IHostTaskManager IHostTaskManager;
#endif /* __IHostTaskManager_FWD_DEFINED__ */
#ifndef __IHostThreadpoolManager_FWD_DEFINED__
#define __IHostThreadpoolManager_FWD_DEFINED__
typedef interface IHostThreadpoolManager IHostThreadpoolManager;
#endif /* __IHostThreadpoolManager_FWD_DEFINED__ */
#ifndef __ICLRIoCompletionManager_FWD_DEFINED__
#define __ICLRIoCompletionManager_FWD_DEFINED__
typedef interface ICLRIoCompletionManager ICLRIoCompletionManager;
#endif /* __ICLRIoCompletionManager_FWD_DEFINED__ */
#ifndef __IHostIoCompletionManager_FWD_DEFINED__
#define __IHostIoCompletionManager_FWD_DEFINED__
typedef interface IHostIoCompletionManager IHostIoCompletionManager;
#endif /* __IHostIoCompletionManager_FWD_DEFINED__ */
#ifndef __ICLRDebugManager_FWD_DEFINED__
#define __ICLRDebugManager_FWD_DEFINED__
typedef interface ICLRDebugManager ICLRDebugManager;
#endif /* __ICLRDebugManager_FWD_DEFINED__ */
#ifndef __ICLRErrorReportingManager_FWD_DEFINED__
#define __ICLRErrorReportingManager_FWD_DEFINED__
typedef interface ICLRErrorReportingManager ICLRErrorReportingManager;
#endif /* __ICLRErrorReportingManager_FWD_DEFINED__ */
#ifndef __IHostCrst_FWD_DEFINED__
#define __IHostCrst_FWD_DEFINED__
typedef interface IHostCrst IHostCrst;
#endif /* __IHostCrst_FWD_DEFINED__ */
#ifndef __IHostAutoEvent_FWD_DEFINED__
#define __IHostAutoEvent_FWD_DEFINED__
typedef interface IHostAutoEvent IHostAutoEvent;
#endif /* __IHostAutoEvent_FWD_DEFINED__ */
#ifndef __IHostManualEvent_FWD_DEFINED__
#define __IHostManualEvent_FWD_DEFINED__
typedef interface IHostManualEvent IHostManualEvent;
#endif /* __IHostManualEvent_FWD_DEFINED__ */
#ifndef __IHostSemaphore_FWD_DEFINED__
#define __IHostSemaphore_FWD_DEFINED__
typedef interface IHostSemaphore IHostSemaphore;
#endif /* __IHostSemaphore_FWD_DEFINED__ */
#ifndef __ICLRSyncManager_FWD_DEFINED__
#define __ICLRSyncManager_FWD_DEFINED__
typedef interface ICLRSyncManager ICLRSyncManager;
#endif /* __ICLRSyncManager_FWD_DEFINED__ */
#ifndef __IHostSyncManager_FWD_DEFINED__
#define __IHostSyncManager_FWD_DEFINED__
typedef interface IHostSyncManager IHostSyncManager;
#endif /* __IHostSyncManager_FWD_DEFINED__ */
#ifndef __ICLRPolicyManager_FWD_DEFINED__
#define __ICLRPolicyManager_FWD_DEFINED__
typedef interface ICLRPolicyManager ICLRPolicyManager;
#endif /* __ICLRPolicyManager_FWD_DEFINED__ */
#ifndef __IHostPolicyManager_FWD_DEFINED__
#define __IHostPolicyManager_FWD_DEFINED__
typedef interface IHostPolicyManager IHostPolicyManager;
#endif /* __IHostPolicyManager_FWD_DEFINED__ */
#ifndef __IActionOnCLREvent_FWD_DEFINED__
#define __IActionOnCLREvent_FWD_DEFINED__
typedef interface IActionOnCLREvent IActionOnCLREvent;
#endif /* __IActionOnCLREvent_FWD_DEFINED__ */
#ifndef __ICLROnEventManager_FWD_DEFINED__
#define __ICLROnEventManager_FWD_DEFINED__
typedef interface ICLROnEventManager ICLROnEventManager;
#endif /* __ICLROnEventManager_FWD_DEFINED__ */
#ifndef __IHostGCManager_FWD_DEFINED__
#define __IHostGCManager_FWD_DEFINED__
typedef interface IHostGCManager IHostGCManager;
#endif /* __IHostGCManager_FWD_DEFINED__ */
#ifndef __ICLRGCManager_FWD_DEFINED__
#define __ICLRGCManager_FWD_DEFINED__
typedef interface ICLRGCManager ICLRGCManager;
#endif /* __ICLRGCManager_FWD_DEFINED__ */
#ifndef __ICLRAssemblyReferenceList_FWD_DEFINED__
#define __ICLRAssemblyReferenceList_FWD_DEFINED__
typedef interface ICLRAssemblyReferenceList ICLRAssemblyReferenceList;
#endif /* __ICLRAssemblyReferenceList_FWD_DEFINED__ */
#ifndef __ICLRReferenceAssemblyEnum_FWD_DEFINED__
#define __ICLRReferenceAssemblyEnum_FWD_DEFINED__
typedef interface ICLRReferenceAssemblyEnum ICLRReferenceAssemblyEnum;
#endif /* __ICLRReferenceAssemblyEnum_FWD_DEFINED__ */
#ifndef __ICLRProbingAssemblyEnum_FWD_DEFINED__
#define __ICLRProbingAssemblyEnum_FWD_DEFINED__
typedef interface ICLRProbingAssemblyEnum ICLRProbingAssemblyEnum;
#endif /* __ICLRProbingAssemblyEnum_FWD_DEFINED__ */
#ifndef __ICLRAssemblyIdentityManager_FWD_DEFINED__
#define __ICLRAssemblyIdentityManager_FWD_DEFINED__
typedef interface ICLRAssemblyIdentityManager ICLRAssemblyIdentityManager;
#endif /* __ICLRAssemblyIdentityManager_FWD_DEFINED__ */
#ifndef __ICLRHostBindingPolicyManager_FWD_DEFINED__
#define __ICLRHostBindingPolicyManager_FWD_DEFINED__
typedef interface ICLRHostBindingPolicyManager ICLRHostBindingPolicyManager;
#endif /* __ICLRHostBindingPolicyManager_FWD_DEFINED__ */
#ifndef __IHostAssemblyStore_FWD_DEFINED__
#define __IHostAssemblyStore_FWD_DEFINED__
typedef interface IHostAssemblyStore IHostAssemblyStore;
#endif /* __IHostAssemblyStore_FWD_DEFINED__ */
#ifndef __IHostAssemblyManager_FWD_DEFINED__
#define __IHostAssemblyManager_FWD_DEFINED__
typedef interface IHostAssemblyManager IHostAssemblyManager;
#endif /* __IHostAssemblyManager_FWD_DEFINED__ */
#ifndef __IHostControl_FWD_DEFINED__
#define __IHostControl_FWD_DEFINED__
typedef interface IHostControl IHostControl;
#endif /* __IHostControl_FWD_DEFINED__ */
#ifndef __ICLRControl_FWD_DEFINED__
#define __ICLRControl_FWD_DEFINED__
typedef interface ICLRControl ICLRControl;
#endif /* __ICLRControl_FWD_DEFINED__ */
#ifndef __ICLRRuntimeHost_FWD_DEFINED__
#define __ICLRRuntimeHost_FWD_DEFINED__
typedef interface ICLRRuntimeHost ICLRRuntimeHost;
#endif /* __ICLRRuntimeHost_FWD_DEFINED__ */
#ifndef __ICLRHostProtectionManager_FWD_DEFINED__
#define __ICLRHostProtectionManager_FWD_DEFINED__
typedef interface ICLRHostProtectionManager ICLRHostProtectionManager;
#endif /* __ICLRHostProtectionManager_FWD_DEFINED__ */
#ifndef __ICLRDomainManager_FWD_DEFINED__
#define __ICLRDomainManager_FWD_DEFINED__
typedef interface ICLRDomainManager ICLRDomainManager;
#endif /* __ICLRDomainManager_FWD_DEFINED__ */
#ifndef __ITypeName_FWD_DEFINED__
#define __ITypeName_FWD_DEFINED__
typedef interface ITypeName ITypeName;
#endif /* __ITypeName_FWD_DEFINED__ */
#ifndef __ITypeNameBuilder_FWD_DEFINED__
#define __ITypeNameBuilder_FWD_DEFINED__
typedef interface ITypeNameBuilder ITypeNameBuilder;
#endif /* __ITypeNameBuilder_FWD_DEFINED__ */
#ifndef __ITypeNameFactory_FWD_DEFINED__
#define __ITypeNameFactory_FWD_DEFINED__
typedef interface ITypeNameFactory ITypeNameFactory;
#endif /* __ITypeNameFactory_FWD_DEFINED__ */
#ifndef __IApartmentCallback_FWD_DEFINED__
#define __IApartmentCallback_FWD_DEFINED__
typedef interface IApartmentCallback IApartmentCallback;
#endif /* __IApartmentCallback_FWD_DEFINED__ */
#ifndef __IManagedObject_FWD_DEFINED__
#define __IManagedObject_FWD_DEFINED__
typedef interface IManagedObject IManagedObject;
#endif /* __IManagedObject_FWD_DEFINED__ */
#ifndef __ICatalogServices_FWD_DEFINED__
#define __ICatalogServices_FWD_DEFINED__
typedef interface ICatalogServices ICatalogServices;
#endif /* __ICatalogServices_FWD_DEFINED__ */
#ifndef __ComCallUnmarshal_FWD_DEFINED__
#define __ComCallUnmarshal_FWD_DEFINED__
#ifdef __cplusplus
typedef class ComCallUnmarshal ComCallUnmarshal;
#else
typedef struct ComCallUnmarshal ComCallUnmarshal;
#endif /* __cplusplus */
#endif /* __ComCallUnmarshal_FWD_DEFINED__ */
#ifndef __ComCallUnmarshalV4_FWD_DEFINED__
#define __ComCallUnmarshalV4_FWD_DEFINED__
#ifdef __cplusplus
typedef class ComCallUnmarshalV4 ComCallUnmarshalV4;
#else
typedef struct ComCallUnmarshalV4 ComCallUnmarshalV4;
#endif /* __cplusplus */
#endif /* __ComCallUnmarshalV4_FWD_DEFINED__ */
#ifndef __CorRuntimeHost_FWD_DEFINED__
#define __CorRuntimeHost_FWD_DEFINED__
#ifdef __cplusplus
typedef class CorRuntimeHost CorRuntimeHost;
#else
typedef struct CorRuntimeHost CorRuntimeHost;
#endif /* __cplusplus */
#endif /* __CorRuntimeHost_FWD_DEFINED__ */
#ifndef __CLRRuntimeHost_FWD_DEFINED__
#define __CLRRuntimeHost_FWD_DEFINED__
#ifdef __cplusplus
typedef class CLRRuntimeHost CLRRuntimeHost;
#else
typedef struct CLRRuntimeHost CLRRuntimeHost;
#endif /* __cplusplus */
#endif /* __CLRRuntimeHost_FWD_DEFINED__ */
#ifndef __TypeNameFactory_FWD_DEFINED__
#define __TypeNameFactory_FWD_DEFINED__
#ifdef __cplusplus
typedef class TypeNameFactory TypeNameFactory;
#else
typedef struct TypeNameFactory TypeNameFactory;
#endif /* __cplusplus */
#endif /* __TypeNameFactory_FWD_DEFINED__ */
#ifndef __IHostSecurityContext_FWD_DEFINED__
#define __IHostSecurityContext_FWD_DEFINED__
typedef interface IHostSecurityContext IHostSecurityContext;
#endif /* __IHostSecurityContext_FWD_DEFINED__ */
#ifndef __IHostSecurityManager_FWD_DEFINED__
#define __IHostSecurityManager_FWD_DEFINED__
typedef interface IHostSecurityManager IHostSecurityManager;
#endif /* __IHostSecurityManager_FWD_DEFINED__ */
#ifndef __ICLRAppDomainResourceMonitor_FWD_DEFINED__
#define __ICLRAppDomainResourceMonitor_FWD_DEFINED__
typedef interface ICLRAppDomainResourceMonitor ICLRAppDomainResourceMonitor;
#endif /* __ICLRAppDomainResourceMonitor_FWD_DEFINED__ */
/* header files for imported files */
#include "unknwn.h"
#include "gchost.h"
#include "ivalidator.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_mscoree_0000_0000 */
/* [local] */
#ifndef USE_DEPRECATED_CLR_API_WITHOUT_WARNING
#define DEPRECATED_CLR_API_MESG "This API has been deprecated. Refer to http://go.microsoft.com/fwlink/?LinkId=143720 for more details."
#define DECLARE_DEPRECATED __declspec(deprecated(DEPRECATED_CLR_API_MESG))
#define DEPRECATED_CLR_STDAPI EXTERN_C DECLARE_DEPRECATED HRESULT STDAPICALLTYPE
#else // USE_DEPRECATED_CLR_API_WITHOUT_WARNING
#define DECLARE_DEPRECATED
#define DEPRECATED_CLR_STDAPI STDAPI
#endif // !USE_DEPRECATED_CLR_API_WITHOUT_WARNING
#define CLR_MAJOR_VERSION ( 4 )
#define CLR_MINOR_VERSION ( 0 )
#define CLR_BUILD_VERSION ( 30319 )
#define CLR_ASSEMBLY_MAJOR_VERSION ( 4 )
#define CLR_ASSEMBLY_MINOR_VERSION ( 0 )
#define CLR_ASSEMBLY_BUILD_VERSION ( 0 )
EXTERN_GUID(LIBID_mscoree, 0x5477469e,0x83b1,0x11d2,0x8b,0x49,0x00,0xa0,0xc9,0xb7,0xc9,0xc4);
EXTERN_GUID(CLSID_CorRuntimeHost, 0xcb2f6723, 0xab3a, 0x11d2, 0x9c, 0x40, 0x00, 0xc0, 0x4f, 0xa3, 0x0a, 0x3e);
EXTERN_GUID(CLSID_TypeNameFactory, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x25);
EXTERN_GUID(CLSID_CLRRuntimeHost, 0x90F1A06E, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);
EXTERN_GUID(CLSID_ComCallUnmarshal, 0x3F281000,0xE95A,0x11d2,0x88,0x6B,0x00,0xC0,0x4F,0x86,0x9F,0x04);
EXTERN_GUID(CLSID_ComCallUnmarshalV4, 0x45fb4600,0xe6e8,0x4928,0xb2,0x5e,0x50,0x47,0x6f,0xf7,0x94,0x25);
EXTERN_GUID(IID_IObjectHandle, 0xc460e2b4, 0xe199, 0x412a, 0x84, 0x56, 0x84, 0xdc, 0x3e, 0x48, 0x38, 0xc3);
EXTERN_GUID(IID_IManagedObject, 0xc3fcc19e, 0xa970, 0x11d2, 0x8b, 0x5a, 0x00, 0xa0, 0xc9, 0xb7, 0xc9, 0xc4);
EXTERN_GUID(IID_IApartmentCallback, 0x178e5337, 0x1528, 0x4591, 0xb1, 0xc9, 0x1c, 0x6e, 0x48, 0x46, 0x86, 0xd8);
EXTERN_GUID(IID_ICatalogServices, 0x04c6be1e, 0x1db1, 0x4058, 0xab, 0x7a, 0x70, 0x0c, 0xcc, 0xfb, 0xf2, 0x54);
EXTERN_GUID(IID_ICorRuntimeHost, 0xcb2f6722, 0xab3a, 0x11d2, 0x9c, 0x40, 0x00, 0xc0, 0x4f, 0xa3, 0x0a, 0x3e);
EXTERN_GUID(IID_ICorThreadpool, 0x84680D3A, 0xB2C1, 0x46e8, 0xAC, 0xC2, 0xDB, 0xC0, 0xA3, 0x59, 0x15, 0x9A);
EXTERN_GUID(IID_ICLRDebugManager, 0xdcaec6, 0x2ac0, 0x43a9, 0xac, 0xf9, 0x1e, 0x36, 0xc1, 0x39, 0xb1, 0xd);
EXTERN_GUID(IID_ICLRErrorReportingManager, 0x980d2f1a, 0xbf79, 0x4c08, 0x81, 0x2a, 0xbb, 0x97, 0x78, 0x92, 0x8f, 0x78);
EXTERN_GUID(IID_IHostMemoryNeededCallback, 0x47EB8E57, 0x0846, 0x4546, 0xAF, 0x76, 0x6F, 0x42, 0xFC, 0xFC, 0x26, 0x49);
EXTERN_GUID(IID_IHostMalloc, 0x1831991C, 0xCC53, 0x4A31, 0xB2, 0x18, 0x04, 0xE9, 0x10, 0x44, 0x64, 0x79);
EXTERN_GUID(IID_IHostMemoryManager, 0x7BC698D1, 0xF9E3, 0x4460, 0x9C, 0xDE, 0xD0, 0x42, 0x48, 0xE9, 0xFA, 0x25);
EXTERN_GUID(IID_ICLRTask, 0x28E66A4A, 0x9906, 0x4225, 0xB2, 0x31, 0x91, 0x87, 0xc3, 0xeb, 0x86, 0x11);
EXTERN_GUID(IID_ICLRTask2, 0x28E66A4A, 0x9906, 0x4225, 0xB2, 0x31, 0x91, 0x87, 0xc3, 0xeb, 0x86, 0x12);
EXTERN_GUID(IID_IHostTask, 0xC2275828, 0xC4B1, 0x4B55, 0x82, 0xC9, 0x92, 0x13, 0x5F, 0x74, 0xDF, 0x1A);
EXTERN_GUID(IID_ICLRTaskManager, 0x4862efbe, 0x3ae5, 0x44f8, 0x8F, 0xEB, 0x34, 0x61, 0x90, 0xeE, 0x8A, 0x34);
EXTERN_GUID(IID_IHostTaskManager, 0x997FF24C, 0x43B7, 0x4352, 0x86, 0x67, 0x0D, 0xC0, 0x4F, 0xAF, 0xD3, 0x54);
EXTERN_GUID(IID_IHostThreadpoolManager, 0x983D50E2, 0xCB15, 0x466B, 0x80, 0xFC, 0x84, 0x5D, 0xC6, 0xE8, 0xC5, 0xFD);
EXTERN_GUID(IID_ICLRIoCompletionManager, 0x2D74CE86, 0xB8D6, 0x4C84, 0xB3, 0xA7, 0x97, 0x68, 0x93, 0x3B, 0x3C, 0x12);
EXTERN_GUID(IID_ICLRGCManager, 0x54D9007E, 0xA8E2, 0x4885, 0xB7, 0xBF, 0xF9, 0x98, 0xDE, 0xEE, 0x4F, 0x2A);
EXTERN_GUID(IID_IHostIoCompletionManager, 0x8BDE9D80, 0xEC06, 0x41D6, 0x83, 0xE6, 0x22, 0x58, 0x0E, 0xFF, 0xCC, 0x20);
EXTERN_GUID(IID_IHostSyncManager, 0x234330c7, 0x5f10, 0x4f20, 0x96, 0x15, 0x51, 0x22, 0xda, 0xb7, 0xa0, 0xac);
EXTERN_GUID(IID_IHostCrst, 0x6DF710A6, 0x26A4, 0x4a65, 0x8c, 0xd5, 0x72, 0x37, 0xb8, 0xbd, 0xa8, 0xdc);
EXTERN_GUID(IID_IHostAutoEvent, 0x50B0CFCE, 0x4063, 0x4278, 0x96, 0x73, 0xe5, 0xcb, 0x4e, 0xd0, 0xbd, 0xb8);
EXTERN_GUID(IID_IHostManualEvent, 0x1BF4EC38, 0xAFFE, 0x4fb9, 0x85, 0xa6, 0x52, 0x52, 0x68, 0xf1, 0x5b, 0x54);
EXTERN_GUID(IID_IHostSemaphore, 0x855efd47, 0xcc09, 0x463a, 0xa9, 0x7d, 0x16, 0xac, 0xab, 0x88, 0x26, 0x61);
EXTERN_GUID(IID_ICLRSyncManager, 0x55FF199D, 0xAD21, 0x48f9, 0xa1, 0x6c, 0xf2, 0x4e, 0xbb, 0xb8, 0x72, 0x7d);
EXTERN_GUID(IID_ICLRAppDomainResourceMonitor, 0XC62DE18C, 0X2E23, 0X4AEA, 0X84, 0X23, 0XB4, 0X0C, 0X1F, 0XC5, 0X9E, 0XAE);
EXTERN_GUID(IID_ICLRPolicyManager, 0x7D290010, 0xD781, 0x45da, 0xA6, 0xF8, 0xAA, 0x5D, 0x71, 0x1A, 0x73, 0x0E);
EXTERN_GUID(IID_IHostPolicyManager, 0x7AE49844, 0xB1E3, 0x4683, 0xBA, 0x7C, 0x1E, 0x82, 0x12, 0xEA, 0x3B, 0x79);
EXTERN_GUID(IID_IHostGCManager, 0x5D4EC34E, 0xF248, 0x457B, 0xB6, 0x03, 0x25, 0x5F, 0xAA, 0xBA, 0x0D, 0x21);
EXTERN_GUID(IID_IActionOnCLREvent, 0x607BE24B, 0xD91B, 0x4E28, 0xA2, 0x42, 0x61, 0x87, 0x1C, 0xE5, 0x6E, 0x35);
EXTERN_GUID(IID_ICLROnEventManager, 0x1D0E0132, 0xE64F, 0x493D, 0x92, 0x60, 0x02, 0x5C, 0x0E, 0x32, 0xC1, 0x75);
EXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);
EXTERN_GUID(IID_ICLRHostProtectionManager, 0x89f25f5c, 0xceef, 0x43e1, 0x9c, 0xfa, 0xa6, 0x8c, 0xe8, 0x63, 0xaa, 0xac);
EXTERN_GUID(IID_IHostAssemblyStore, 0x7b102a88, 0x3f7f, 0x496d, 0x8f, 0xa2, 0xc3, 0x53, 0x74, 0xe0, 0x1a, 0xf3);
EXTERN_GUID(IID_IHostAssemblyManager, 0x613dabd7, 0x62b2, 0x493e, 0x9e, 0x65, 0xc1, 0xe3, 0x2a, 0x1e, 0x0c, 0x5e);
EXTERN_GUID(IID_IHostSecurityManager, 0x75ad2468, 0xa349, 0x4d02, 0xa7, 0x64, 0x76, 0xa6, 0x8a, 0xee, 0x0c, 0x4f);
EXTERN_GUID(IID_IHostSecurityContext, 0x7e573ce4, 0x343, 0x4423, 0x98, 0xd7, 0x63, 0x18, 0x34, 0x8a, 0x1d, 0x3c);
EXTERN_GUID(IID_ICLRAssemblyIdentityManager, 0x15f0a9da, 0x3ff6, 0x4393, 0x9d, 0xa9, 0xfd, 0xfd, 0x28, 0x4e, 0x69, 0x72);
EXTERN_GUID(IID_ICLRDomainManager, 0x270d00a2, 0x8e15, 0x4d0b, 0xad, 0xeb, 0x37, 0xbc, 0x3e, 0x47, 0xdf, 0x77);
EXTERN_GUID(IID_ITypeName, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x22);
EXTERN_GUID(IID_ICLRAssemblyReferenceList, 0x1b2c9750, 0x2e66, 0x4bda, 0x8b, 0x44, 0x0a, 0x64, 0x2c, 0x5c, 0xd7, 0x33);
EXTERN_GUID(IID_ICLRReferenceAssemblyEnum, 0xd509cb5d, 0xcf32, 0x4876, 0xae, 0x61, 0x67, 0x77, 0x0c, 0xf9, 0x19, 0x73);
EXTERN_GUID(IID_ICLRProbingAssemblyEnum, 0xd0c5fb1f, 0x416b, 0x4f97, 0x81, 0xf4, 0x7a, 0xc7, 0xdc, 0x24, 0xdd, 0x5d);
EXTERN_GUID(IID_ICLRHostBindingPolicyManager, 0x4b3545e7, 0x1856, 0x48c9, 0xa8, 0xba, 0x24, 0xb2, 0x1a, 0x75, 0x3c, 0x09);
EXTERN_GUID(IID_ITypeNameBuilder, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x23);
EXTERN_GUID(IID_ITypeNameFactory, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x21);
DEPRECATED_CLR_STDAPI GetCORSystemDirectory(__out_ecount_part(cchBuffer, *dwLength) LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwLength);
DEPRECATED_CLR_STDAPI GetCORVersion(__out_ecount_part(cchBuffer, *dwLength) LPWSTR pbBuffer, DWORD cchBuffer, DWORD* dwLength);
DEPRECATED_CLR_STDAPI GetFileVersion(LPCWSTR szFilename, __out_ecount_part_opt(cchBuffer, *dwLength) LPWSTR szBuffer, DWORD cchBuffer, DWORD* dwLength);
DEPRECATED_CLR_STDAPI GetCORRequiredVersion(__out_ecount_part(cchBuffer, *dwLength) LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwLength);
DEPRECATED_CLR_STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, __out_ecount_opt(dwDirectory) LPWSTR pDirectory, DWORD dwDirectory, __out_opt DWORD *dwDirectoryLength, __out_ecount_opt(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, __out_opt DWORD* dwlength);
DEPRECATED_CLR_STDAPI GetRequestedRuntimeVersion(__in LPWSTR pExe, __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pVersion, DWORD cchBuffer, __out DWORD* dwLength);
DEPRECATED_CLR_STDAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, LPCWSTR pwszHostConfigFile, VOID* pReserved, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI CorBindToRuntimeEx(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI CorBindToRuntimeByCfg(IStream* pCfgStream, DWORD reserved, DWORD startupFlags, REFCLSID rclsid,REFIID riid, LPVOID FAR* ppv);
DEPRECATED_CLR_STDAPI CorBindToRuntime(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI CorBindToCurrentRuntime(LPCWSTR pwszFileName, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject);
DECLARE_DEPRECATED void STDMETHODCALLTYPE CorMarkThreadInThreadPool();
DEPRECATED_CLR_STDAPI RunDll32ShimW(HWND hwnd, HINSTANCE hinst, LPCWSTR lpszCmdLine, int nCmdShow);
DEPRECATED_CLR_STDAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);
DEPRECATED_CLR_STDAPI CallFunctionShim(LPCWSTR szDllName, LPCSTR szFunctionName, LPVOID lpvArgument1, LPVOID lpvArgument2, LPCWSTR szVersion, LPVOID pvReserved);
DEPRECATED_CLR_STDAPI GetRealProcAddress(LPCSTR pwszProcName, VOID** ppv);
void STDMETHODCALLTYPE CorExitProcess(int exitCode);
DEPRECATED_CLR_STDAPI LoadStringRC(UINT iResouceID, __out_ecount_z(iMax) LPWSTR szBuffer, int iMax, int bQuiet);
DEPRECATED_CLR_STDAPI LoadStringRCEx(LCID lcid, UINT iResouceID, __out_ecount_z(iMax) LPWSTR szBuffer, int iMax, int bQuiet, int *pcwchUsed);
typedef HRESULT (__stdcall *FLockClrVersionCallback) ();
DEPRECATED_CLR_STDAPI LockClrVersion(FLockClrVersionCallback hostCallback,FLockClrVersionCallback *pBeginHostSetup,FLockClrVersionCallback *pEndHostSetup);
DEPRECATED_CLR_STDAPI CreateDebuggingInterfaceFromVersion(int iDebuggerVersion, LPCWSTR szDebuggeeVersion, IUnknown ** ppCordb);
DEPRECATED_CLR_STDAPI GetVersionFromProcess(HANDLE hProcess, __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pVersion, DWORD cchBuffer, __out DWORD* dwLength);
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0001
{ HOST_TYPE_DEFAULT = 0,
HOST_TYPE_APPLAUNCH = 0x1,
HOST_TYPE_CORFLAG = 0x2
} HOST_TYPE;
STDAPI CorLaunchApplication(HOST_TYPE dwClickOnceHost, LPCWSTR pwzAppFullName, DWORD dwManifestPaths, LPCWSTR* ppwzManifestPaths, DWORD dwActivationData, LPCWSTR* ppwzActivationData, LPPROCESS_INFORMATION lpProcessInformation);
typedef HRESULT ( __stdcall *FExecuteInAppDomainCallback )(
void *cookie);
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0002
{ STARTUP_CONCURRENT_GC = 0x1,
STARTUP_LOADER_OPTIMIZATION_MASK = ( 0x3 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN = ( 0x1 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN = ( 0x2 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST = ( 0x3 << 1 ) ,
STARTUP_LOADER_SAFEMODE = 0x10,
STARTUP_LOADER_SETPREFERENCE = 0x100,
STARTUP_SERVER_GC = 0x1000,
STARTUP_HOARD_GC_VM = 0x2000,
STARTUP_SINGLE_VERSION_HOSTING_INTERFACE = 0x4000,
STARTUP_LEGACY_IMPERSONATION = 0x10000,
STARTUP_DISABLE_COMMITTHREADSTACK = 0x20000,
STARTUP_ALWAYSFLOW_IMPERSONATION = 0x40000,
STARTUP_TRIM_GC_COMMIT = 0x80000,
STARTUP_ETW = 0x100000,
STARTUP_ARM = 0x400000
} STARTUP_FLAGS;
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0003
{ CLSID_RESOLUTION_DEFAULT = 0,
CLSID_RESOLUTION_REGISTERED = 0x1
} CLSID_RESOLUTION_FLAGS;
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0004
{ RUNTIME_INFO_UPGRADE_VERSION = 0x1,
RUNTIME_INFO_REQUEST_IA64 = 0x2,
RUNTIME_INFO_REQUEST_AMD64 = 0x4,
RUNTIME_INFO_REQUEST_X86 = 0x8,
RUNTIME_INFO_DONT_RETURN_DIRECTORY = 0x10,
RUNTIME_INFO_DONT_RETURN_VERSION = 0x20,
RUNTIME_INFO_DONT_SHOW_ERROR_DIALOG = 0x40
} RUNTIME_INFO_FLAGS;
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0005
{ APPDOMAIN_SECURITY_DEFAULT = 0,
APPDOMAIN_SECURITY_SANDBOXED = 0x1,
APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE = 0x2,
APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS = 0x8
} APPDOMAIN_SECURITY_FLAGS;
STDAPI GetRequestedRuntimeVersionForCLSID(REFCLSID rclsid, __out_ecount_opt(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, __out_opt DWORD* dwLength, CLSID_RESOLUTION_FLAGS dwResolutionFlags);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0000_v0_0_s_ifspec;
#ifndef __IObjectHandle_INTERFACE_DEFINED__
#define __IObjectHandle_INTERFACE_DEFINED__
/* interface IObjectHandle */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_IObjectHandle;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C460E2B4-E199-412a-8456-84DC3E4838C3")
IObjectHandle : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Unwrap(
/* [retval][out] */ __RPC__out VARIANT *ppv) = 0;
};
#else /* C style interface */
typedef struct IObjectHandleVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IObjectHandle * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IObjectHandle * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IObjectHandle * This);
HRESULT ( STDMETHODCALLTYPE *Unwrap )(
IObjectHandle * This,
/* [retval][out] */ __RPC__out VARIANT *ppv);
END_INTERFACE
} IObjectHandleVtbl;
interface IObjectHandle
{
CONST_VTBL struct IObjectHandleVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IObjectHandle_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IObjectHandle_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IObjectHandle_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IObjectHandle_Unwrap(This,ppv) \
( (This)->lpVtbl -> Unwrap(This,ppv) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IObjectHandle_INTERFACE_DEFINED__ */
#ifndef __IAppDomainBinding_INTERFACE_DEFINED__
#define __IAppDomainBinding_INTERFACE_DEFINED__
/* interface IAppDomainBinding */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IAppDomainBinding;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5C2B07A7-1E98-11d3-872F-00C04F79ED0D")
IAppDomainBinding : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OnAppDomain(
/* [in] */ IUnknown *pAppdomain) = 0;
};
#else /* C style interface */
typedef struct IAppDomainBindingVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAppDomainBinding * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAppDomainBinding * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAppDomainBinding * This);
HRESULT ( STDMETHODCALLTYPE *OnAppDomain )(
IAppDomainBinding * This,
/* [in] */ IUnknown *pAppdomain);
END_INTERFACE
} IAppDomainBindingVtbl;
interface IAppDomainBinding
{
CONST_VTBL struct IAppDomainBindingVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAppDomainBinding_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IAppDomainBinding_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IAppDomainBinding_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IAppDomainBinding_OnAppDomain(This,pAppdomain) \
( (This)->lpVtbl -> OnAppDomain(This,pAppdomain) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IAppDomainBinding_INTERFACE_DEFINED__ */
#ifndef __IGCThreadControl_INTERFACE_DEFINED__
#define __IGCThreadControl_INTERFACE_DEFINED__
/* interface IGCThreadControl */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IGCThreadControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("F31D1788-C397-4725-87A5-6AF3472C2791")
IGCThreadControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ThreadIsBlockingForSuspension( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SuspensionStarting( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SuspensionEnding(
DWORD Generation) = 0;
};
#else /* C style interface */
typedef struct IGCThreadControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IGCThreadControl * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IGCThreadControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IGCThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *ThreadIsBlockingForSuspension )(
IGCThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *SuspensionStarting )(
IGCThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *SuspensionEnding )(
IGCThreadControl * This,
DWORD Generation);
END_INTERFACE
} IGCThreadControlVtbl;
interface IGCThreadControl
{
CONST_VTBL struct IGCThreadControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGCThreadControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGCThreadControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGCThreadControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGCThreadControl_ThreadIsBlockingForSuspension(This) \
( (This)->lpVtbl -> ThreadIsBlockingForSuspension(This) )
#define IGCThreadControl_SuspensionStarting(This) \
( (This)->lpVtbl -> SuspensionStarting(This) )
#define IGCThreadControl_SuspensionEnding(This,Generation) \
( (This)->lpVtbl -> SuspensionEnding(This,Generation) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGCThreadControl_INTERFACE_DEFINED__ */
#ifndef __IGCHostControl_INTERFACE_DEFINED__
#define __IGCHostControl_INTERFACE_DEFINED__
/* interface IGCHostControl */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IGCHostControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5513D564-8374-4cb9-AED9-0083F4160A1D")
IGCHostControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE RequestVirtualMemLimit(
/* [in] */ SIZE_T sztMaxVirtualMemMB,
/* [out][in] */ SIZE_T *psztNewMaxVirtualMemMB) = 0;
};
#else /* C style interface */
typedef struct IGCHostControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IGCHostControl * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IGCHostControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IGCHostControl * This);
HRESULT ( STDMETHODCALLTYPE *RequestVirtualMemLimit )(
IGCHostControl * This,
/* [in] */ SIZE_T sztMaxVirtualMemMB,
/* [out][in] */ SIZE_T *psztNewMaxVirtualMemMB);
END_INTERFACE
} IGCHostControlVtbl;
interface IGCHostControl
{
CONST_VTBL struct IGCHostControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGCHostControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGCHostControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGCHostControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGCHostControl_RequestVirtualMemLimit(This,sztMaxVirtualMemMB,psztNewMaxVirtualMemMB) \
( (This)->lpVtbl -> RequestVirtualMemLimit(This,sztMaxVirtualMemMB,psztNewMaxVirtualMemMB) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGCHostControl_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0004 */
/* [local] */
#if (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500)
typedef VOID ( __stdcall *WAITORTIMERCALLBACK )(
PVOID __MIDL____MIDL_itf_mscoree_0000_00040000,
BOOL __MIDL____MIDL_itf_mscoree_0000_00040001);
#endif // (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500)
#ifdef __midl
typedef DWORD ( __stdcall *LPTHREAD_START_ROUTINE )(
LPVOID lpThreadParameter);
typedef VOID ( *LPOVERLAPPED_COMPLETION_ROUTINE )(
DWORD dwErrorCode,
DWORD dwNumberOfBytesTransfered,
LPVOID lpOverlapped);
#endif // __midl
typedef VOID ( __stdcall *PTLS_CALLBACK_FUNCTION )(
PVOID __MIDL____MIDL_itf_mscoree_0000_00040005);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0004_v0_0_s_ifspec;
#ifndef __ICorThreadpool_INTERFACE_DEFINED__
#define __ICorThreadpool_INTERFACE_DEFINED__
/* interface ICorThreadpool */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICorThreadpool;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("84680D3A-B2C1-46e8-ACC2-DBC0A359159A")
ICorThreadpool : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CorRegisterWaitForSingleObject(
/* [in] */ HANDLE *phNewWaitObject,
/* [in] */ HANDLE hWaitObject,
/* [in] */ WAITORTIMERCALLBACK Callback,
/* [in] */ PVOID Context,
/* [in] */ ULONG timeout,
/* [in] */ BOOL executeOnlyOnce,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorUnregisterWait(
/* [in] */ HANDLE hWaitObject,
/* [in] */ HANDLE CompletionEvent,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorQueueUserWorkItem(
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [in] */ BOOL executeOnlyOnce,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorCreateTimer(
/* [in] */ HANDLE *phNewTimer,
/* [in] */ WAITORTIMERCALLBACK Callback,
/* [in] */ PVOID Parameter,
/* [in] */ DWORD DueTime,
/* [in] */ DWORD Period,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorChangeTimer(
/* [in] */ HANDLE Timer,
/* [in] */ ULONG DueTime,
/* [in] */ ULONG Period,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorDeleteTimer(
/* [in] */ HANDLE Timer,
/* [in] */ HANDLE CompletionEvent,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorBindIoCompletionCallback(
/* [in] */ HANDLE fileHandle,
/* [in] */ LPOVERLAPPED_COMPLETION_ROUTINE callback) = 0;
virtual HRESULT STDMETHODCALLTYPE CorCallOrQueueUserWorkItem(
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [out] */ BOOL *result) = 0;
virtual HRESULT STDMETHODCALLTYPE CorSetMaxThreads(
/* [in] */ DWORD MaxWorkerThreads,
/* [in] */ DWORD MaxIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE CorGetMaxThreads(
/* [out] */ DWORD *MaxWorkerThreads,
/* [out] */ DWORD *MaxIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE CorGetAvailableThreads(
/* [out] */ DWORD *AvailableWorkerThreads,
/* [out] */ DWORD *AvailableIOCompletionThreads) = 0;
};
#else /* C style interface */
typedef struct ICorThreadpoolVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICorThreadpool * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICorThreadpool * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICorThreadpool * This);
HRESULT ( STDMETHODCALLTYPE *CorRegisterWaitForSingleObject )(
ICorThreadpool * This,
/* [in] */ HANDLE *phNewWaitObject,
/* [in] */ HANDLE hWaitObject,
/* [in] */ WAITORTIMERCALLBACK Callback,
/* [in] */ PVOID Context,
/* [in] */ ULONG timeout,
/* [in] */ BOOL executeOnlyOnce,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorUnregisterWait )(
ICorThreadpool * This,
/* [in] */ HANDLE hWaitObject,
/* [in] */ HANDLE CompletionEvent,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorQueueUserWorkItem )(
ICorThreadpool * This,
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [in] */ BOOL executeOnlyOnce,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorCreateTimer )(
ICorThreadpool * This,
/* [in] */ HANDLE *phNewTimer,
/* [in] */ WAITORTIMERCALLBACK Callback,
/* [in] */ PVOID Parameter,
/* [in] */ DWORD DueTime,
/* [in] */ DWORD Period,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorChangeTimer )(
ICorThreadpool * This,
/* [in] */ HANDLE Timer,
/* [in] */ ULONG DueTime,
/* [in] */ ULONG Period,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorDeleteTimer )(
ICorThreadpool * This,
/* [in] */ HANDLE Timer,
/* [in] */ HANDLE CompletionEvent,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorBindIoCompletionCallback )(
ICorThreadpool * This,
/* [in] */ HANDLE fileHandle,
/* [in] */ LPOVERLAPPED_COMPLETION_ROUTINE callback);
HRESULT ( STDMETHODCALLTYPE *CorCallOrQueueUserWorkItem )(
ICorThreadpool * This,
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [out] */ BOOL *result);
HRESULT ( STDMETHODCALLTYPE *CorSetMaxThreads )(
ICorThreadpool * This,
/* [in] */ DWORD MaxWorkerThreads,
/* [in] */ DWORD MaxIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *CorGetMaxThreads )(
ICorThreadpool * This,
/* [out] */ DWORD *MaxWorkerThreads,
/* [out] */ DWORD *MaxIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *CorGetAvailableThreads )(
ICorThreadpool * This,
/* [out] */ DWORD *AvailableWorkerThreads,
/* [out] */ DWORD *AvailableIOCompletionThreads);
END_INTERFACE
} ICorThreadpoolVtbl;
interface ICorThreadpool
{
CONST_VTBL struct ICorThreadpoolVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICorThreadpool_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICorThreadpool_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICorThreadpool_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICorThreadpool_CorRegisterWaitForSingleObject(This,phNewWaitObject,hWaitObject,Callback,Context,timeout,executeOnlyOnce,result) \
( (This)->lpVtbl -> CorRegisterWaitForSingleObject(This,phNewWaitObject,hWaitObject,Callback,Context,timeout,executeOnlyOnce,result) )
#define ICorThreadpool_CorUnregisterWait(This,hWaitObject,CompletionEvent,result) \
( (This)->lpVtbl -> CorUnregisterWait(This,hWaitObject,CompletionEvent,result) )
#define ICorThreadpool_CorQueueUserWorkItem(This,Function,Context,executeOnlyOnce,result) \
( (This)->lpVtbl -> CorQueueUserWorkItem(This,Function,Context,executeOnlyOnce,result) )
#define ICorThreadpool_CorCreateTimer(This,phNewTimer,Callback,Parameter,DueTime,Period,result) \
( (This)->lpVtbl -> CorCreateTimer(This,phNewTimer,Callback,Parameter,DueTime,Period,result) )
#define ICorThreadpool_CorChangeTimer(This,Timer,DueTime,Period,result) \
( (This)->lpVtbl -> CorChangeTimer(This,Timer,DueTime,Period,result) )
#define ICorThreadpool_CorDeleteTimer(This,Timer,CompletionEvent,result) \
( (This)->lpVtbl -> CorDeleteTimer(This,Timer,CompletionEvent,result) )
#define ICorThreadpool_CorBindIoCompletionCallback(This,fileHandle,callback) \
( (This)->lpVtbl -> CorBindIoCompletionCallback(This,fileHandle,callback) )
#define ICorThreadpool_CorCallOrQueueUserWorkItem(This,Function,Context,result) \
( (This)->lpVtbl -> CorCallOrQueueUserWorkItem(This,Function,Context,result) )
#define ICorThreadpool_CorSetMaxThreads(This,MaxWorkerThreads,MaxIOCompletionThreads) \
( (This)->lpVtbl -> CorSetMaxThreads(This,MaxWorkerThreads,MaxIOCompletionThreads) )
#define ICorThreadpool_CorGetMaxThreads(This,MaxWorkerThreads,MaxIOCompletionThreads) \
( (This)->lpVtbl -> CorGetMaxThreads(This,MaxWorkerThreads,MaxIOCompletionThreads) )
#define ICorThreadpool_CorGetAvailableThreads(This,AvailableWorkerThreads,AvailableIOCompletionThreads) \
( (This)->lpVtbl -> CorGetAvailableThreads(This,AvailableWorkerThreads,AvailableIOCompletionThreads) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICorThreadpool_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0005 */
/* [local] */
EXTERN_GUID(IID_IDebuggerThreadControl, 0x23d86786, 0x0bb5, 0x4774, 0x8f, 0xb5, 0xe3, 0x52, 0x2a, 0xdd, 0x62, 0x46);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0005_v0_0_s_ifspec;
#ifndef __IDebuggerThreadControl_INTERFACE_DEFINED__
#define __IDebuggerThreadControl_INTERFACE_DEFINED__
/* interface IDebuggerThreadControl */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IDebuggerThreadControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("23D86786-0BB5-4774-8FB5-E3522ADD6246")
IDebuggerThreadControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ThreadIsBlockingForDebugger( void) = 0;
virtual HRESULT STDMETHODCALLTYPE ReleaseAllRuntimeThreads( void) = 0;
virtual HRESULT STDMETHODCALLTYPE StartBlockingForDebugger(
DWORD dwUnused) = 0;
};
#else /* C style interface */
typedef struct IDebuggerThreadControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDebuggerThreadControl * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDebuggerThreadControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDebuggerThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *ThreadIsBlockingForDebugger )(
IDebuggerThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *ReleaseAllRuntimeThreads )(
IDebuggerThreadControl * This);
HRESULT ( STDMETHODCALLTYPE *StartBlockingForDebugger )(
IDebuggerThreadControl * This,
DWORD dwUnused);
END_INTERFACE
} IDebuggerThreadControlVtbl;
interface IDebuggerThreadControl
{
CONST_VTBL struct IDebuggerThreadControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDebuggerThreadControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDebuggerThreadControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDebuggerThreadControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDebuggerThreadControl_ThreadIsBlockingForDebugger(This) \
( (This)->lpVtbl -> ThreadIsBlockingForDebugger(This) )
#define IDebuggerThreadControl_ReleaseAllRuntimeThreads(This) \
( (This)->lpVtbl -> ReleaseAllRuntimeThreads(This) )
#define IDebuggerThreadControl_StartBlockingForDebugger(This,dwUnused) \
( (This)->lpVtbl -> StartBlockingForDebugger(This,dwUnused) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDebuggerThreadControl_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0006 */
/* [local] */
EXTERN_GUID(IID_IDebuggerInfo, 0xbf24142d, 0xa47d, 0x4d24, 0xa6, 0x6d, 0x8c, 0x21, 0x41, 0x94, 0x4e, 0x44);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0006_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0006_v0_0_s_ifspec;
#ifndef __IDebuggerInfo_INTERFACE_DEFINED__
#define __IDebuggerInfo_INTERFACE_DEFINED__
/* interface IDebuggerInfo */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IDebuggerInfo;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("BF24142D-A47D-4d24-A66D-8C2141944E44")
IDebuggerInfo : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE IsDebuggerAttached(
/* [out] */ BOOL *pbAttached) = 0;
};
#else /* C style interface */
typedef struct IDebuggerInfoVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDebuggerInfo * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDebuggerInfo * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDebuggerInfo * This);
HRESULT ( STDMETHODCALLTYPE *IsDebuggerAttached )(
IDebuggerInfo * This,
/* [out] */ BOOL *pbAttached);
END_INTERFACE
} IDebuggerInfoVtbl;
interface IDebuggerInfo
{
CONST_VTBL struct IDebuggerInfoVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDebuggerInfo_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDebuggerInfo_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDebuggerInfo_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDebuggerInfo_IsDebuggerAttached(This,pbAttached) \
( (This)->lpVtbl -> IsDebuggerAttached(This,pbAttached) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDebuggerInfo_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0007 */
/* [local] */
EXTERN_GUID(IID_ICorConfiguration, 0x5c2b07a5, 0x1e98, 0x11d3, 0x87, 0x2f, 0x00, 0xc0, 0x4f, 0x79, 0xed, 0x0d);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0007_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0007_v0_0_s_ifspec;
#ifndef __ICorConfiguration_INTERFACE_DEFINED__
#define __ICorConfiguration_INTERFACE_DEFINED__
/* interface ICorConfiguration */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICorConfiguration;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5C2B07A5-1E98-11d3-872F-00C04F79ED0D")
ICorConfiguration : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetGCThreadControl(
/* [in] */ IGCThreadControl *pGCThreadControl) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGCHostControl(
/* [in] */ IGCHostControl *pGCHostControl) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDebuggerThreadControl(
/* [in] */ IDebuggerThreadControl *pDebuggerThreadControl) = 0;
virtual HRESULT STDMETHODCALLTYPE AddDebuggerSpecialThread(
/* [in] */ DWORD dwSpecialThreadId) = 0;
};
#else /* C style interface */
typedef struct ICorConfigurationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICorConfiguration * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICorConfiguration * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICorConfiguration * This);
HRESULT ( STDMETHODCALLTYPE *SetGCThreadControl )(
ICorConfiguration * This,
/* [in] */ IGCThreadControl *pGCThreadControl);
HRESULT ( STDMETHODCALLTYPE *SetGCHostControl )(
ICorConfiguration * This,
/* [in] */ IGCHostControl *pGCHostControl);
HRESULT ( STDMETHODCALLTYPE *SetDebuggerThreadControl )(
ICorConfiguration * This,
/* [in] */ IDebuggerThreadControl *pDebuggerThreadControl);
HRESULT ( STDMETHODCALLTYPE *AddDebuggerSpecialThread )(
ICorConfiguration * This,
/* [in] */ DWORD dwSpecialThreadId);
END_INTERFACE
} ICorConfigurationVtbl;
interface ICorConfiguration
{
CONST_VTBL struct ICorConfigurationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICorConfiguration_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICorConfiguration_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICorConfiguration_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICorConfiguration_SetGCThreadControl(This,pGCThreadControl) \
( (This)->lpVtbl -> SetGCThreadControl(This,pGCThreadControl) )
#define ICorConfiguration_SetGCHostControl(This,pGCHostControl) \
( (This)->lpVtbl -> SetGCHostControl(This,pGCHostControl) )
#define ICorConfiguration_SetDebuggerThreadControl(This,pDebuggerThreadControl) \
( (This)->lpVtbl -> SetDebuggerThreadControl(This,pDebuggerThreadControl) )
#define ICorConfiguration_AddDebuggerSpecialThread(This,dwSpecialThreadId) \
( (This)->lpVtbl -> AddDebuggerSpecialThread(This,dwSpecialThreadId) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICorConfiguration_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0008 */
/* [local] */
typedef void *HDOMAINENUM;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0008_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0008_v0_0_s_ifspec;
#ifndef __ICorRuntimeHost_INTERFACE_DEFINED__
#define __ICorRuntimeHost_INTERFACE_DEFINED__
/* interface ICorRuntimeHost */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICorRuntimeHost;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("CB2F6722-AB3A-11d2-9C40-00C04FA30A3E")
ICorRuntimeHost : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateLogicalThreadState( void) = 0;
virtual HRESULT STDMETHODCALLTYPE DeleteLogicalThreadState( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SwitchInLogicalThreadState(
/* [in] */ DWORD *pFiberCookie) = 0;
virtual HRESULT STDMETHODCALLTYPE SwitchOutLogicalThreadState(
/* [out] */ DWORD **pFiberCookie) = 0;
virtual HRESULT STDMETHODCALLTYPE LocksHeldByLogicalThread(
/* [out] */ DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE MapFile(
/* [in] */ HANDLE hFile,
/* [out] */ HMODULE *hMapAddress) = 0;
virtual HRESULT STDMETHODCALLTYPE GetConfiguration(
/* [out] */ ICorConfiguration **pConfiguration) = 0;
virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDomain(
/* [in] */ LPCWSTR pwzFriendlyName,
/* [in] */ IUnknown *pIdentityArray,
/* [out] */ IUnknown **pAppDomain) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDefaultDomain(
/* [out] */ IUnknown **pAppDomain) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumDomains(
/* [out] */ HDOMAINENUM *hEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE NextDomain(
/* [in] */ HDOMAINENUM hEnum,
/* [out] */ IUnknown **pAppDomain) = 0;
virtual HRESULT STDMETHODCALLTYPE CloseEnum(
/* [in] */ HDOMAINENUM hEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDomainEx(
/* [in] */ LPCWSTR pwzFriendlyName,
/* [in] */ IUnknown *pSetup,
/* [in] */ IUnknown *pEvidence,
/* [out] */ IUnknown **pAppDomain) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDomainSetup(
/* [out] */ IUnknown **pAppDomainSetup) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateEvidence(
/* [out] */ IUnknown **pEvidence) = 0;
virtual HRESULT STDMETHODCALLTYPE UnloadDomain(
/* [in] */ IUnknown *pAppDomain) = 0;
virtual HRESULT STDMETHODCALLTYPE CurrentDomain(
/* [out] */ IUnknown **pAppDomain) = 0;
};
#else /* C style interface */
typedef struct ICorRuntimeHostVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICorRuntimeHost * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICorRuntimeHost * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICorRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *CreateLogicalThreadState )(
ICorRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *DeleteLogicalThreadState )(
ICorRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *SwitchInLogicalThreadState )(
ICorRuntimeHost * This,
/* [in] */ DWORD *pFiberCookie);
HRESULT ( STDMETHODCALLTYPE *SwitchOutLogicalThreadState )(
ICorRuntimeHost * This,
/* [out] */ DWORD **pFiberCookie);
HRESULT ( STDMETHODCALLTYPE *LocksHeldByLogicalThread )(
ICorRuntimeHost * This,
/* [out] */ DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *MapFile )(
ICorRuntimeHost * This,
/* [in] */ HANDLE hFile,
/* [out] */ HMODULE *hMapAddress);
HRESULT ( STDMETHODCALLTYPE *GetConfiguration )(
ICorRuntimeHost * This,
/* [out] */ ICorConfiguration **pConfiguration);
HRESULT ( STDMETHODCALLTYPE *Start )(
ICorRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *Stop )(
ICorRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *CreateDomain )(
ICorRuntimeHost * This,
/* [in] */ LPCWSTR pwzFriendlyName,
/* [in] */ IUnknown *pIdentityArray,
/* [out] */ IUnknown **pAppDomain);
HRESULT ( STDMETHODCALLTYPE *GetDefaultDomain )(
ICorRuntimeHost * This,
/* [out] */ IUnknown **pAppDomain);
HRESULT ( STDMETHODCALLTYPE *EnumDomains )(
ICorRuntimeHost * This,
/* [out] */ HDOMAINENUM *hEnum);
HRESULT ( STDMETHODCALLTYPE *NextDomain )(
ICorRuntimeHost * This,
/* [in] */ HDOMAINENUM hEnum,
/* [out] */ IUnknown **pAppDomain);
HRESULT ( STDMETHODCALLTYPE *CloseEnum )(
ICorRuntimeHost * This,
/* [in] */ HDOMAINENUM hEnum);
HRESULT ( STDMETHODCALLTYPE *CreateDomainEx )(
ICorRuntimeHost * This,
/* [in] */ LPCWSTR pwzFriendlyName,
/* [in] */ IUnknown *pSetup,
/* [in] */ IUnknown *pEvidence,
/* [out] */ IUnknown **pAppDomain);
HRESULT ( STDMETHODCALLTYPE *CreateDomainSetup )(
ICorRuntimeHost * This,
/* [out] */ IUnknown **pAppDomainSetup);
HRESULT ( STDMETHODCALLTYPE *CreateEvidence )(
ICorRuntimeHost * This,
/* [out] */ IUnknown **pEvidence);
HRESULT ( STDMETHODCALLTYPE *UnloadDomain )(
ICorRuntimeHost * This,
/* [in] */ IUnknown *pAppDomain);
HRESULT ( STDMETHODCALLTYPE *CurrentDomain )(
ICorRuntimeHost * This,
/* [out] */ IUnknown **pAppDomain);
END_INTERFACE
} ICorRuntimeHostVtbl;
interface ICorRuntimeHost
{
CONST_VTBL struct ICorRuntimeHostVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICorRuntimeHost_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICorRuntimeHost_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICorRuntimeHost_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICorRuntimeHost_CreateLogicalThreadState(This) \
( (This)->lpVtbl -> CreateLogicalThreadState(This) )
#define ICorRuntimeHost_DeleteLogicalThreadState(This) \
( (This)->lpVtbl -> DeleteLogicalThreadState(This) )
#define ICorRuntimeHost_SwitchInLogicalThreadState(This,pFiberCookie) \
( (This)->lpVtbl -> SwitchInLogicalThreadState(This,pFiberCookie) )
#define ICorRuntimeHost_SwitchOutLogicalThreadState(This,pFiberCookie) \
( (This)->lpVtbl -> SwitchOutLogicalThreadState(This,pFiberCookie) )
#define ICorRuntimeHost_LocksHeldByLogicalThread(This,pCount) \
( (This)->lpVtbl -> LocksHeldByLogicalThread(This,pCount) )
#define ICorRuntimeHost_MapFile(This,hFile,hMapAddress) \
( (This)->lpVtbl -> MapFile(This,hFile,hMapAddress) )
#define ICorRuntimeHost_GetConfiguration(This,pConfiguration) \
( (This)->lpVtbl -> GetConfiguration(This,pConfiguration) )
#define ICorRuntimeHost_Start(This) \
( (This)->lpVtbl -> Start(This) )
#define ICorRuntimeHost_Stop(This) \
( (This)->lpVtbl -> Stop(This) )
#define ICorRuntimeHost_CreateDomain(This,pwzFriendlyName,pIdentityArray,pAppDomain) \
( (This)->lpVtbl -> CreateDomain(This,pwzFriendlyName,pIdentityArray,pAppDomain) )
#define ICorRuntimeHost_GetDefaultDomain(This,pAppDomain) \
( (This)->lpVtbl -> GetDefaultDomain(This,pAppDomain) )
#define ICorRuntimeHost_EnumDomains(This,hEnum) \
( (This)->lpVtbl -> EnumDomains(This,hEnum) )
#define ICorRuntimeHost_NextDomain(This,hEnum,pAppDomain) \
( (This)->lpVtbl -> NextDomain(This,hEnum,pAppDomain) )
#define ICorRuntimeHost_CloseEnum(This,hEnum) \
( (This)->lpVtbl -> CloseEnum(This,hEnum) )
#define ICorRuntimeHost_CreateDomainEx(This,pwzFriendlyName,pSetup,pEvidence,pAppDomain) \
( (This)->lpVtbl -> CreateDomainEx(This,pwzFriendlyName,pSetup,pEvidence,pAppDomain) )
#define ICorRuntimeHost_CreateDomainSetup(This,pAppDomainSetup) \
( (This)->lpVtbl -> CreateDomainSetup(This,pAppDomainSetup) )
#define ICorRuntimeHost_CreateEvidence(This,pEvidence) \
( (This)->lpVtbl -> CreateEvidence(This,pEvidence) )
#define ICorRuntimeHost_UnloadDomain(This,pAppDomain) \
( (This)->lpVtbl -> UnloadDomain(This,pAppDomain) )
#define ICorRuntimeHost_CurrentDomain(This,pAppDomain) \
( (This)->lpVtbl -> CurrentDomain(This,pAppDomain) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICorRuntimeHost_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0009 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0009_0001
{ eMemoryAvailableLow = 1,
eMemoryAvailableNeutral = 2,
eMemoryAvailableHigh = 3
} EMemoryAvailable;
typedef /* [public][public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0009_0002
{ eTaskCritical = 0,
eAppDomainCritical = 1,
eProcessCritical = 2
} EMemoryCriticalLevel;
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0009_0003
{ WAIT_MSGPUMP = 0x1,
WAIT_ALERTABLE = 0x2,
WAIT_NOTINDEADLOCK = 0x4
} WAIT_OPTION;
EXTERN_GUID(IID_ICLRMemoryNotificationCallback, 0x47EB8E57, 0x0846, 0x4546, 0xAF, 0x76, 0x6F, 0x42, 0xFC, 0xFC, 0x26, 0x49);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0009_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0009_v0_0_s_ifspec;
#ifndef __ICLRMemoryNotificationCallback_INTERFACE_DEFINED__
#define __ICLRMemoryNotificationCallback_INTERFACE_DEFINED__
/* interface ICLRMemoryNotificationCallback */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRMemoryNotificationCallback;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("47EB8E57-0846-4546-AF76-6F42FCFC2649")
ICLRMemoryNotificationCallback : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OnMemoryNotification(
/* [in] */ EMemoryAvailable eMemoryAvailable) = 0;
};
#else /* C style interface */
typedef struct ICLRMemoryNotificationCallbackVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRMemoryNotificationCallback * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRMemoryNotificationCallback * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRMemoryNotificationCallback * This);
HRESULT ( STDMETHODCALLTYPE *OnMemoryNotification )(
ICLRMemoryNotificationCallback * This,
/* [in] */ EMemoryAvailable eMemoryAvailable);
END_INTERFACE
} ICLRMemoryNotificationCallbackVtbl;
interface ICLRMemoryNotificationCallback
{
CONST_VTBL struct ICLRMemoryNotificationCallbackVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRMemoryNotificationCallback_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRMemoryNotificationCallback_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRMemoryNotificationCallback_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRMemoryNotificationCallback_OnMemoryNotification(This,eMemoryAvailable) \
( (This)->lpVtbl -> OnMemoryNotification(This,eMemoryAvailable) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRMemoryNotificationCallback_INTERFACE_DEFINED__ */
#ifndef __IHostMalloc_INTERFACE_DEFINED__
#define __IHostMalloc_INTERFACE_DEFINED__
/* interface IHostMalloc */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostMalloc;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1831991C-CC53-4A31-B218-04E910446479")
IHostMalloc : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Alloc(
/* [in] */ SIZE_T cbSize,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [out] */ void **ppMem) = 0;
virtual HRESULT STDMETHODCALLTYPE DebugAlloc(
/* [in] */ SIZE_T cbSize,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [in] */
__in char *pszFileName,
/* [in] */ int iLineNo,
/* [out] */
__deref_out_opt void **ppMem) = 0;
virtual HRESULT STDMETHODCALLTYPE Free(
/* [in] */ void *pMem) = 0;
};
#else /* C style interface */
typedef struct IHostMallocVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostMalloc * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostMalloc * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostMalloc * This);
HRESULT ( STDMETHODCALLTYPE *Alloc )(
IHostMalloc * This,
/* [in] */ SIZE_T cbSize,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [out] */ void **ppMem);
HRESULT ( STDMETHODCALLTYPE *DebugAlloc )(
IHostMalloc * This,
/* [in] */ SIZE_T cbSize,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [in] */
__in char *pszFileName,
/* [in] */ int iLineNo,
/* [out] */
__deref_out_opt void **ppMem);
HRESULT ( STDMETHODCALLTYPE *Free )(
IHostMalloc * This,
/* [in] */ void *pMem);
END_INTERFACE
} IHostMallocVtbl;
interface IHostMalloc
{
CONST_VTBL struct IHostMallocVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostMalloc_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostMalloc_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostMalloc_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostMalloc_Alloc(This,cbSize,eCriticalLevel,ppMem) \
( (This)->lpVtbl -> Alloc(This,cbSize,eCriticalLevel,ppMem) )
#define IHostMalloc_DebugAlloc(This,cbSize,eCriticalLevel,pszFileName,iLineNo,ppMem) \
( (This)->lpVtbl -> DebugAlloc(This,cbSize,eCriticalLevel,pszFileName,iLineNo,ppMem) )
#define IHostMalloc_Free(This,pMem) \
( (This)->lpVtbl -> Free(This,pMem) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostMalloc_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0011 */
/* [local] */
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0011_0001
{ MALLOC_THREADSAFE = 0x1,
MALLOC_EXECUTABLE = 0x2
} MALLOC_TYPE;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0011_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0011_v0_0_s_ifspec;
#ifndef __IHostMemoryManager_INTERFACE_DEFINED__
#define __IHostMemoryManager_INTERFACE_DEFINED__
/* interface IHostMemoryManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostMemoryManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7BC698D1-F9E3-4460-9CDE-D04248E9FA25")
IHostMemoryManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateMalloc(
/* [in] */ DWORD dwMallocType,
/* [out] */ IHostMalloc **ppMalloc) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualAlloc(
/* [in] */ void *pAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD flAllocationType,
/* [in] */ DWORD flProtect,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [out] */ void **ppMem) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualFree(
/* [in] */ LPVOID lpAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD dwFreeType) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualQuery(
/* [in] */ void *lpAddress,
/* [out] */ void *lpBuffer,
/* [in] */ SIZE_T dwLength,
/* [out] */ SIZE_T *pResult) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualProtect(
/* [in] */ void *lpAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD flNewProtect,
/* [out] */ DWORD *pflOldProtect) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMemoryLoad(
/* [out] */ DWORD *pMemoryLoad,
/* [out] */ SIZE_T *pAvailableBytes) = 0;
virtual HRESULT STDMETHODCALLTYPE RegisterMemoryNotificationCallback(
/* [in] */ ICLRMemoryNotificationCallback *pCallback) = 0;
virtual HRESULT STDMETHODCALLTYPE NeedsVirtualAddressSpace(
/* [in] */ LPVOID startAddress,
/* [in] */ SIZE_T size) = 0;
virtual HRESULT STDMETHODCALLTYPE AcquiredVirtualAddressSpace(
/* [in] */ LPVOID startAddress,
/* [in] */ SIZE_T size) = 0;
virtual HRESULT STDMETHODCALLTYPE ReleasedVirtualAddressSpace(
/* [in] */ LPVOID startAddress) = 0;
};
#else /* C style interface */
typedef struct IHostMemoryManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostMemoryManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostMemoryManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostMemoryManager * This);
HRESULT ( STDMETHODCALLTYPE *CreateMalloc )(
IHostMemoryManager * This,
/* [in] */ DWORD dwMallocType,
/* [out] */ IHostMalloc **ppMalloc);
HRESULT ( STDMETHODCALLTYPE *VirtualAlloc )(
IHostMemoryManager * This,
/* [in] */ void *pAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD flAllocationType,
/* [in] */ DWORD flProtect,
/* [in] */ EMemoryCriticalLevel eCriticalLevel,
/* [out] */ void **ppMem);
HRESULT ( STDMETHODCALLTYPE *VirtualFree )(
IHostMemoryManager * This,
/* [in] */ LPVOID lpAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD dwFreeType);
HRESULT ( STDMETHODCALLTYPE *VirtualQuery )(
IHostMemoryManager * This,
/* [in] */ void *lpAddress,
/* [out] */ void *lpBuffer,
/* [in] */ SIZE_T dwLength,
/* [out] */ SIZE_T *pResult);
HRESULT ( STDMETHODCALLTYPE *VirtualProtect )(
IHostMemoryManager * This,
/* [in] */ void *lpAddress,
/* [in] */ SIZE_T dwSize,
/* [in] */ DWORD flNewProtect,
/* [out] */ DWORD *pflOldProtect);
HRESULT ( STDMETHODCALLTYPE *GetMemoryLoad )(
IHostMemoryManager * This,
/* [out] */ DWORD *pMemoryLoad,
/* [out] */ SIZE_T *pAvailableBytes);
HRESULT ( STDMETHODCALLTYPE *RegisterMemoryNotificationCallback )(
IHostMemoryManager * This,
/* [in] */ ICLRMemoryNotificationCallback *pCallback);
HRESULT ( STDMETHODCALLTYPE *NeedsVirtualAddressSpace )(
IHostMemoryManager * This,
/* [in] */ LPVOID startAddress,
/* [in] */ SIZE_T size);
HRESULT ( STDMETHODCALLTYPE *AcquiredVirtualAddressSpace )(
IHostMemoryManager * This,
/* [in] */ LPVOID startAddress,
/* [in] */ SIZE_T size);
HRESULT ( STDMETHODCALLTYPE *ReleasedVirtualAddressSpace )(
IHostMemoryManager * This,
/* [in] */ LPVOID startAddress);
END_INTERFACE
} IHostMemoryManagerVtbl;
interface IHostMemoryManager
{
CONST_VTBL struct IHostMemoryManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostMemoryManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostMemoryManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostMemoryManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostMemoryManager_CreateMalloc(This,dwMallocType,ppMalloc) \
( (This)->lpVtbl -> CreateMalloc(This,dwMallocType,ppMalloc) )
#define IHostMemoryManager_VirtualAlloc(This,pAddress,dwSize,flAllocationType,flProtect,eCriticalLevel,ppMem) \
( (This)->lpVtbl -> VirtualAlloc(This,pAddress,dwSize,flAllocationType,flProtect,eCriticalLevel,ppMem) )
#define IHostMemoryManager_VirtualFree(This,lpAddress,dwSize,dwFreeType) \
( (This)->lpVtbl -> VirtualFree(This,lpAddress,dwSize,dwFreeType) )
#define IHostMemoryManager_VirtualQuery(This,lpAddress,lpBuffer,dwLength,pResult) \
( (This)->lpVtbl -> VirtualQuery(This,lpAddress,lpBuffer,dwLength,pResult) )
#define IHostMemoryManager_VirtualProtect(This,lpAddress,dwSize,flNewProtect,pflOldProtect) \
( (This)->lpVtbl -> VirtualProtect(This,lpAddress,dwSize,flNewProtect,pflOldProtect) )
#define IHostMemoryManager_GetMemoryLoad(This,pMemoryLoad,pAvailableBytes) \
( (This)->lpVtbl -> GetMemoryLoad(This,pMemoryLoad,pAvailableBytes) )
#define IHostMemoryManager_RegisterMemoryNotificationCallback(This,pCallback) \
( (This)->lpVtbl -> RegisterMemoryNotificationCallback(This,pCallback) )
#define IHostMemoryManager_NeedsVirtualAddressSpace(This,startAddress,size) \
( (This)->lpVtbl -> NeedsVirtualAddressSpace(This,startAddress,size) )
#define IHostMemoryManager_AcquiredVirtualAddressSpace(This,startAddress,size) \
( (This)->lpVtbl -> AcquiredVirtualAddressSpace(This,startAddress,size) )
#define IHostMemoryManager_ReleasedVirtualAddressSpace(This,startAddress) \
( (This)->lpVtbl -> ReleasedVirtualAddressSpace(This,startAddress) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostMemoryManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0012 */
/* [local] */
typedef UINT64 TASKID;
typedef DWORD CONNID;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0012_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0012_v0_0_s_ifspec;
#ifndef __ICLRTask_INTERFACE_DEFINED__
#define __ICLRTask_INTERFACE_DEFINED__
/* interface ICLRTask */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRTask;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("28E66A4A-9906-4225-B231-9187C3EB8611")
ICLRTask : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SwitchIn(
/* [in] */ HANDLE threadHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE SwitchOut( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMemStats(
/* [out] */ COR_GC_THREAD_STATS *memUsage) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset(
BOOL fFull) = 0;
virtual HRESULT STDMETHODCALLTYPE ExitTask( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Abort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE RudeAbort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE NeedsPriorityScheduling(
/* [out] */ BOOL *pbNeedsPriorityScheduling) = 0;
virtual HRESULT STDMETHODCALLTYPE YieldTask( void) = 0;
virtual HRESULT STDMETHODCALLTYPE LocksHeld(
/* [out] */ SIZE_T *pLockCount) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTaskIdentifier(
/* [in] */ TASKID asked) = 0;
};
#else /* C style interface */
typedef struct ICLRTaskVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRTask * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRTask * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *SwitchIn )(
ICLRTask * This,
/* [in] */ HANDLE threadHandle);
HRESULT ( STDMETHODCALLTYPE *SwitchOut )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *GetMemStats )(
ICLRTask * This,
/* [out] */ COR_GC_THREAD_STATS *memUsage);
HRESULT ( STDMETHODCALLTYPE *Reset )(
ICLRTask * This,
BOOL fFull);
HRESULT ( STDMETHODCALLTYPE *ExitTask )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *Abort )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *RudeAbort )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *NeedsPriorityScheduling )(
ICLRTask * This,
/* [out] */ BOOL *pbNeedsPriorityScheduling);
HRESULT ( STDMETHODCALLTYPE *YieldTask )(
ICLRTask * This);
HRESULT ( STDMETHODCALLTYPE *LocksHeld )(
ICLRTask * This,
/* [out] */ SIZE_T *pLockCount);
HRESULT ( STDMETHODCALLTYPE *SetTaskIdentifier )(
ICLRTask * This,
/* [in] */ TASKID asked);
END_INTERFACE
} ICLRTaskVtbl;
interface ICLRTask
{
CONST_VTBL struct ICLRTaskVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRTask_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRTask_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRTask_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRTask_SwitchIn(This,threadHandle) \
( (This)->lpVtbl -> SwitchIn(This,threadHandle) )
#define ICLRTask_SwitchOut(This) \
( (This)->lpVtbl -> SwitchOut(This) )
#define ICLRTask_GetMemStats(This,memUsage) \
( (This)->lpVtbl -> GetMemStats(This,memUsage) )
#define ICLRTask_Reset(This,fFull) \
( (This)->lpVtbl -> Reset(This,fFull) )
#define ICLRTask_ExitTask(This) \
( (This)->lpVtbl -> ExitTask(This) )
#define ICLRTask_Abort(This) \
( (This)->lpVtbl -> Abort(This) )
#define ICLRTask_RudeAbort(This) \
( (This)->lpVtbl -> RudeAbort(This) )
#define ICLRTask_NeedsPriorityScheduling(This,pbNeedsPriorityScheduling) \
( (This)->lpVtbl -> NeedsPriorityScheduling(This,pbNeedsPriorityScheduling) )
#define ICLRTask_YieldTask(This) \
( (This)->lpVtbl -> YieldTask(This) )
#define ICLRTask_LocksHeld(This,pLockCount) \
( (This)->lpVtbl -> LocksHeld(This,pLockCount) )
#define ICLRTask_SetTaskIdentifier(This,asked) \
( (This)->lpVtbl -> SetTaskIdentifier(This,asked) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRTask_INTERFACE_DEFINED__ */
#ifndef __ICLRTask2_INTERFACE_DEFINED__
#define __ICLRTask2_INTERFACE_DEFINED__
/* interface ICLRTask2 */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRTask2;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("28E66A4A-9906-4225-B231-9187C3EB8612")
ICLRTask2 : public ICLRTask
{
public:
virtual HRESULT STDMETHODCALLTYPE BeginPreventAsyncAbort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE EndPreventAsyncAbort( void) = 0;
};
#else /* C style interface */
typedef struct ICLRTask2Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRTask2 * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRTask2 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *SwitchIn )(
ICLRTask2 * This,
/* [in] */ HANDLE threadHandle);
HRESULT ( STDMETHODCALLTYPE *SwitchOut )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *GetMemStats )(
ICLRTask2 * This,
/* [out] */ COR_GC_THREAD_STATS *memUsage);
HRESULT ( STDMETHODCALLTYPE *Reset )(
ICLRTask2 * This,
BOOL fFull);
HRESULT ( STDMETHODCALLTYPE *ExitTask )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *Abort )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *RudeAbort )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *NeedsPriorityScheduling )(
ICLRTask2 * This,
/* [out] */ BOOL *pbNeedsPriorityScheduling);
HRESULT ( STDMETHODCALLTYPE *YieldTask )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *LocksHeld )(
ICLRTask2 * This,
/* [out] */ SIZE_T *pLockCount);
HRESULT ( STDMETHODCALLTYPE *SetTaskIdentifier )(
ICLRTask2 * This,
/* [in] */ TASKID asked);
HRESULT ( STDMETHODCALLTYPE *BeginPreventAsyncAbort )(
ICLRTask2 * This);
HRESULT ( STDMETHODCALLTYPE *EndPreventAsyncAbort )(
ICLRTask2 * This);
END_INTERFACE
} ICLRTask2Vtbl;
interface ICLRTask2
{
CONST_VTBL struct ICLRTask2Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRTask2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRTask2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRTask2_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRTask2_SwitchIn(This,threadHandle) \
( (This)->lpVtbl -> SwitchIn(This,threadHandle) )
#define ICLRTask2_SwitchOut(This) \
( (This)->lpVtbl -> SwitchOut(This) )
#define ICLRTask2_GetMemStats(This,memUsage) \
( (This)->lpVtbl -> GetMemStats(This,memUsage) )
#define ICLRTask2_Reset(This,fFull) \
( (This)->lpVtbl -> Reset(This,fFull) )
#define ICLRTask2_ExitTask(This) \
( (This)->lpVtbl -> ExitTask(This) )
#define ICLRTask2_Abort(This) \
( (This)->lpVtbl -> Abort(This) )
#define ICLRTask2_RudeAbort(This) \
( (This)->lpVtbl -> RudeAbort(This) )
#define ICLRTask2_NeedsPriorityScheduling(This,pbNeedsPriorityScheduling) \
( (This)->lpVtbl -> NeedsPriorityScheduling(This,pbNeedsPriorityScheduling) )
#define ICLRTask2_YieldTask(This) \
( (This)->lpVtbl -> YieldTask(This) )
#define ICLRTask2_LocksHeld(This,pLockCount) \
( (This)->lpVtbl -> LocksHeld(This,pLockCount) )
#define ICLRTask2_SetTaskIdentifier(This,asked) \
( (This)->lpVtbl -> SetTaskIdentifier(This,asked) )
#define ICLRTask2_BeginPreventAsyncAbort(This) \
( (This)->lpVtbl -> BeginPreventAsyncAbort(This) )
#define ICLRTask2_EndPreventAsyncAbort(This) \
( (This)->lpVtbl -> EndPreventAsyncAbort(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRTask2_INTERFACE_DEFINED__ */
#ifndef __IHostTask_INTERFACE_DEFINED__
#define __IHostTask_INTERFACE_DEFINED__
/* interface IHostTask */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostTask;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C2275828-C4B1-4B55-82C9-92135F74DF1A")
IHostTask : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Alert( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Join(
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPriority(
/* [in] */ int newPriority) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPriority(
/* [out] */ int *pPriority) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCLRTask(
/* [in] */ ICLRTask *pCLRTask) = 0;
};
#else /* C style interface */
typedef struct IHostTaskVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostTask * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostTask * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostTask * This);
HRESULT ( STDMETHODCALLTYPE *Start )(
IHostTask * This);
HRESULT ( STDMETHODCALLTYPE *Alert )(
IHostTask * This);
HRESULT ( STDMETHODCALLTYPE *Join )(
IHostTask * This,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *SetPriority )(
IHostTask * This,
/* [in] */ int newPriority);
HRESULT ( STDMETHODCALLTYPE *GetPriority )(
IHostTask * This,
/* [out] */ int *pPriority);
HRESULT ( STDMETHODCALLTYPE *SetCLRTask )(
IHostTask * This,
/* [in] */ ICLRTask *pCLRTask);
END_INTERFACE
} IHostTaskVtbl;
interface IHostTask
{
CONST_VTBL struct IHostTaskVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostTask_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostTask_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostTask_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostTask_Start(This) \
( (This)->lpVtbl -> Start(This) )
#define IHostTask_Alert(This) \
( (This)->lpVtbl -> Alert(This) )
#define IHostTask_Join(This,dwMilliseconds,option) \
( (This)->lpVtbl -> Join(This,dwMilliseconds,option) )
#define IHostTask_SetPriority(This,newPriority) \
( (This)->lpVtbl -> SetPriority(This,newPriority) )
#define IHostTask_GetPriority(This,pPriority) \
( (This)->lpVtbl -> GetPriority(This,pPriority) )
#define IHostTask_SetCLRTask(This,pCLRTask) \
( (This)->lpVtbl -> SetCLRTask(This,pCLRTask) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostTask_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0015 */
/* [local] */
typedef
enum ETaskType
{ TT_DEBUGGERHELPER = 0x1,
TT_GC = 0x2,
TT_FINALIZER = 0x4,
TT_THREADPOOL_TIMER = 0x8,
TT_THREADPOOL_GATE = 0x10,
TT_THREADPOOL_WORKER = 0x20,
TT_THREADPOOL_IOCOMPLETION = 0x40,
TT_ADUNLOAD = 0x80,
TT_USER = 0x100,
TT_THREADPOOL_WAIT = 0x200,
TT_UNKNOWN = 0x80000000
} ETaskType;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0015_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0015_v0_0_s_ifspec;
#ifndef __ICLRTaskManager_INTERFACE_DEFINED__
#define __ICLRTaskManager_INTERFACE_DEFINED__
/* interface ICLRTaskManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRTaskManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4862efbe-3ae5-44f8-8feb-346190ee8a34")
ICLRTaskManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateTask(
/* [out] */ ICLRTask **pTask) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentTask(
/* [out] */ ICLRTask **pTask) = 0;
virtual HRESULT STDMETHODCALLTYPE SetUILocale(
/* [in] */ LCID lcid) = 0;
virtual HRESULT STDMETHODCALLTYPE SetLocale(
/* [in] */ LCID lcid) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentTaskType(
/* [out] */ ETaskType *pTaskType) = 0;
};
#else /* C style interface */
typedef struct ICLRTaskManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRTaskManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRTaskManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *CreateTask )(
ICLRTaskManager * This,
/* [out] */ ICLRTask **pTask);
HRESULT ( STDMETHODCALLTYPE *GetCurrentTask )(
ICLRTaskManager * This,
/* [out] */ ICLRTask **pTask);
HRESULT ( STDMETHODCALLTYPE *SetUILocale )(
ICLRTaskManager * This,
/* [in] */ LCID lcid);
HRESULT ( STDMETHODCALLTYPE *SetLocale )(
ICLRTaskManager * This,
/* [in] */ LCID lcid);
HRESULT ( STDMETHODCALLTYPE *GetCurrentTaskType )(
ICLRTaskManager * This,
/* [out] */ ETaskType *pTaskType);
END_INTERFACE
} ICLRTaskManagerVtbl;
interface ICLRTaskManager
{
CONST_VTBL struct ICLRTaskManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRTaskManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRTaskManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRTaskManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRTaskManager_CreateTask(This,pTask) \
( (This)->lpVtbl -> CreateTask(This,pTask) )
#define ICLRTaskManager_GetCurrentTask(This,pTask) \
( (This)->lpVtbl -> GetCurrentTask(This,pTask) )
#define ICLRTaskManager_SetUILocale(This,lcid) \
( (This)->lpVtbl -> SetUILocale(This,lcid) )
#define ICLRTaskManager_SetLocale(This,lcid) \
( (This)->lpVtbl -> SetLocale(This,lcid) )
#define ICLRTaskManager_GetCurrentTaskType(This,pTaskType) \
( (This)->lpVtbl -> GetCurrentTaskType(This,pTaskType) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRTaskManager_INTERFACE_DEFINED__ */
#ifndef __IHostTaskManager_INTERFACE_DEFINED__
#define __IHostTaskManager_INTERFACE_DEFINED__
/* interface IHostTaskManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostTaskManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("997FF24C-43B7-4352-8667-0DC04FAFD354")
IHostTaskManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCurrentTask(
/* [out] */ IHostTask **pTask) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTask(
/* [in] */ DWORD dwStackSize,
/* [in] */ LPTHREAD_START_ROUTINE pStartAddress,
/* [in] */ PVOID pParameter,
/* [out] */ IHostTask **ppTask) = 0;
virtual HRESULT STDMETHODCALLTYPE Sleep(
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE SwitchToTask(
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE SetUILocale(
/* [in] */ LCID lcid) = 0;
virtual HRESULT STDMETHODCALLTYPE SetLocale(
/* [in] */ LCID lcid) = 0;
virtual HRESULT STDMETHODCALLTYPE CallNeedsHostHook(
/* [in] */ SIZE_T target,
/* [out] */ BOOL *pbCallNeedsHostHook) = 0;
virtual HRESULT STDMETHODCALLTYPE LeaveRuntime(
/* [in] */ SIZE_T target) = 0;
virtual HRESULT STDMETHODCALLTYPE EnterRuntime( void) = 0;
virtual HRESULT STDMETHODCALLTYPE ReverseLeaveRuntime( void) = 0;
virtual HRESULT STDMETHODCALLTYPE ReverseEnterRuntime( void) = 0;
virtual HRESULT STDMETHODCALLTYPE BeginDelayAbort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE EndDelayAbort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE BeginThreadAffinity( void) = 0;
virtual HRESULT STDMETHODCALLTYPE EndThreadAffinity( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SetStackGuarantee(
/* [in] */ ULONG guarantee) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStackGuarantee(
/* [out] */ ULONG *pGuarantee) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCLRTaskManager(
/* [in] */ ICLRTaskManager *ppManager) = 0;
};
#else /* C style interface */
typedef struct IHostTaskManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostTaskManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostTaskManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *GetCurrentTask )(
IHostTaskManager * This,
/* [out] */ IHostTask **pTask);
HRESULT ( STDMETHODCALLTYPE *CreateTask )(
IHostTaskManager * This,
/* [in] */ DWORD dwStackSize,
/* [in] */ LPTHREAD_START_ROUTINE pStartAddress,
/* [in] */ PVOID pParameter,
/* [out] */ IHostTask **ppTask);
HRESULT ( STDMETHODCALLTYPE *Sleep )(
IHostTaskManager * This,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *SwitchToTask )(
IHostTaskManager * This,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *SetUILocale )(
IHostTaskManager * This,
/* [in] */ LCID lcid);
HRESULT ( STDMETHODCALLTYPE *SetLocale )(
IHostTaskManager * This,
/* [in] */ LCID lcid);
HRESULT ( STDMETHODCALLTYPE *CallNeedsHostHook )(
IHostTaskManager * This,
/* [in] */ SIZE_T target,
/* [out] */ BOOL *pbCallNeedsHostHook);
HRESULT ( STDMETHODCALLTYPE *LeaveRuntime )(
IHostTaskManager * This,
/* [in] */ SIZE_T target);
HRESULT ( STDMETHODCALLTYPE *EnterRuntime )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *ReverseLeaveRuntime )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *ReverseEnterRuntime )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *BeginDelayAbort )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *EndDelayAbort )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *BeginThreadAffinity )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *EndThreadAffinity )(
IHostTaskManager * This);
HRESULT ( STDMETHODCALLTYPE *SetStackGuarantee )(
IHostTaskManager * This,
/* [in] */ ULONG guarantee);
HRESULT ( STDMETHODCALLTYPE *GetStackGuarantee )(
IHostTaskManager * This,
/* [out] */ ULONG *pGuarantee);
HRESULT ( STDMETHODCALLTYPE *SetCLRTaskManager )(
IHostTaskManager * This,
/* [in] */ ICLRTaskManager *ppManager);
END_INTERFACE
} IHostTaskManagerVtbl;
interface IHostTaskManager
{
CONST_VTBL struct IHostTaskManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostTaskManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostTaskManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostTaskManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostTaskManager_GetCurrentTask(This,pTask) \
( (This)->lpVtbl -> GetCurrentTask(This,pTask) )
#define IHostTaskManager_CreateTask(This,dwStackSize,pStartAddress,pParameter,ppTask) \
( (This)->lpVtbl -> CreateTask(This,dwStackSize,pStartAddress,pParameter,ppTask) )
#define IHostTaskManager_Sleep(This,dwMilliseconds,option) \
( (This)->lpVtbl -> Sleep(This,dwMilliseconds,option) )
#define IHostTaskManager_SwitchToTask(This,option) \
( (This)->lpVtbl -> SwitchToTask(This,option) )
#define IHostTaskManager_SetUILocale(This,lcid) \
( (This)->lpVtbl -> SetUILocale(This,lcid) )
#define IHostTaskManager_SetLocale(This,lcid) \
( (This)->lpVtbl -> SetLocale(This,lcid) )
#define IHostTaskManager_CallNeedsHostHook(This,target,pbCallNeedsHostHook) \
( (This)->lpVtbl -> CallNeedsHostHook(This,target,pbCallNeedsHostHook) )
#define IHostTaskManager_LeaveRuntime(This,target) \
( (This)->lpVtbl -> LeaveRuntime(This,target) )
#define IHostTaskManager_EnterRuntime(This) \
( (This)->lpVtbl -> EnterRuntime(This) )
#define IHostTaskManager_ReverseLeaveRuntime(This) \
( (This)->lpVtbl -> ReverseLeaveRuntime(This) )
#define IHostTaskManager_ReverseEnterRuntime(This) \
( (This)->lpVtbl -> ReverseEnterRuntime(This) )
#define IHostTaskManager_BeginDelayAbort(This) \
( (This)->lpVtbl -> BeginDelayAbort(This) )
#define IHostTaskManager_EndDelayAbort(This) \
( (This)->lpVtbl -> EndDelayAbort(This) )
#define IHostTaskManager_BeginThreadAffinity(This) \
( (This)->lpVtbl -> BeginThreadAffinity(This) )
#define IHostTaskManager_EndThreadAffinity(This) \
( (This)->lpVtbl -> EndThreadAffinity(This) )
#define IHostTaskManager_SetStackGuarantee(This,guarantee) \
( (This)->lpVtbl -> SetStackGuarantee(This,guarantee) )
#define IHostTaskManager_GetStackGuarantee(This,pGuarantee) \
( (This)->lpVtbl -> GetStackGuarantee(This,pGuarantee) )
#define IHostTaskManager_SetCLRTaskManager(This,ppManager) \
( (This)->lpVtbl -> SetCLRTaskManager(This,ppManager) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostTaskManager_INTERFACE_DEFINED__ */
#ifndef __IHostThreadpoolManager_INTERFACE_DEFINED__
#define __IHostThreadpoolManager_INTERFACE_DEFINED__
/* interface IHostThreadpoolManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostThreadpoolManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("983D50E2-CB15-466B-80FC-845DC6E8C5FD")
IHostThreadpoolManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE QueueUserWorkItem(
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [in] */ ULONG Flags) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMaxThreads(
/* [in] */ DWORD dwMaxWorkerThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMaxThreads(
/* [out] */ DWORD *pdwMaxWorkerThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAvailableThreads(
/* [out] */ DWORD *pdwAvailableWorkerThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMinThreads(
/* [in] */ DWORD dwMinIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMinThreads(
/* [out] */ DWORD *pdwMinIOCompletionThreads) = 0;
};
#else /* C style interface */
typedef struct IHostThreadpoolManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostThreadpoolManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostThreadpoolManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostThreadpoolManager * This);
HRESULT ( STDMETHODCALLTYPE *QueueUserWorkItem )(
IHostThreadpoolManager * This,
/* [in] */ LPTHREAD_START_ROUTINE Function,
/* [in] */ PVOID Context,
/* [in] */ ULONG Flags);
HRESULT ( STDMETHODCALLTYPE *SetMaxThreads )(
IHostThreadpoolManager * This,
/* [in] */ DWORD dwMaxWorkerThreads);
HRESULT ( STDMETHODCALLTYPE *GetMaxThreads )(
IHostThreadpoolManager * This,
/* [out] */ DWORD *pdwMaxWorkerThreads);
HRESULT ( STDMETHODCALLTYPE *GetAvailableThreads )(
IHostThreadpoolManager * This,
/* [out] */ DWORD *pdwAvailableWorkerThreads);
HRESULT ( STDMETHODCALLTYPE *SetMinThreads )(
IHostThreadpoolManager * This,
/* [in] */ DWORD dwMinIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *GetMinThreads )(
IHostThreadpoolManager * This,
/* [out] */ DWORD *pdwMinIOCompletionThreads);
END_INTERFACE
} IHostThreadpoolManagerVtbl;
interface IHostThreadpoolManager
{
CONST_VTBL struct IHostThreadpoolManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostThreadpoolManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostThreadpoolManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostThreadpoolManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostThreadpoolManager_QueueUserWorkItem(This,Function,Context,Flags) \
( (This)->lpVtbl -> QueueUserWorkItem(This,Function,Context,Flags) )
#define IHostThreadpoolManager_SetMaxThreads(This,dwMaxWorkerThreads) \
( (This)->lpVtbl -> SetMaxThreads(This,dwMaxWorkerThreads) )
#define IHostThreadpoolManager_GetMaxThreads(This,pdwMaxWorkerThreads) \
( (This)->lpVtbl -> GetMaxThreads(This,pdwMaxWorkerThreads) )
#define IHostThreadpoolManager_GetAvailableThreads(This,pdwAvailableWorkerThreads) \
( (This)->lpVtbl -> GetAvailableThreads(This,pdwAvailableWorkerThreads) )
#define IHostThreadpoolManager_SetMinThreads(This,dwMinIOCompletionThreads) \
( (This)->lpVtbl -> SetMinThreads(This,dwMinIOCompletionThreads) )
#define IHostThreadpoolManager_GetMinThreads(This,pdwMinIOCompletionThreads) \
( (This)->lpVtbl -> GetMinThreads(This,pdwMinIOCompletionThreads) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostThreadpoolManager_INTERFACE_DEFINED__ */
#ifndef __ICLRIoCompletionManager_INTERFACE_DEFINED__
#define __ICLRIoCompletionManager_INTERFACE_DEFINED__
/* interface ICLRIoCompletionManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRIoCompletionManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2d74ce86-b8d6-4c84-b3a7-9768933b3c12")
ICLRIoCompletionManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OnComplete(
/* [in] */ DWORD dwErrorCode,
/* [in] */ DWORD NumberOfBytesTransferred,
/* [in] */ void *pvOverlapped) = 0;
};
#else /* C style interface */
typedef struct ICLRIoCompletionManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRIoCompletionManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRIoCompletionManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRIoCompletionManager * This);
HRESULT ( STDMETHODCALLTYPE *OnComplete )(
ICLRIoCompletionManager * This,
/* [in] */ DWORD dwErrorCode,
/* [in] */ DWORD NumberOfBytesTransferred,
/* [in] */ void *pvOverlapped);
END_INTERFACE
} ICLRIoCompletionManagerVtbl;
interface ICLRIoCompletionManager
{
CONST_VTBL struct ICLRIoCompletionManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRIoCompletionManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRIoCompletionManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRIoCompletionManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRIoCompletionManager_OnComplete(This,dwErrorCode,NumberOfBytesTransferred,pvOverlapped) \
( (This)->lpVtbl -> OnComplete(This,dwErrorCode,NumberOfBytesTransferred,pvOverlapped) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRIoCompletionManager_INTERFACE_DEFINED__ */
#ifndef __IHostIoCompletionManager_INTERFACE_DEFINED__
#define __IHostIoCompletionManager_INTERFACE_DEFINED__
/* interface IHostIoCompletionManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostIoCompletionManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8bde9d80-ec06-41d6-83e6-22580effcc20")
IHostIoCompletionManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateIoCompletionPort(
/* [out] */ HANDLE *phPort) = 0;
virtual HRESULT STDMETHODCALLTYPE CloseIoCompletionPort(
/* [in] */ HANDLE hPort) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMaxThreads(
/* [in] */ DWORD dwMaxIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMaxThreads(
/* [out] */ DWORD *pdwMaxIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAvailableThreads(
/* [out] */ DWORD *pdwAvailableIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetHostOverlappedSize(
/* [out] */ DWORD *pcbSize) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCLRIoCompletionManager(
/* [in] */ ICLRIoCompletionManager *pManager) = 0;
virtual HRESULT STDMETHODCALLTYPE InitializeHostOverlapped(
/* [in] */ void *pvOverlapped) = 0;
virtual HRESULT STDMETHODCALLTYPE Bind(
/* [in] */ HANDLE hPort,
/* [in] */ HANDLE hHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMinThreads(
/* [in] */ DWORD dwMinIOCompletionThreads) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMinThreads(
/* [out] */ DWORD *pdwMinIOCompletionThreads) = 0;
};
#else /* C style interface */
typedef struct IHostIoCompletionManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostIoCompletionManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostIoCompletionManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostIoCompletionManager * This);
HRESULT ( STDMETHODCALLTYPE *CreateIoCompletionPort )(
IHostIoCompletionManager * This,
/* [out] */ HANDLE *phPort);
HRESULT ( STDMETHODCALLTYPE *CloseIoCompletionPort )(
IHostIoCompletionManager * This,
/* [in] */ HANDLE hPort);
HRESULT ( STDMETHODCALLTYPE *SetMaxThreads )(
IHostIoCompletionManager * This,
/* [in] */ DWORD dwMaxIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *GetMaxThreads )(
IHostIoCompletionManager * This,
/* [out] */ DWORD *pdwMaxIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *GetAvailableThreads )(
IHostIoCompletionManager * This,
/* [out] */ DWORD *pdwAvailableIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *GetHostOverlappedSize )(
IHostIoCompletionManager * This,
/* [out] */ DWORD *pcbSize);
HRESULT ( STDMETHODCALLTYPE *SetCLRIoCompletionManager )(
IHostIoCompletionManager * This,
/* [in] */ ICLRIoCompletionManager *pManager);
HRESULT ( STDMETHODCALLTYPE *InitializeHostOverlapped )(
IHostIoCompletionManager * This,
/* [in] */ void *pvOverlapped);
HRESULT ( STDMETHODCALLTYPE *Bind )(
IHostIoCompletionManager * This,
/* [in] */ HANDLE hPort,
/* [in] */ HANDLE hHandle);
HRESULT ( STDMETHODCALLTYPE *SetMinThreads )(
IHostIoCompletionManager * This,
/* [in] */ DWORD dwMinIOCompletionThreads);
HRESULT ( STDMETHODCALLTYPE *GetMinThreads )(
IHostIoCompletionManager * This,
/* [out] */ DWORD *pdwMinIOCompletionThreads);
END_INTERFACE
} IHostIoCompletionManagerVtbl;
interface IHostIoCompletionManager
{
CONST_VTBL struct IHostIoCompletionManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostIoCompletionManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostIoCompletionManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostIoCompletionManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostIoCompletionManager_CreateIoCompletionPort(This,phPort) \
( (This)->lpVtbl -> CreateIoCompletionPort(This,phPort) )
#define IHostIoCompletionManager_CloseIoCompletionPort(This,hPort) \
( (This)->lpVtbl -> CloseIoCompletionPort(This,hPort) )
#define IHostIoCompletionManager_SetMaxThreads(This,dwMaxIOCompletionThreads) \
( (This)->lpVtbl -> SetMaxThreads(This,dwMaxIOCompletionThreads) )
#define IHostIoCompletionManager_GetMaxThreads(This,pdwMaxIOCompletionThreads) \
( (This)->lpVtbl -> GetMaxThreads(This,pdwMaxIOCompletionThreads) )
#define IHostIoCompletionManager_GetAvailableThreads(This,pdwAvailableIOCompletionThreads) \
( (This)->lpVtbl -> GetAvailableThreads(This,pdwAvailableIOCompletionThreads) )
#define IHostIoCompletionManager_GetHostOverlappedSize(This,pcbSize) \
( (This)->lpVtbl -> GetHostOverlappedSize(This,pcbSize) )
#define IHostIoCompletionManager_SetCLRIoCompletionManager(This,pManager) \
( (This)->lpVtbl -> SetCLRIoCompletionManager(This,pManager) )
#define IHostIoCompletionManager_InitializeHostOverlapped(This,pvOverlapped) \
( (This)->lpVtbl -> InitializeHostOverlapped(This,pvOverlapped) )
#define IHostIoCompletionManager_Bind(This,hPort,hHandle) \
( (This)->lpVtbl -> Bind(This,hPort,hHandle) )
#define IHostIoCompletionManager_SetMinThreads(This,dwMinIOCompletionThreads) \
( (This)->lpVtbl -> SetMinThreads(This,dwMinIOCompletionThreads) )
#define IHostIoCompletionManager_GetMinThreads(This,pdwMinIOCompletionThreads) \
( (This)->lpVtbl -> GetMinThreads(This,pdwMinIOCompletionThreads) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostIoCompletionManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0020 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0020_0001
{ eSymbolReadingNever = 0,
eSymbolReadingAlways = 1,
eSymbolReadingFullTrustOnly = 2
} ESymbolReadingPolicy;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0020_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0020_v0_0_s_ifspec;
#ifndef __ICLRDebugManager_INTERFACE_DEFINED__
#define __ICLRDebugManager_INTERFACE_DEFINED__
/* interface ICLRDebugManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRDebugManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("00DCAEC6-2AC0-43a9-ACF9-1E36C139B10D")
ICLRDebugManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE BeginConnection(
/* [in] */ CONNID dwConnectionId,
/* [string][in] */
__in wchar_t *szConnectionName) = 0;
virtual HRESULT STDMETHODCALLTYPE SetConnectionTasks(
/* [in] */ CONNID id,
/* [in] */ DWORD dwCount,
/* [size_is][in] */ ICLRTask **ppCLRTask) = 0;
virtual HRESULT STDMETHODCALLTYPE EndConnection(
/* [in] */ CONNID dwConnectionId) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDacl(
/* [in] */ PACL pacl) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDacl(
/* [out] */ PACL *pacl) = 0;
virtual HRESULT STDMETHODCALLTYPE IsDebuggerAttached(
/* [out] */ BOOL *pbAttached) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSymbolReadingPolicy(
/* [in] */ ESymbolReadingPolicy policy) = 0;
};
#else /* C style interface */
typedef struct ICLRDebugManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRDebugManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRDebugManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRDebugManager * This);
HRESULT ( STDMETHODCALLTYPE *BeginConnection )(
ICLRDebugManager * This,
/* [in] */ CONNID dwConnectionId,
/* [string][in] */
__in wchar_t *szConnectionName);
HRESULT ( STDMETHODCALLTYPE *SetConnectionTasks )(
ICLRDebugManager * This,
/* [in] */ CONNID id,
/* [in] */ DWORD dwCount,
/* [size_is][in] */ ICLRTask **ppCLRTask);
HRESULT ( STDMETHODCALLTYPE *EndConnection )(
ICLRDebugManager * This,
/* [in] */ CONNID dwConnectionId);
HRESULT ( STDMETHODCALLTYPE *SetDacl )(
ICLRDebugManager * This,
/* [in] */ PACL pacl);
HRESULT ( STDMETHODCALLTYPE *GetDacl )(
ICLRDebugManager * This,
/* [out] */ PACL *pacl);
HRESULT ( STDMETHODCALLTYPE *IsDebuggerAttached )(
ICLRDebugManager * This,
/* [out] */ BOOL *pbAttached);
HRESULT ( STDMETHODCALLTYPE *SetSymbolReadingPolicy )(
ICLRDebugManager * This,
/* [in] */ ESymbolReadingPolicy policy);
END_INTERFACE
} ICLRDebugManagerVtbl;
interface ICLRDebugManager
{
CONST_VTBL struct ICLRDebugManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRDebugManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRDebugManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRDebugManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRDebugManager_BeginConnection(This,dwConnectionId,szConnectionName) \
( (This)->lpVtbl -> BeginConnection(This,dwConnectionId,szConnectionName) )
#define ICLRDebugManager_SetConnectionTasks(This,id,dwCount,ppCLRTask) \
( (This)->lpVtbl -> SetConnectionTasks(This,id,dwCount,ppCLRTask) )
#define ICLRDebugManager_EndConnection(This,dwConnectionId) \
( (This)->lpVtbl -> EndConnection(This,dwConnectionId) )
#define ICLRDebugManager_SetDacl(This,pacl) \
( (This)->lpVtbl -> SetDacl(This,pacl) )
#define ICLRDebugManager_GetDacl(This,pacl) \
( (This)->lpVtbl -> GetDacl(This,pacl) )
#define ICLRDebugManager_IsDebuggerAttached(This,pbAttached) \
( (This)->lpVtbl -> IsDebuggerAttached(This,pbAttached) )
#define ICLRDebugManager_SetSymbolReadingPolicy(This,policy) \
( (This)->lpVtbl -> SetSymbolReadingPolicy(This,policy) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRDebugManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0021 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0021_0001
{ DUMP_FLAVOR_Mini = 0,
DUMP_FLAVOR_CriticalCLRState = 1,
DUMP_FLAVOR_NonHeapCLRState = 2,
DUMP_FLAVOR_Default = DUMP_FLAVOR_Mini
} ECustomDumpFlavor;
typedef /* [public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0021_0002
{ DUMP_ITEM_None = 0
} ECustomDumpItemKind;
typedef /* [public][public] */ struct __MIDL___MIDL_itf_mscoree_0000_0021_0003
{
ECustomDumpItemKind itemKind;
union
{
UINT_PTR pReserved;
} ;
} CustomDumpItem;
typedef struct _BucketParameters
{
BOOL fInited;
WCHAR pszEventTypeName[ 255 ];
WCHAR pszParams[ 10 ][ 255 ];
} BucketParameters;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0021_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0021_v0_0_s_ifspec;
#ifndef __ICLRErrorReportingManager_INTERFACE_DEFINED__
#define __ICLRErrorReportingManager_INTERFACE_DEFINED__
/* interface ICLRErrorReportingManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRErrorReportingManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("980D2F1A-BF79-4c08-812A-BB9778928F78")
ICLRErrorReportingManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetBucketParametersForCurrentException(
/* [out] */ BucketParameters *pParams) = 0;
virtual HRESULT STDMETHODCALLTYPE BeginCustomDump(
/* [in] */ ECustomDumpFlavor dwFlavor,
/* [in] */ DWORD dwNumItems,
/* [length_is][size_is][in] */ CustomDumpItem *items,
DWORD dwReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE EndCustomDump( void) = 0;
};
#else /* C style interface */
typedef struct ICLRErrorReportingManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRErrorReportingManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRErrorReportingManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRErrorReportingManager * This);
HRESULT ( STDMETHODCALLTYPE *GetBucketParametersForCurrentException )(
ICLRErrorReportingManager * This,
/* [out] */ BucketParameters *pParams);
HRESULT ( STDMETHODCALLTYPE *BeginCustomDump )(
ICLRErrorReportingManager * This,
/* [in] */ ECustomDumpFlavor dwFlavor,
/* [in] */ DWORD dwNumItems,
/* [length_is][size_is][in] */ CustomDumpItem *items,
DWORD dwReserved);
HRESULT ( STDMETHODCALLTYPE *EndCustomDump )(
ICLRErrorReportingManager * This);
END_INTERFACE
} ICLRErrorReportingManagerVtbl;
interface ICLRErrorReportingManager
{
CONST_VTBL struct ICLRErrorReportingManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRErrorReportingManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRErrorReportingManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRErrorReportingManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRErrorReportingManager_GetBucketParametersForCurrentException(This,pParams) \
( (This)->lpVtbl -> GetBucketParametersForCurrentException(This,pParams) )
#define ICLRErrorReportingManager_BeginCustomDump(This,dwFlavor,dwNumItems,items,dwReserved) \
( (This)->lpVtbl -> BeginCustomDump(This,dwFlavor,dwNumItems,items,dwReserved) )
#define ICLRErrorReportingManager_EndCustomDump(This) \
( (This)->lpVtbl -> EndCustomDump(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRErrorReportingManager_INTERFACE_DEFINED__ */
#ifndef __IHostCrst_INTERFACE_DEFINED__
#define __IHostCrst_INTERFACE_DEFINED__
/* interface IHostCrst */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostCrst;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6DF710A6-26A4-4a65-8CD5-7237B8BDA8DC")
IHostCrst : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Enter(
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE Leave( void) = 0;
virtual HRESULT STDMETHODCALLTYPE TryEnter(
/* [in] */ DWORD option,
/* [out] */ BOOL *pbSucceeded) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSpinCount(
/* [in] */ DWORD dwSpinCount) = 0;
};
#else /* C style interface */
typedef struct IHostCrstVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostCrst * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostCrst * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostCrst * This);
HRESULT ( STDMETHODCALLTYPE *Enter )(
IHostCrst * This,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *Leave )(
IHostCrst * This);
HRESULT ( STDMETHODCALLTYPE *TryEnter )(
IHostCrst * This,
/* [in] */ DWORD option,
/* [out] */ BOOL *pbSucceeded);
HRESULT ( STDMETHODCALLTYPE *SetSpinCount )(
IHostCrst * This,
/* [in] */ DWORD dwSpinCount);
END_INTERFACE
} IHostCrstVtbl;
interface IHostCrst
{
CONST_VTBL struct IHostCrstVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostCrst_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostCrst_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostCrst_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostCrst_Enter(This,option) \
( (This)->lpVtbl -> Enter(This,option) )
#define IHostCrst_Leave(This) \
( (This)->lpVtbl -> Leave(This) )
#define IHostCrst_TryEnter(This,option,pbSucceeded) \
( (This)->lpVtbl -> TryEnter(This,option,pbSucceeded) )
#define IHostCrst_SetSpinCount(This,dwSpinCount) \
( (This)->lpVtbl -> SetSpinCount(This,dwSpinCount) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostCrst_INTERFACE_DEFINED__ */
#ifndef __IHostAutoEvent_INTERFACE_DEFINED__
#define __IHostAutoEvent_INTERFACE_DEFINED__
/* interface IHostAutoEvent */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostAutoEvent;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("50B0CFCE-4063-4278-9673-E5CB4ED0BDB8")
IHostAutoEvent : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Wait(
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE Set( void) = 0;
};
#else /* C style interface */
typedef struct IHostAutoEventVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostAutoEvent * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostAutoEvent * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostAutoEvent * This);
HRESULT ( STDMETHODCALLTYPE *Wait )(
IHostAutoEvent * This,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *Set )(
IHostAutoEvent * This);
END_INTERFACE
} IHostAutoEventVtbl;
interface IHostAutoEvent
{
CONST_VTBL struct IHostAutoEventVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostAutoEvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostAutoEvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostAutoEvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostAutoEvent_Wait(This,dwMilliseconds,option) \
( (This)->lpVtbl -> Wait(This,dwMilliseconds,option) )
#define IHostAutoEvent_Set(This) \
( (This)->lpVtbl -> Set(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostAutoEvent_INTERFACE_DEFINED__ */
#ifndef __IHostManualEvent_INTERFACE_DEFINED__
#define __IHostManualEvent_INTERFACE_DEFINED__
/* interface IHostManualEvent */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostManualEvent;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1BF4EC38-AFFE-4fb9-85A6-525268F15B54")
IHostManualEvent : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Wait(
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Set( void) = 0;
};
#else /* C style interface */
typedef struct IHostManualEventVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostManualEvent * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostManualEvent * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostManualEvent * This);
HRESULT ( STDMETHODCALLTYPE *Wait )(
IHostManualEvent * This,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *Reset )(
IHostManualEvent * This);
HRESULT ( STDMETHODCALLTYPE *Set )(
IHostManualEvent * This);
END_INTERFACE
} IHostManualEventVtbl;
interface IHostManualEvent
{
CONST_VTBL struct IHostManualEventVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostManualEvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostManualEvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostManualEvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostManualEvent_Wait(This,dwMilliseconds,option) \
( (This)->lpVtbl -> Wait(This,dwMilliseconds,option) )
#define IHostManualEvent_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IHostManualEvent_Set(This) \
( (This)->lpVtbl -> Set(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostManualEvent_INTERFACE_DEFINED__ */
#ifndef __IHostSemaphore_INTERFACE_DEFINED__
#define __IHostSemaphore_INTERFACE_DEFINED__
/* interface IHostSemaphore */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostSemaphore;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("855efd47-cc09-463a-a97d-16acab882661")
IHostSemaphore : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Wait(
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option) = 0;
virtual HRESULT STDMETHODCALLTYPE ReleaseSemaphore(
/* [in] */ LONG lReleaseCount,
/* [out] */ LONG *lpPreviousCount) = 0;
};
#else /* C style interface */
typedef struct IHostSemaphoreVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostSemaphore * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostSemaphore * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostSemaphore * This);
HRESULT ( STDMETHODCALLTYPE *Wait )(
IHostSemaphore * This,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ DWORD option);
HRESULT ( STDMETHODCALLTYPE *ReleaseSemaphore )(
IHostSemaphore * This,
/* [in] */ LONG lReleaseCount,
/* [out] */ LONG *lpPreviousCount);
END_INTERFACE
} IHostSemaphoreVtbl;
interface IHostSemaphore
{
CONST_VTBL struct IHostSemaphoreVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostSemaphore_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostSemaphore_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostSemaphore_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostSemaphore_Wait(This,dwMilliseconds,option) \
( (This)->lpVtbl -> Wait(This,dwMilliseconds,option) )
#define IHostSemaphore_ReleaseSemaphore(This,lReleaseCount,lpPreviousCount) \
( (This)->lpVtbl -> ReleaseSemaphore(This,lReleaseCount,lpPreviousCount) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostSemaphore_INTERFACE_DEFINED__ */
#ifndef __ICLRSyncManager_INTERFACE_DEFINED__
#define __ICLRSyncManager_INTERFACE_DEFINED__
/* interface ICLRSyncManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRSyncManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("55FF199D-AD21-48f9-A16C-F24EBBB8727D")
ICLRSyncManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetMonitorOwner(
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostTask **ppOwnerHostTask) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRWLockOwnerIterator(
/* [in] */ SIZE_T Cookie,
/* [out] */ SIZE_T *pIterator) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRWLockOwnerNext(
/* [in] */ SIZE_T Iterator,
/* [out] */ IHostTask **ppOwnerHostTask) = 0;
virtual HRESULT STDMETHODCALLTYPE DeleteRWLockOwnerIterator(
/* [in] */ SIZE_T Iterator) = 0;
};
#else /* C style interface */
typedef struct ICLRSyncManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRSyncManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRSyncManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRSyncManager * This);
HRESULT ( STDMETHODCALLTYPE *GetMonitorOwner )(
ICLRSyncManager * This,
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostTask **ppOwnerHostTask);
HRESULT ( STDMETHODCALLTYPE *CreateRWLockOwnerIterator )(
ICLRSyncManager * This,
/* [in] */ SIZE_T Cookie,
/* [out] */ SIZE_T *pIterator);
HRESULT ( STDMETHODCALLTYPE *GetRWLockOwnerNext )(
ICLRSyncManager * This,
/* [in] */ SIZE_T Iterator,
/* [out] */ IHostTask **ppOwnerHostTask);
HRESULT ( STDMETHODCALLTYPE *DeleteRWLockOwnerIterator )(
ICLRSyncManager * This,
/* [in] */ SIZE_T Iterator);
END_INTERFACE
} ICLRSyncManagerVtbl;
interface ICLRSyncManager
{
CONST_VTBL struct ICLRSyncManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRSyncManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRSyncManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRSyncManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRSyncManager_GetMonitorOwner(This,Cookie,ppOwnerHostTask) \
( (This)->lpVtbl -> GetMonitorOwner(This,Cookie,ppOwnerHostTask) )
#define ICLRSyncManager_CreateRWLockOwnerIterator(This,Cookie,pIterator) \
( (This)->lpVtbl -> CreateRWLockOwnerIterator(This,Cookie,pIterator) )
#define ICLRSyncManager_GetRWLockOwnerNext(This,Iterator,ppOwnerHostTask) \
( (This)->lpVtbl -> GetRWLockOwnerNext(This,Iterator,ppOwnerHostTask) )
#define ICLRSyncManager_DeleteRWLockOwnerIterator(This,Iterator) \
( (This)->lpVtbl -> DeleteRWLockOwnerIterator(This,Iterator) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRSyncManager_INTERFACE_DEFINED__ */
#ifndef __IHostSyncManager_INTERFACE_DEFINED__
#define __IHostSyncManager_INTERFACE_DEFINED__
/* interface IHostSyncManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostSyncManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("234330c7-5f10-4f20-9615-5122dab7a0ac")
IHostSyncManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetCLRSyncManager(
/* [in] */ ICLRSyncManager *pManager) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateCrst(
/* [out] */ IHostCrst **ppCrst) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateCrstWithSpinCount(
/* [in] */ DWORD dwSpinCount,
/* [out] */ IHostCrst **ppCrst) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateAutoEvent(
/* [out] */ IHostAutoEvent **ppEvent) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateManualEvent(
/* [in] */ BOOL bInitialState,
/* [out] */ IHostManualEvent **ppEvent) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateMonitorEvent(
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostAutoEvent **ppEvent) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRWLockWriterEvent(
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostAutoEvent **ppEvent) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRWLockReaderEvent(
/* [in] */ BOOL bInitialState,
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostManualEvent **ppEvent) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSemaphore(
/* [in] */ DWORD dwInitial,
/* [in] */ DWORD dwMax,
/* [out] */ IHostSemaphore **ppSemaphore) = 0;
};
#else /* C style interface */
typedef struct IHostSyncManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostSyncManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostSyncManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostSyncManager * This);
HRESULT ( STDMETHODCALLTYPE *SetCLRSyncManager )(
IHostSyncManager * This,
/* [in] */ ICLRSyncManager *pManager);
HRESULT ( STDMETHODCALLTYPE *CreateCrst )(
IHostSyncManager * This,
/* [out] */ IHostCrst **ppCrst);
HRESULT ( STDMETHODCALLTYPE *CreateCrstWithSpinCount )(
IHostSyncManager * This,
/* [in] */ DWORD dwSpinCount,
/* [out] */ IHostCrst **ppCrst);
HRESULT ( STDMETHODCALLTYPE *CreateAutoEvent )(
IHostSyncManager * This,
/* [out] */ IHostAutoEvent **ppEvent);
HRESULT ( STDMETHODCALLTYPE *CreateManualEvent )(
IHostSyncManager * This,
/* [in] */ BOOL bInitialState,
/* [out] */ IHostManualEvent **ppEvent);
HRESULT ( STDMETHODCALLTYPE *CreateMonitorEvent )(
IHostSyncManager * This,
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostAutoEvent **ppEvent);
HRESULT ( STDMETHODCALLTYPE *CreateRWLockWriterEvent )(
IHostSyncManager * This,
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostAutoEvent **ppEvent);
HRESULT ( STDMETHODCALLTYPE *CreateRWLockReaderEvent )(
IHostSyncManager * This,
/* [in] */ BOOL bInitialState,
/* [in] */ SIZE_T Cookie,
/* [out] */ IHostManualEvent **ppEvent);
HRESULT ( STDMETHODCALLTYPE *CreateSemaphore )(
IHostSyncManager * This,
/* [in] */ DWORD dwInitial,
/* [in] */ DWORD dwMax,
/* [out] */ IHostSemaphore **ppSemaphore);
END_INTERFACE
} IHostSyncManagerVtbl;
interface IHostSyncManager
{
CONST_VTBL struct IHostSyncManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostSyncManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostSyncManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostSyncManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostSyncManager_SetCLRSyncManager(This,pManager) \
( (This)->lpVtbl -> SetCLRSyncManager(This,pManager) )
#define IHostSyncManager_CreateCrst(This,ppCrst) \
( (This)->lpVtbl -> CreateCrst(This,ppCrst) )
#define IHostSyncManager_CreateCrstWithSpinCount(This,dwSpinCount,ppCrst) \
( (This)->lpVtbl -> CreateCrstWithSpinCount(This,dwSpinCount,ppCrst) )
#define IHostSyncManager_CreateAutoEvent(This,ppEvent) \
( (This)->lpVtbl -> CreateAutoEvent(This,ppEvent) )
#define IHostSyncManager_CreateManualEvent(This,bInitialState,ppEvent) \
( (This)->lpVtbl -> CreateManualEvent(This,bInitialState,ppEvent) )
#define IHostSyncManager_CreateMonitorEvent(This,Cookie,ppEvent) \
( (This)->lpVtbl -> CreateMonitorEvent(This,Cookie,ppEvent) )
#define IHostSyncManager_CreateRWLockWriterEvent(This,Cookie,ppEvent) \
( (This)->lpVtbl -> CreateRWLockWriterEvent(This,Cookie,ppEvent) )
#define IHostSyncManager_CreateRWLockReaderEvent(This,bInitialState,Cookie,ppEvent) \
( (This)->lpVtbl -> CreateRWLockReaderEvent(This,bInitialState,Cookie,ppEvent) )
#define IHostSyncManager_CreateSemaphore(This,dwInitial,dwMax,ppSemaphore) \
( (This)->lpVtbl -> CreateSemaphore(This,dwInitial,dwMax,ppSemaphore) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostSyncManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0028 */
/* [local] */
typedef /* [public][public][public][public][public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0028_0001
{ OPR_ThreadAbort = 0,
OPR_ThreadRudeAbortInNonCriticalRegion = ( OPR_ThreadAbort + 1 ) ,
OPR_ThreadRudeAbortInCriticalRegion = ( OPR_ThreadRudeAbortInNonCriticalRegion + 1 ) ,
OPR_AppDomainUnload = ( OPR_ThreadRudeAbortInCriticalRegion + 1 ) ,
OPR_AppDomainRudeUnload = ( OPR_AppDomainUnload + 1 ) ,
OPR_ProcessExit = ( OPR_AppDomainRudeUnload + 1 ) ,
OPR_FinalizerRun = ( OPR_ProcessExit + 1 ) ,
MaxClrOperation = ( OPR_FinalizerRun + 1 )
} EClrOperation;
typedef /* [public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0028_0002
{ FAIL_NonCriticalResource = 0,
FAIL_CriticalResource = ( FAIL_NonCriticalResource + 1 ) ,
FAIL_FatalRuntime = ( FAIL_CriticalResource + 1 ) ,
FAIL_OrphanedLock = ( FAIL_FatalRuntime + 1 ) ,
FAIL_StackOverflow = ( FAIL_OrphanedLock + 1 ) ,
FAIL_AccessViolation = ( FAIL_StackOverflow + 1 ) ,
FAIL_CodeContract = ( FAIL_AccessViolation + 1 ) ,
MaxClrFailure = ( FAIL_CodeContract + 1 )
} EClrFailure;
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0028_0003
{ eRuntimeDeterminedPolicy = 0,
eHostDeterminedPolicy = ( eRuntimeDeterminedPolicy + 1 )
} EClrUnhandledException;
typedef /* [public][public][public][public][public][public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0028_0004
{ eNoAction = 0,
eThrowException = ( eNoAction + 1 ) ,
eAbortThread = ( eThrowException + 1 ) ,
eRudeAbortThread = ( eAbortThread + 1 ) ,
eUnloadAppDomain = ( eRudeAbortThread + 1 ) ,
eRudeUnloadAppDomain = ( eUnloadAppDomain + 1 ) ,
eExitProcess = ( eRudeUnloadAppDomain + 1 ) ,
eFastExitProcess = ( eExitProcess + 1 ) ,
eRudeExitProcess = ( eFastExitProcess + 1 ) ,
eDisableRuntime = ( eRudeExitProcess + 1 ) ,
MaxPolicyAction = ( eDisableRuntime + 1 )
} EPolicyAction;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0028_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0028_v0_0_s_ifspec;
#ifndef __ICLRPolicyManager_INTERFACE_DEFINED__
#define __ICLRPolicyManager_INTERFACE_DEFINED__
/* interface ICLRPolicyManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRPolicyManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7D290010-D781-45da-A6F8-AA5D711A730E")
ICLRPolicyManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetDefaultAction(
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTimeout(
/* [in] */ EClrOperation operation,
/* [in] */ DWORD dwMilliseconds) = 0;
virtual HRESULT STDMETHODCALLTYPE SetActionOnTimeout(
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTimeoutAndAction(
/* [in] */ EClrOperation operation,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE SetActionOnFailure(
/* [in] */ EClrFailure failure,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE SetUnhandledExceptionPolicy(
/* [in] */ EClrUnhandledException policy) = 0;
};
#else /* C style interface */
typedef struct ICLRPolicyManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRPolicyManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRPolicyManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRPolicyManager * This);
HRESULT ( STDMETHODCALLTYPE *SetDefaultAction )(
ICLRPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *SetTimeout )(
ICLRPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ DWORD dwMilliseconds);
HRESULT ( STDMETHODCALLTYPE *SetActionOnTimeout )(
ICLRPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *SetTimeoutAndAction )(
ICLRPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ DWORD dwMilliseconds,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *SetActionOnFailure )(
ICLRPolicyManager * This,
/* [in] */ EClrFailure failure,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *SetUnhandledExceptionPolicy )(
ICLRPolicyManager * This,
/* [in] */ EClrUnhandledException policy);
END_INTERFACE
} ICLRPolicyManagerVtbl;
interface ICLRPolicyManager
{
CONST_VTBL struct ICLRPolicyManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRPolicyManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRPolicyManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRPolicyManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRPolicyManager_SetDefaultAction(This,operation,action) \
( (This)->lpVtbl -> SetDefaultAction(This,operation,action) )
#define ICLRPolicyManager_SetTimeout(This,operation,dwMilliseconds) \
( (This)->lpVtbl -> SetTimeout(This,operation,dwMilliseconds) )
#define ICLRPolicyManager_SetActionOnTimeout(This,operation,action) \
( (This)->lpVtbl -> SetActionOnTimeout(This,operation,action) )
#define ICLRPolicyManager_SetTimeoutAndAction(This,operation,dwMilliseconds,action) \
( (This)->lpVtbl -> SetTimeoutAndAction(This,operation,dwMilliseconds,action) )
#define ICLRPolicyManager_SetActionOnFailure(This,failure,action) \
( (This)->lpVtbl -> SetActionOnFailure(This,failure,action) )
#define ICLRPolicyManager_SetUnhandledExceptionPolicy(This,policy) \
( (This)->lpVtbl -> SetUnhandledExceptionPolicy(This,policy) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRPolicyManager_INTERFACE_DEFINED__ */
#ifndef __IHostPolicyManager_INTERFACE_DEFINED__
#define __IHostPolicyManager_INTERFACE_DEFINED__
/* interface IHostPolicyManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostPolicyManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7AE49844-B1E3-4683-BA7C-1E8212EA3B79")
IHostPolicyManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OnDefaultAction(
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE OnTimeout(
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action) = 0;
virtual HRESULT STDMETHODCALLTYPE OnFailure(
/* [in] */ EClrFailure failure,
/* [in] */ EPolicyAction action) = 0;
};
#else /* C style interface */
typedef struct IHostPolicyManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostPolicyManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostPolicyManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostPolicyManager * This);
HRESULT ( STDMETHODCALLTYPE *OnDefaultAction )(
IHostPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *OnTimeout )(
IHostPolicyManager * This,
/* [in] */ EClrOperation operation,
/* [in] */ EPolicyAction action);
HRESULT ( STDMETHODCALLTYPE *OnFailure )(
IHostPolicyManager * This,
/* [in] */ EClrFailure failure,
/* [in] */ EPolicyAction action);
END_INTERFACE
} IHostPolicyManagerVtbl;
interface IHostPolicyManager
{
CONST_VTBL struct IHostPolicyManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostPolicyManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostPolicyManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostPolicyManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostPolicyManager_OnDefaultAction(This,operation,action) \
( (This)->lpVtbl -> OnDefaultAction(This,operation,action) )
#define IHostPolicyManager_OnTimeout(This,operation,action) \
( (This)->lpVtbl -> OnTimeout(This,operation,action) )
#define IHostPolicyManager_OnFailure(This,failure,action) \
( (This)->lpVtbl -> OnFailure(This,failure,action) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostPolicyManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0030 */
/* [local] */
typedef /* [public][public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0030_0001
{ Event_DomainUnload = 0,
Event_ClrDisabled = ( Event_DomainUnload + 1 ) ,
Event_MDAFired = ( Event_ClrDisabled + 1 ) ,
Event_StackOverflow = ( Event_MDAFired + 1 ) ,
MaxClrEvent = ( Event_StackOverflow + 1 )
} EClrEvent;
typedef struct _MDAInfo
{
LPCWSTR lpMDACaption;
LPCWSTR lpMDAMessage;
LPCWSTR lpStackTrace;
} MDAInfo;
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0030_0002
{ SO_Managed = 0,
SO_ClrEngine = ( SO_Managed + 1 ) ,
SO_Other = ( SO_ClrEngine + 1 )
} StackOverflowType;
typedef struct _StackOverflowInfo
{
StackOverflowType soType;
EXCEPTION_POINTERS *pExceptionInfo;
} StackOverflowInfo;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0030_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0030_v0_0_s_ifspec;
#ifndef __IActionOnCLREvent_INTERFACE_DEFINED__
#define __IActionOnCLREvent_INTERFACE_DEFINED__
/* interface IActionOnCLREvent */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IActionOnCLREvent;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("607BE24B-D91B-4E28-A242-61871CE56E35")
IActionOnCLREvent : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OnEvent(
/* [in] */ EClrEvent event,
/* [in] */ PVOID data) = 0;
};
#else /* C style interface */
typedef struct IActionOnCLREventVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IActionOnCLREvent * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IActionOnCLREvent * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IActionOnCLREvent * This);
HRESULT ( STDMETHODCALLTYPE *OnEvent )(
IActionOnCLREvent * This,
/* [in] */ EClrEvent event,
/* [in] */ PVOID data);
END_INTERFACE
} IActionOnCLREventVtbl;
interface IActionOnCLREvent
{
CONST_VTBL struct IActionOnCLREventVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IActionOnCLREvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IActionOnCLREvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IActionOnCLREvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IActionOnCLREvent_OnEvent(This,event,data) \
( (This)->lpVtbl -> OnEvent(This,event,data) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IActionOnCLREvent_INTERFACE_DEFINED__ */
#ifndef __ICLROnEventManager_INTERFACE_DEFINED__
#define __ICLROnEventManager_INTERFACE_DEFINED__
/* interface ICLROnEventManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLROnEventManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1D0E0132-E64F-493D-9260-025C0E32C175")
ICLROnEventManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE RegisterActionOnEvent(
/* [in] */ EClrEvent event,
/* [in] */ IActionOnCLREvent *pAction) = 0;
virtual HRESULT STDMETHODCALLTYPE UnregisterActionOnEvent(
/* [in] */ EClrEvent event,
/* [in] */ IActionOnCLREvent *pAction) = 0;
};
#else /* C style interface */
typedef struct ICLROnEventManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLROnEventManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLROnEventManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLROnEventManager * This);
HRESULT ( STDMETHODCALLTYPE *RegisterActionOnEvent )(
ICLROnEventManager * This,
/* [in] */ EClrEvent event,
/* [in] */ IActionOnCLREvent *pAction);
HRESULT ( STDMETHODCALLTYPE *UnregisterActionOnEvent )(
ICLROnEventManager * This,
/* [in] */ EClrEvent event,
/* [in] */ IActionOnCLREvent *pAction);
END_INTERFACE
} ICLROnEventManagerVtbl;
interface ICLROnEventManager
{
CONST_VTBL struct ICLROnEventManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLROnEventManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLROnEventManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLROnEventManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLROnEventManager_RegisterActionOnEvent(This,event,pAction) \
( (This)->lpVtbl -> RegisterActionOnEvent(This,event,pAction) )
#define ICLROnEventManager_UnregisterActionOnEvent(This,event,pAction) \
( (This)->lpVtbl -> UnregisterActionOnEvent(This,event,pAction) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLROnEventManager_INTERFACE_DEFINED__ */
#ifndef __IHostGCManager_INTERFACE_DEFINED__
#define __IHostGCManager_INTERFACE_DEFINED__
/* interface IHostGCManager */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostGCManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5D4EC34E-F248-457B-B603-255FAABA0D21")
IHostGCManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ThreadIsBlockingForSuspension( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SuspensionStarting( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SuspensionEnding(
DWORD Generation) = 0;
};
#else /* C style interface */
typedef struct IHostGCManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostGCManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostGCManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostGCManager * This);
HRESULT ( STDMETHODCALLTYPE *ThreadIsBlockingForSuspension )(
IHostGCManager * This);
HRESULT ( STDMETHODCALLTYPE *SuspensionStarting )(
IHostGCManager * This);
HRESULT ( STDMETHODCALLTYPE *SuspensionEnding )(
IHostGCManager * This,
DWORD Generation);
END_INTERFACE
} IHostGCManagerVtbl;
interface IHostGCManager
{
CONST_VTBL struct IHostGCManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostGCManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostGCManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostGCManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostGCManager_ThreadIsBlockingForSuspension(This) \
( (This)->lpVtbl -> ThreadIsBlockingForSuspension(This) )
#define IHostGCManager_SuspensionStarting(This) \
( (This)->lpVtbl -> SuspensionStarting(This) )
#define IHostGCManager_SuspensionEnding(This,Generation) \
( (This)->lpVtbl -> SuspensionEnding(This,Generation) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostGCManager_INTERFACE_DEFINED__ */
#ifndef __ICLRGCManager_INTERFACE_DEFINED__
#define __ICLRGCManager_INTERFACE_DEFINED__
/* interface ICLRGCManager */
/* [object][local][unique][version][uuid] */
EXTERN_C const IID IID_ICLRGCManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("54D9007E-A8E2-4885-B7BF-F998DEEE4F2A")
ICLRGCManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Collect(
/* [in] */ LONG Generation) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStats(
/* [out][in] */ COR_GC_STATS *pStats) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGCStartupLimits(
/* [in] */ DWORD SegmentSize,
/* [in] */ DWORD MaxGen0Size) = 0;
};
#else /* C style interface */
typedef struct ICLRGCManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRGCManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRGCManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRGCManager * This);
HRESULT ( STDMETHODCALLTYPE *Collect )(
ICLRGCManager * This,
/* [in] */ LONG Generation);
HRESULT ( STDMETHODCALLTYPE *GetStats )(
ICLRGCManager * This,
/* [out][in] */ COR_GC_STATS *pStats);
HRESULT ( STDMETHODCALLTYPE *SetGCStartupLimits )(
ICLRGCManager * This,
/* [in] */ DWORD SegmentSize,
/* [in] */ DWORD MaxGen0Size);
END_INTERFACE
} ICLRGCManagerVtbl;
interface ICLRGCManager
{
CONST_VTBL struct ICLRGCManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRGCManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRGCManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRGCManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRGCManager_Collect(This,Generation) \
( (This)->lpVtbl -> Collect(This,Generation) )
#define ICLRGCManager_GetStats(This,pStats) \
( (This)->lpVtbl -> GetStats(This,pStats) )
#define ICLRGCManager_SetGCStartupLimits(This,SegmentSize,MaxGen0Size) \
( (This)->lpVtbl -> SetGCStartupLimits(This,SegmentSize,MaxGen0Size) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRGCManager_INTERFACE_DEFINED__ */
#ifndef __ICLRAssemblyReferenceList_INTERFACE_DEFINED__
#define __ICLRAssemblyReferenceList_INTERFACE_DEFINED__
/* interface ICLRAssemblyReferenceList */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_ICLRAssemblyReferenceList;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1b2c9750-2e66-4bda-8b44-0a642c5cd733")
ICLRAssemblyReferenceList : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE IsStringAssemblyReferenceInList(
/* [in] */ LPCWSTR pwzAssemblyName) = 0;
virtual HRESULT STDMETHODCALLTYPE IsAssemblyReferenceInList(
/* [in] */ IUnknown *pName) = 0;
};
#else /* C style interface */
typedef struct ICLRAssemblyReferenceListVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRAssemblyReferenceList * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRAssemblyReferenceList * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRAssemblyReferenceList * This);
HRESULT ( STDMETHODCALLTYPE *IsStringAssemblyReferenceInList )(
ICLRAssemblyReferenceList * This,
/* [in] */ LPCWSTR pwzAssemblyName);
HRESULT ( STDMETHODCALLTYPE *IsAssemblyReferenceInList )(
ICLRAssemblyReferenceList * This,
/* [in] */ IUnknown *pName);
END_INTERFACE
} ICLRAssemblyReferenceListVtbl;
interface ICLRAssemblyReferenceList
{
CONST_VTBL struct ICLRAssemblyReferenceListVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRAssemblyReferenceList_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRAssemblyReferenceList_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRAssemblyReferenceList_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRAssemblyReferenceList_IsStringAssemblyReferenceInList(This,pwzAssemblyName) \
( (This)->lpVtbl -> IsStringAssemblyReferenceInList(This,pwzAssemblyName) )
#define ICLRAssemblyReferenceList_IsAssemblyReferenceInList(This,pName) \
( (This)->lpVtbl -> IsAssemblyReferenceInList(This,pName) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRAssemblyReferenceList_INTERFACE_DEFINED__ */
#ifndef __ICLRReferenceAssemblyEnum_INTERFACE_DEFINED__
#define __ICLRReferenceAssemblyEnum_INTERFACE_DEFINED__
/* interface ICLRReferenceAssemblyEnum */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_ICLRReferenceAssemblyEnum;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("d509cb5d-cf32-4876-ae61-67770cf91973")
ICLRReferenceAssemblyEnum : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Get(
/* [in] */ DWORD dwIndex,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize) = 0;
};
#else /* C style interface */
typedef struct ICLRReferenceAssemblyEnumVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRReferenceAssemblyEnum * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRReferenceAssemblyEnum * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRReferenceAssemblyEnum * This);
HRESULT ( STDMETHODCALLTYPE *Get )(
ICLRReferenceAssemblyEnum * This,
/* [in] */ DWORD dwIndex,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize);
END_INTERFACE
} ICLRReferenceAssemblyEnumVtbl;
interface ICLRReferenceAssemblyEnum
{
CONST_VTBL struct ICLRReferenceAssemblyEnumVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRReferenceAssemblyEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRReferenceAssemblyEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRReferenceAssemblyEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRReferenceAssemblyEnum_Get(This,dwIndex,pwzBuffer,pcchBufferSize) \
( (This)->lpVtbl -> Get(This,dwIndex,pwzBuffer,pcchBufferSize) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRReferenceAssemblyEnum_INTERFACE_DEFINED__ */
#ifndef __ICLRProbingAssemblyEnum_INTERFACE_DEFINED__
#define __ICLRProbingAssemblyEnum_INTERFACE_DEFINED__
/* interface ICLRProbingAssemblyEnum */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_ICLRProbingAssemblyEnum;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("d0c5fb1f-416b-4f97-81f4-7ac7dc24dd5d")
ICLRProbingAssemblyEnum : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Get(
/* [in] */ DWORD dwIndex,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize) = 0;
};
#else /* C style interface */
typedef struct ICLRProbingAssemblyEnumVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRProbingAssemblyEnum * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRProbingAssemblyEnum * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRProbingAssemblyEnum * This);
HRESULT ( STDMETHODCALLTYPE *Get )(
ICLRProbingAssemblyEnum * This,
/* [in] */ DWORD dwIndex,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize);
END_INTERFACE
} ICLRProbingAssemblyEnumVtbl;
interface ICLRProbingAssemblyEnum
{
CONST_VTBL struct ICLRProbingAssemblyEnumVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRProbingAssemblyEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRProbingAssemblyEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRProbingAssemblyEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRProbingAssemblyEnum_Get(This,dwIndex,pwzBuffer,pcchBufferSize) \
( (This)->lpVtbl -> Get(This,dwIndex,pwzBuffer,pcchBufferSize) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRProbingAssemblyEnum_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0037 */
/* [local] */
typedef
enum _CLRAssemblyIdentityFlags
{ CLR_ASSEMBLY_IDENTITY_FLAGS_DEFAULT = 0
} ECLRAssemblyIdentityFlags;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0037_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0037_v0_0_s_ifspec;
#ifndef __ICLRAssemblyIdentityManager_INTERFACE_DEFINED__
#define __ICLRAssemblyIdentityManager_INTERFACE_DEFINED__
/* interface ICLRAssemblyIdentityManager */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_ICLRAssemblyIdentityManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("15f0a9da-3ff6-4393-9da9-fdfd284e6972")
ICLRAssemblyIdentityManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCLRAssemblyReferenceList(
/* [in] */ LPCWSTR *ppwzAssemblyReferences,
/* [in] */ DWORD dwNumOfReferences,
/* [out] */ ICLRAssemblyReferenceList **ppReferenceList) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBindingIdentityFromFile(
/* [in] */ LPCWSTR pwzFilePath,
/* [in] */ DWORD dwFlags,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBindingIdentityFromStream(
/* [in] */ IStream *pStream,
/* [in] */ DWORD dwFlags,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize) = 0;
virtual HRESULT STDMETHODCALLTYPE GetReferencedAssembliesFromFile(
/* [in] */ LPCWSTR pwzFilePath,
/* [in] */ DWORD dwFlags,
/* [in] */ ICLRAssemblyReferenceList *pExcludeAssembliesList,
/* [out] */ ICLRReferenceAssemblyEnum **ppReferenceEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE GetReferencedAssembliesFromStream(
/* [in] */ IStream *pStream,
/* [in] */ DWORD dwFlags,
/* [in] */ ICLRAssemblyReferenceList *pExcludeAssembliesList,
/* [out] */ ICLRReferenceAssemblyEnum **ppReferenceEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE GetProbingAssembliesFromReference(
/* [in] */ DWORD dwMachineType,
/* [in] */ DWORD dwFlags,
/* [in] */ LPCWSTR pwzReferenceIdentity,
/* [out] */ ICLRProbingAssemblyEnum **ppProbingAssemblyEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE IsStronglyNamed(
/* [in] */ LPCWSTR pwzAssemblyIdentity,
/* [out] */ BOOL *pbIsStronglyNamed) = 0;
};
#else /* C style interface */
typedef struct ICLRAssemblyIdentityManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRAssemblyIdentityManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRAssemblyIdentityManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRAssemblyIdentityManager * This);
HRESULT ( STDMETHODCALLTYPE *GetCLRAssemblyReferenceList )(
ICLRAssemblyIdentityManager * This,
/* [in] */ LPCWSTR *ppwzAssemblyReferences,
/* [in] */ DWORD dwNumOfReferences,
/* [out] */ ICLRAssemblyReferenceList **ppReferenceList);
HRESULT ( STDMETHODCALLTYPE *GetBindingIdentityFromFile )(
ICLRAssemblyIdentityManager * This,
/* [in] */ LPCWSTR pwzFilePath,
/* [in] */ DWORD dwFlags,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize);
HRESULT ( STDMETHODCALLTYPE *GetBindingIdentityFromStream )(
ICLRAssemblyIdentityManager * This,
/* [in] */ IStream *pStream,
/* [in] */ DWORD dwFlags,
/* [size_is][out] */
__out_ecount_full(*pcchBufferSize) LPWSTR pwzBuffer,
/* [out][in] */ DWORD *pcchBufferSize);
HRESULT ( STDMETHODCALLTYPE *GetReferencedAssembliesFromFile )(
ICLRAssemblyIdentityManager * This,
/* [in] */ LPCWSTR pwzFilePath,
/* [in] */ DWORD dwFlags,
/* [in] */ ICLRAssemblyReferenceList *pExcludeAssembliesList,
/* [out] */ ICLRReferenceAssemblyEnum **ppReferenceEnum);
HRESULT ( STDMETHODCALLTYPE *GetReferencedAssembliesFromStream )(
ICLRAssemblyIdentityManager * This,
/* [in] */ IStream *pStream,
/* [in] */ DWORD dwFlags,
/* [in] */ ICLRAssemblyReferenceList *pExcludeAssembliesList,
/* [out] */ ICLRReferenceAssemblyEnum **ppReferenceEnum);
HRESULT ( STDMETHODCALLTYPE *GetProbingAssembliesFromReference )(
ICLRAssemblyIdentityManager * This,
/* [in] */ DWORD dwMachineType,
/* [in] */ DWORD dwFlags,
/* [in] */ LPCWSTR pwzReferenceIdentity,
/* [out] */ ICLRProbingAssemblyEnum **ppProbingAssemblyEnum);
HRESULT ( STDMETHODCALLTYPE *IsStronglyNamed )(
ICLRAssemblyIdentityManager * This,
/* [in] */ LPCWSTR pwzAssemblyIdentity,
/* [out] */ BOOL *pbIsStronglyNamed);
END_INTERFACE
} ICLRAssemblyIdentityManagerVtbl;
interface ICLRAssemblyIdentityManager
{
CONST_VTBL struct ICLRAssemblyIdentityManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRAssemblyIdentityManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRAssemblyIdentityManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRAssemblyIdentityManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRAssemblyIdentityManager_GetCLRAssemblyReferenceList(This,ppwzAssemblyReferences,dwNumOfReferences,ppReferenceList) \
( (This)->lpVtbl -> GetCLRAssemblyReferenceList(This,ppwzAssemblyReferences,dwNumOfReferences,ppReferenceList) )
#define ICLRAssemblyIdentityManager_GetBindingIdentityFromFile(This,pwzFilePath,dwFlags,pwzBuffer,pcchBufferSize) \
( (This)->lpVtbl -> GetBindingIdentityFromFile(This,pwzFilePath,dwFlags,pwzBuffer,pcchBufferSize) )
#define ICLRAssemblyIdentityManager_GetBindingIdentityFromStream(This,pStream,dwFlags,pwzBuffer,pcchBufferSize) \
( (This)->lpVtbl -> GetBindingIdentityFromStream(This,pStream,dwFlags,pwzBuffer,pcchBufferSize) )
#define ICLRAssemblyIdentityManager_GetReferencedAssembliesFromFile(This,pwzFilePath,dwFlags,pExcludeAssembliesList,ppReferenceEnum) \
( (This)->lpVtbl -> GetReferencedAssembliesFromFile(This,pwzFilePath,dwFlags,pExcludeAssembliesList,ppReferenceEnum) )
#define ICLRAssemblyIdentityManager_GetReferencedAssembliesFromStream(This,pStream,dwFlags,pExcludeAssembliesList,ppReferenceEnum) \
( (This)->lpVtbl -> GetReferencedAssembliesFromStream(This,pStream,dwFlags,pExcludeAssembliesList,ppReferenceEnum) )
#define ICLRAssemblyIdentityManager_GetProbingAssembliesFromReference(This,dwMachineType,dwFlags,pwzReferenceIdentity,ppProbingAssemblyEnum) \
( (This)->lpVtbl -> GetProbingAssembliesFromReference(This,dwMachineType,dwFlags,pwzReferenceIdentity,ppProbingAssemblyEnum) )
#define ICLRAssemblyIdentityManager_IsStronglyNamed(This,pwzAssemblyIdentity,pbIsStronglyNamed) \
( (This)->lpVtbl -> IsStronglyNamed(This,pwzAssemblyIdentity,pbIsStronglyNamed) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRAssemblyIdentityManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0038 */
/* [local] */
typedef
enum _hostBiningPolicyModifyFlags
{ HOST_BINDING_POLICY_MODIFY_DEFAULT = 0,
HOST_BINDING_POLICY_MODIFY_CHAIN = 1,
HOST_BINDING_POLICY_MODIFY_REMOVE = 2,
HOST_BINDING_POLICY_MODIFY_MAX = 3
} EHostBindingPolicyModifyFlags;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0038_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0038_v0_0_s_ifspec;
#ifndef __ICLRHostBindingPolicyManager_INTERFACE_DEFINED__
#define __ICLRHostBindingPolicyManager_INTERFACE_DEFINED__
/* interface ICLRHostBindingPolicyManager */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_ICLRHostBindingPolicyManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4b3545e7-1856-48c9-a8ba-24b21a753c09")
ICLRHostBindingPolicyManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ModifyApplicationPolicy(
/* [in] */ LPCWSTR pwzSourceAssemblyIdentity,
/* [in] */ LPCWSTR pwzTargetAssemblyIdentity,
/* [in] */ BYTE *pbApplicationPolicy,
/* [in] */ DWORD cbAppPolicySize,
/* [in] */ DWORD dwPolicyModifyFlags,
/* [size_is][out] */
__out_ecount_full(*pcbNewAppPolicySize) BYTE *pbNewApplicationPolicy,
/* [out][in] */ DWORD *pcbNewAppPolicySize) = 0;
virtual HRESULT STDMETHODCALLTYPE EvaluatePolicy(
/* [in] */ LPCWSTR pwzReferenceIdentity,
/* [in] */ BYTE *pbApplicationPolicy,
/* [in] */ DWORD cbAppPolicySize,
/* [size_is][out] */
__out_ecount_full(*pcchPostPolicyReferenceIdentity) LPWSTR pwzPostPolicyReferenceIdentity,
/* [out][in] */ DWORD *pcchPostPolicyReferenceIdentity,
/* [out] */ DWORD *pdwPoliciesApplied) = 0;
};
#else /* C style interface */
typedef struct ICLRHostBindingPolicyManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRHostBindingPolicyManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRHostBindingPolicyManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRHostBindingPolicyManager * This);
HRESULT ( STDMETHODCALLTYPE *ModifyApplicationPolicy )(
ICLRHostBindingPolicyManager * This,
/* [in] */ LPCWSTR pwzSourceAssemblyIdentity,
/* [in] */ LPCWSTR pwzTargetAssemblyIdentity,
/* [in] */ BYTE *pbApplicationPolicy,
/* [in] */ DWORD cbAppPolicySize,
/* [in] */ DWORD dwPolicyModifyFlags,
/* [size_is][out] */
__out_ecount_full(*pcbNewAppPolicySize) BYTE *pbNewApplicationPolicy,
/* [out][in] */ DWORD *pcbNewAppPolicySize);
HRESULT ( STDMETHODCALLTYPE *EvaluatePolicy )(
ICLRHostBindingPolicyManager * This,
/* [in] */ LPCWSTR pwzReferenceIdentity,
/* [in] */ BYTE *pbApplicationPolicy,
/* [in] */ DWORD cbAppPolicySize,
/* [size_is][out] */
__out_ecount_full(*pcchPostPolicyReferenceIdentity) LPWSTR pwzPostPolicyReferenceIdentity,
/* [out][in] */ DWORD *pcchPostPolicyReferenceIdentity,
/* [out] */ DWORD *pdwPoliciesApplied);
END_INTERFACE
} ICLRHostBindingPolicyManagerVtbl;
interface ICLRHostBindingPolicyManager
{
CONST_VTBL struct ICLRHostBindingPolicyManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRHostBindingPolicyManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRHostBindingPolicyManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRHostBindingPolicyManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRHostBindingPolicyManager_ModifyApplicationPolicy(This,pwzSourceAssemblyIdentity,pwzTargetAssemblyIdentity,pbApplicationPolicy,cbAppPolicySize,dwPolicyModifyFlags,pbNewApplicationPolicy,pcbNewAppPolicySize) \
( (This)->lpVtbl -> ModifyApplicationPolicy(This,pwzSourceAssemblyIdentity,pwzTargetAssemblyIdentity,pbApplicationPolicy,cbAppPolicySize,dwPolicyModifyFlags,pbNewApplicationPolicy,pcbNewAppPolicySize) )
#define ICLRHostBindingPolicyManager_EvaluatePolicy(This,pwzReferenceIdentity,pbApplicationPolicy,cbAppPolicySize,pwzPostPolicyReferenceIdentity,pcchPostPolicyReferenceIdentity,pdwPoliciesApplied) \
( (This)->lpVtbl -> EvaluatePolicy(This,pwzReferenceIdentity,pbApplicationPolicy,cbAppPolicySize,pwzPostPolicyReferenceIdentity,pcchPostPolicyReferenceIdentity,pdwPoliciesApplied) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRHostBindingPolicyManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0039 */
/* [local] */
typedef /* [public] */
enum __MIDL___MIDL_itf_mscoree_0000_0039_0001
{ ePolicyLevelNone = 0,
ePolicyLevelRetargetable = 0x1,
ePolicyUnifiedToCLR = 0x2,
ePolicyLevelApp = 0x4,
ePolicyLevelPublisher = 0x8,
ePolicyLevelHost = 0x10,
ePolicyLevelAdmin = 0x20,
ePolicyPortability = 0x40
} EBindPolicyLevels;
typedef struct _AssemblyBindInfo
{
DWORD dwAppDomainId;
LPCWSTR lpReferencedIdentity;
LPCWSTR lpPostPolicyIdentity;
DWORD ePolicyLevel;
} AssemblyBindInfo;
typedef struct _ModuleBindInfo
{
DWORD dwAppDomainId;
LPCWSTR lpAssemblyIdentity;
LPCWSTR lpModuleName;
} ModuleBindInfo;
typedef
enum _HostApplicationPolicy
{ HOST_APPLICATION_BINDING_POLICY = 1
} EHostApplicationPolicy;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0039_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0039_v0_0_s_ifspec;
#ifndef __IHostAssemblyStore_INTERFACE_DEFINED__
#define __IHostAssemblyStore_INTERFACE_DEFINED__
/* interface IHostAssemblyStore */
/* [unique][helpstring][uuid][version][object][local] */
EXTERN_C const IID IID_IHostAssemblyStore;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7b102a88-3f7f-496d-8fa2-c35374e01af3")
IHostAssemblyStore : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ProvideAssembly(
/* [in] */ AssemblyBindInfo *pBindInfo,
/* [out] */ UINT64 *pAssemblyId,
/* [out] */ UINT64 *pContext,
/* [out] */ IStream **ppStmAssemblyImage,
/* [out] */ IStream **ppStmPDB) = 0;
virtual HRESULT STDMETHODCALLTYPE ProvideModule(
/* [in] */ ModuleBindInfo *pBindInfo,
/* [out] */ DWORD *pdwModuleId,
/* [out] */ IStream **ppStmModuleImage,
/* [out] */ IStream **ppStmPDB) = 0;
};
#else /* C style interface */
typedef struct IHostAssemblyStoreVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostAssemblyStore * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostAssemblyStore * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostAssemblyStore * This);
HRESULT ( STDMETHODCALLTYPE *ProvideAssembly )(
IHostAssemblyStore * This,
/* [in] */ AssemblyBindInfo *pBindInfo,
/* [out] */ UINT64 *pAssemblyId,
/* [out] */ UINT64 *pContext,
/* [out] */ IStream **ppStmAssemblyImage,
/* [out] */ IStream **ppStmPDB);
HRESULT ( STDMETHODCALLTYPE *ProvideModule )(
IHostAssemblyStore * This,
/* [in] */ ModuleBindInfo *pBindInfo,
/* [out] */ DWORD *pdwModuleId,
/* [out] */ IStream **ppStmModuleImage,
/* [out] */ IStream **ppStmPDB);
END_INTERFACE
} IHostAssemblyStoreVtbl;
interface IHostAssemblyStore
{
CONST_VTBL struct IHostAssemblyStoreVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostAssemblyStore_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostAssemblyStore_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostAssemblyStore_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostAssemblyStore_ProvideAssembly(This,pBindInfo,pAssemblyId,pContext,ppStmAssemblyImage,ppStmPDB) \
( (This)->lpVtbl -> ProvideAssembly(This,pBindInfo,pAssemblyId,pContext,ppStmAssemblyImage,ppStmPDB) )
#define IHostAssemblyStore_ProvideModule(This,pBindInfo,pdwModuleId,ppStmModuleImage,ppStmPDB) \
( (This)->lpVtbl -> ProvideModule(This,pBindInfo,pdwModuleId,ppStmModuleImage,ppStmPDB) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostAssemblyStore_INTERFACE_DEFINED__ */
#ifndef __IHostAssemblyManager_INTERFACE_DEFINED__
#define __IHostAssemblyManager_INTERFACE_DEFINED__
/* interface IHostAssemblyManager */
/* [unique][helpstring][uuid][version][object][local] */
EXTERN_C const IID IID_IHostAssemblyManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("613dabd7-62b2-493e-9e65-c1e32a1e0c5e")
IHostAssemblyManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetNonHostStoreAssemblies(
/* [out] */ ICLRAssemblyReferenceList **ppReferenceList) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAssemblyStore(
/* [out] */ IHostAssemblyStore **ppAssemblyStore) = 0;
};
#else /* C style interface */
typedef struct IHostAssemblyManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostAssemblyManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostAssemblyManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostAssemblyManager * This);
HRESULT ( STDMETHODCALLTYPE *GetNonHostStoreAssemblies )(
IHostAssemblyManager * This,
/* [out] */ ICLRAssemblyReferenceList **ppReferenceList);
HRESULT ( STDMETHODCALLTYPE *GetAssemblyStore )(
IHostAssemblyManager * This,
/* [out] */ IHostAssemblyStore **ppAssemblyStore);
END_INTERFACE
} IHostAssemblyManagerVtbl;
interface IHostAssemblyManager
{
CONST_VTBL struct IHostAssemblyManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostAssemblyManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostAssemblyManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostAssemblyManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostAssemblyManager_GetNonHostStoreAssemblies(This,ppReferenceList) \
( (This)->lpVtbl -> GetNonHostStoreAssemblies(This,ppReferenceList) )
#define IHostAssemblyManager_GetAssemblyStore(This,ppAssemblyStore) \
( (This)->lpVtbl -> GetAssemblyStore(This,ppAssemblyStore) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostAssemblyManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0041 */
/* [local] */
STDAPI GetCLRIdentityManager(REFIID riid, IUnknown **ppManager);
EXTERN_GUID(IID_IHostControl, 0x02CA073C, 0x7079, 0x4860, 0x88, 0x0A, 0xC2, 0xF7, 0xA4, 0x49, 0xC9, 0x91);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0041_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0041_v0_0_s_ifspec;
#ifndef __IHostControl_INTERFACE_DEFINED__
#define __IHostControl_INTERFACE_DEFINED__
/* interface IHostControl */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_IHostControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("02CA073C-7079-4860-880A-C2F7A449C991")
IHostControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetHostManager(
/* [in] */ REFIID riid,
/* [out] */ void **ppObject) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAppDomainManager(
/* [in] */ DWORD dwAppDomainID,
/* [in] */ IUnknown *pUnkAppDomainManager) = 0;
};
#else /* C style interface */
typedef struct IHostControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostControl * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostControl * This);
HRESULT ( STDMETHODCALLTYPE *GetHostManager )(
IHostControl * This,
/* [in] */ REFIID riid,
/* [out] */ void **ppObject);
HRESULT ( STDMETHODCALLTYPE *SetAppDomainManager )(
IHostControl * This,
/* [in] */ DWORD dwAppDomainID,
/* [in] */ IUnknown *pUnkAppDomainManager);
END_INTERFACE
} IHostControlVtbl;
interface IHostControl
{
CONST_VTBL struct IHostControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostControl_GetHostManager(This,riid,ppObject) \
( (This)->lpVtbl -> GetHostManager(This,riid,ppObject) )
#define IHostControl_SetAppDomainManager(This,dwAppDomainID,pUnkAppDomainManager) \
( (This)->lpVtbl -> SetAppDomainManager(This,dwAppDomainID,pUnkAppDomainManager) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostControl_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0042 */
/* [local] */
EXTERN_GUID(IID_ICLRControl, 0x9065597E, 0xD1A1, 0x4fb2, 0xB6, 0xBA, 0x7E, 0x1F, 0xCE, 0x23, 0x0F, 0x61);
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0042_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0042_v0_0_s_ifspec;
#ifndef __ICLRControl_INTERFACE_DEFINED__
#define __ICLRControl_INTERFACE_DEFINED__
/* interface ICLRControl */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9065597E-D1A1-4fb2-B6BA-7E1FCE230F61")
ICLRControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCLRManager(
/* [in] */ REFIID riid,
/* [out] */ void **ppObject) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAppDomainManagerType(
/* [in] */ LPCWSTR pwzAppDomainManagerAssembly,
/* [in] */ LPCWSTR pwzAppDomainManagerType) = 0;
};
#else /* C style interface */
typedef struct ICLRControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRControl * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRControl * This);
HRESULT ( STDMETHODCALLTYPE *GetCLRManager )(
ICLRControl * This,
/* [in] */ REFIID riid,
/* [out] */ void **ppObject);
HRESULT ( STDMETHODCALLTYPE *SetAppDomainManagerType )(
ICLRControl * This,
/* [in] */ LPCWSTR pwzAppDomainManagerAssembly,
/* [in] */ LPCWSTR pwzAppDomainManagerType);
END_INTERFACE
} ICLRControlVtbl;
interface ICLRControl
{
CONST_VTBL struct ICLRControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRControl_GetCLRManager(This,riid,ppObject) \
( (This)->lpVtbl -> GetCLRManager(This,riid,ppObject) )
#define ICLRControl_SetAppDomainManagerType(This,pwzAppDomainManagerAssembly,pwzAppDomainManagerType) \
( (This)->lpVtbl -> SetAppDomainManagerType(This,pwzAppDomainManagerAssembly,pwzAppDomainManagerType) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRControl_INTERFACE_DEFINED__ */
#ifndef __ICLRRuntimeHost_INTERFACE_DEFINED__
#define __ICLRRuntimeHost_INTERFACE_DEFINED__
/* interface ICLRRuntimeHost */
/* [object][local][unique][helpstring][version][uuid] */
EXTERN_C const IID IID_ICLRRuntimeHost;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("90F1A06C-7712-4762-86B5-7A5EBA6BDB02")
ICLRRuntimeHost : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHostControl(
/* [in] */ IHostControl *pHostControl) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCLRControl(
/* [out] */ ICLRControl **pCLRControl) = 0;
virtual HRESULT STDMETHODCALLTYPE UnloadAppDomain(
/* [in] */ DWORD dwAppDomainId,
/* [in] */ BOOL fWaitUntilDone) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteInAppDomain(
/* [in] */ DWORD dwAppDomainId,
/* [in] */ FExecuteInAppDomainCallback pCallback,
/* [in] */ void *cookie) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentAppDomainId(
/* [out] */ DWORD *pdwAppDomainId) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteApplication(
/* [in] */ LPCWSTR pwzAppFullName,
/* [in] */ DWORD dwManifestPaths,
/* [in] */ LPCWSTR *ppwzManifestPaths,
/* [in] */ DWORD dwActivationData,
/* [in] */ LPCWSTR *ppwzActivationData,
/* [out] */ int *pReturnValue) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteInDefaultAppDomain(
/* [in] */ LPCWSTR pwzAssemblyPath,
/* [in] */ LPCWSTR pwzTypeName,
/* [in] */ LPCWSTR pwzMethodName,
/* [in] */ LPCWSTR pwzArgument,
/* [out] */ DWORD *pReturnValue) = 0;
};
#else /* C style interface */
typedef struct ICLRRuntimeHostVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRRuntimeHost * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRRuntimeHost * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *Start )(
ICLRRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *Stop )(
ICLRRuntimeHost * This);
HRESULT ( STDMETHODCALLTYPE *SetHostControl )(
ICLRRuntimeHost * This,
/* [in] */ IHostControl *pHostControl);
HRESULT ( STDMETHODCALLTYPE *GetCLRControl )(
ICLRRuntimeHost * This,
/* [out] */ ICLRControl **pCLRControl);
HRESULT ( STDMETHODCALLTYPE *UnloadAppDomain )(
ICLRRuntimeHost * This,
/* [in] */ DWORD dwAppDomainId,
/* [in] */ BOOL fWaitUntilDone);
HRESULT ( STDMETHODCALLTYPE *ExecuteInAppDomain )(
ICLRRuntimeHost * This,
/* [in] */ DWORD dwAppDomainId,
/* [in] */ FExecuteInAppDomainCallback pCallback,
/* [in] */ void *cookie);
HRESULT ( STDMETHODCALLTYPE *GetCurrentAppDomainId )(
ICLRRuntimeHost * This,
/* [out] */ DWORD *pdwAppDomainId);
HRESULT ( STDMETHODCALLTYPE *ExecuteApplication )(
ICLRRuntimeHost * This,
/* [in] */ LPCWSTR pwzAppFullName,
/* [in] */ DWORD dwManifestPaths,
/* [in] */ LPCWSTR *ppwzManifestPaths,
/* [in] */ DWORD dwActivationData,
/* [in] */ LPCWSTR *ppwzActivationData,
/* [out] */ int *pReturnValue);
HRESULT ( STDMETHODCALLTYPE *ExecuteInDefaultAppDomain )(
ICLRRuntimeHost * This,
/* [in] */ LPCWSTR pwzAssemblyPath,
/* [in] */ LPCWSTR pwzTypeName,
/* [in] */ LPCWSTR pwzMethodName,
/* [in] */ LPCWSTR pwzArgument,
/* [out] */ DWORD *pReturnValue);
END_INTERFACE
} ICLRRuntimeHostVtbl;
interface ICLRRuntimeHost
{
CONST_VTBL struct ICLRRuntimeHostVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRRuntimeHost_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRRuntimeHost_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRRuntimeHost_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRRuntimeHost_Start(This) \
( (This)->lpVtbl -> Start(This) )
#define ICLRRuntimeHost_Stop(This) \
( (This)->lpVtbl -> Stop(This) )
#define ICLRRuntimeHost_SetHostControl(This,pHostControl) \
( (This)->lpVtbl -> SetHostControl(This,pHostControl) )
#define ICLRRuntimeHost_GetCLRControl(This,pCLRControl) \
( (This)->lpVtbl -> GetCLRControl(This,pCLRControl) )
#define ICLRRuntimeHost_UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone) \
( (This)->lpVtbl -> UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone) )
#define ICLRRuntimeHost_ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie) \
( (This)->lpVtbl -> ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie) )
#define ICLRRuntimeHost_GetCurrentAppDomainId(This,pdwAppDomainId) \
( (This)->lpVtbl -> GetCurrentAppDomainId(This,pdwAppDomainId) )
#define ICLRRuntimeHost_ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue) \
( (This)->lpVtbl -> ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue) )
#define ICLRRuntimeHost_ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue) \
( (This)->lpVtbl -> ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRRuntimeHost_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0044 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0044_0001
{ eNoChecks = 0,
eSynchronization = 0x1,
eSharedState = 0x2,
eExternalProcessMgmt = 0x4,
eSelfAffectingProcessMgmt = 0x8,
eExternalThreading = 0x10,
eSelfAffectingThreading = 0x20,
eSecurityInfrastructure = 0x40,
eUI = 0x80,
eMayLeakOnAbort = 0x100,
eAll = 0x1ff
} EApiCategories;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0044_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0044_v0_0_s_ifspec;
#ifndef __ICLRHostProtectionManager_INTERFACE_DEFINED__
#define __ICLRHostProtectionManager_INTERFACE_DEFINED__
/* interface ICLRHostProtectionManager */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_ICLRHostProtectionManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("89F25F5C-CEEF-43e1-9CFA-A68CE863AAAC")
ICLRHostProtectionManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetProtectedCategories(
/* [in] */ EApiCategories categories) = 0;
virtual HRESULT STDMETHODCALLTYPE SetEagerSerializeGrantSets( void) = 0;
};
#else /* C style interface */
typedef struct ICLRHostProtectionManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRHostProtectionManager * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRHostProtectionManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRHostProtectionManager * This);
HRESULT ( STDMETHODCALLTYPE *SetProtectedCategories )(
ICLRHostProtectionManager * This,
/* [in] */ EApiCategories categories);
HRESULT ( STDMETHODCALLTYPE *SetEagerSerializeGrantSets )(
ICLRHostProtectionManager * This);
END_INTERFACE
} ICLRHostProtectionManagerVtbl;
interface ICLRHostProtectionManager
{
CONST_VTBL struct ICLRHostProtectionManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRHostProtectionManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRHostProtectionManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRHostProtectionManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRHostProtectionManager_SetProtectedCategories(This,categories) \
( (This)->lpVtbl -> SetProtectedCategories(This,categories) )
#define ICLRHostProtectionManager_SetEagerSerializeGrantSets(This) \
( (This)->lpVtbl -> SetEagerSerializeGrantSets(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRHostProtectionManager_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_mscoree_0000_0045 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0045_0001
{ eInitializeNewDomainFlags_None = 0,
eInitializeNewDomainFlags_NoSecurityChanges = 0x2
} EInitializeNewDomainFlags;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0045_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0045_v0_0_s_ifspec;
#ifndef __ICLRDomainManager_INTERFACE_DEFINED__
#define __ICLRDomainManager_INTERFACE_DEFINED__
/* interface ICLRDomainManager */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_ICLRDomainManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("270D00A2-8E15-4d0b-ADEB-37BC3E47DF77")
ICLRDomainManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetAppDomainManagerType(
/* [in] */ __RPC__in LPCWSTR wszAppDomainManagerAssembly,
/* [in] */ __RPC__in LPCWSTR wszAppDomainManagerType,
/* [in] */ EInitializeNewDomainFlags dwInitializeDomainFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPropertiesForDefaultAppDomain(
/* [in] */ DWORD nProperties,
/* [in] */ __RPC__deref_in_opt LPCWSTR *pwszPropertyNames,
/* [in] */ __RPC__deref_in_opt LPCWSTR *pwszPropertyValues) = 0;
};
#else /* C style interface */
typedef struct ICLRDomainManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRDomainManager * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRDomainManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRDomainManager * This);
HRESULT ( STDMETHODCALLTYPE *SetAppDomainManagerType )(
ICLRDomainManager * This,
/* [in] */ __RPC__in LPCWSTR wszAppDomainManagerAssembly,
/* [in] */ __RPC__in LPCWSTR wszAppDomainManagerType,
/* [in] */ EInitializeNewDomainFlags dwInitializeDomainFlags);
HRESULT ( STDMETHODCALLTYPE *SetPropertiesForDefaultAppDomain )(
ICLRDomainManager * This,
/* [in] */ DWORD nProperties,
/* [in] */ __RPC__deref_in_opt LPCWSTR *pwszPropertyNames,
/* [in] */ __RPC__deref_in_opt LPCWSTR *pwszPropertyValues);
END_INTERFACE
} ICLRDomainManagerVtbl;
interface ICLRDomainManager
{
CONST_VTBL struct ICLRDomainManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRDomainManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRDomainManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRDomainManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRDomainManager_SetAppDomainManagerType(This,wszAppDomainManagerAssembly,wszAppDomainManagerType,dwInitializeDomainFlags) \
( (This)->lpVtbl -> SetAppDomainManagerType(This,wszAppDomainManagerAssembly,wszAppDomainManagerType,dwInitializeDomainFlags) )
#define ICLRDomainManager_SetPropertiesForDefaultAppDomain(This,nProperties,pwszPropertyNames,pwszPropertyValues) \
( (This)->lpVtbl -> SetPropertiesForDefaultAppDomain(This,nProperties,pwszPropertyNames,pwszPropertyValues) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRDomainManager_INTERFACE_DEFINED__ */
#ifndef __mscoree_LIBRARY_DEFINED__
#define __mscoree_LIBRARY_DEFINED__
/* library mscoree */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_mscoree;
#ifndef __ITypeName_INTERFACE_DEFINED__
#define __ITypeName_INTERFACE_DEFINED__
/* interface ITypeName */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_ITypeName;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("B81FF171-20F3-11d2-8DCC-00A0C9B00522")
ITypeName : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetNameCount(
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetNames(
/* [in] */ DWORD count,
/* [out] */ __RPC__deref_out_opt BSTR *rgbszNames,
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetTypeArgumentCount(
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetTypeArguments(
/* [in] */ DWORD count,
/* [out] */ __RPC__deref_out_opt ITypeName **rgpArguments,
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetModifierLength(
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetModifiers(
/* [in] */ DWORD count,
/* [out] */ __RPC__out DWORD *rgModifiers,
/* [retval][out] */ __RPC__out DWORD *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(
/* [retval][out] */ __RPC__deref_out_opt BSTR *rgbszAssemblyNames) = 0;
};
#else /* C style interface */
typedef struct ITypeNameVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ITypeName * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ITypeName * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ITypeName * This);
HRESULT ( STDMETHODCALLTYPE *GetNameCount )(
ITypeName * This,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetNames )(
ITypeName * This,
/* [in] */ DWORD count,
/* [out] */ __RPC__deref_out_opt BSTR *rgbszNames,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetTypeArgumentCount )(
ITypeName * This,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetTypeArguments )(
ITypeName * This,
/* [in] */ DWORD count,
/* [out] */ __RPC__deref_out_opt ITypeName **rgpArguments,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetModifierLength )(
ITypeName * This,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetModifiers )(
ITypeName * This,
/* [in] */ DWORD count,
/* [out] */ __RPC__out DWORD *rgModifiers,
/* [retval][out] */ __RPC__out DWORD *pCount);
HRESULT ( STDMETHODCALLTYPE *GetAssemblyName )(
ITypeName * This,
/* [retval][out] */ __RPC__deref_out_opt BSTR *rgbszAssemblyNames);
END_INTERFACE
} ITypeNameVtbl;
interface ITypeName
{
CONST_VTBL struct ITypeNameVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ITypeName_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ITypeName_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ITypeName_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ITypeName_GetNameCount(This,pCount) \
( (This)->lpVtbl -> GetNameCount(This,pCount) )
#define ITypeName_GetNames(This,count,rgbszNames,pCount) \
( (This)->lpVtbl -> GetNames(This,count,rgbszNames,pCount) )
#define ITypeName_GetTypeArgumentCount(This,pCount) \
( (This)->lpVtbl -> GetTypeArgumentCount(This,pCount) )
#define ITypeName_GetTypeArguments(This,count,rgpArguments,pCount) \
( (This)->lpVtbl -> GetTypeArguments(This,count,rgpArguments,pCount) )
#define ITypeName_GetModifierLength(This,pCount) \
( (This)->lpVtbl -> GetModifierLength(This,pCount) )
#define ITypeName_GetModifiers(This,count,rgModifiers,pCount) \
( (This)->lpVtbl -> GetModifiers(This,count,rgModifiers,pCount) )
#define ITypeName_GetAssemblyName(This,rgbszAssemblyNames) \
( (This)->lpVtbl -> GetAssemblyName(This,rgbszAssemblyNames) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ITypeName_INTERFACE_DEFINED__ */
#ifndef __ITypeNameBuilder_INTERFACE_DEFINED__
#define __ITypeNameBuilder_INTERFACE_DEFINED__
/* interface ITypeNameBuilder */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_ITypeNameBuilder;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("B81FF171-20F3-11d2-8DCC-00A0C9B00523")
ITypeNameBuilder : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE OpenGenericArguments( void) = 0;
virtual HRESULT STDMETHODCALLTYPE CloseGenericArguments( void) = 0;
virtual HRESULT STDMETHODCALLTYPE OpenGenericArgument( void) = 0;
virtual HRESULT STDMETHODCALLTYPE CloseGenericArgument( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddName(
/* [in] */ __RPC__in LPCWSTR szName) = 0;
virtual HRESULT STDMETHODCALLTYPE AddPointer( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddByRef( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddSzArray( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddArray(
/* [in] */ DWORD rank) = 0;
virtual HRESULT STDMETHODCALLTYPE AddAssemblySpec(
/* [in] */ __RPC__in LPCWSTR szAssemblySpec) = 0;
virtual HRESULT STDMETHODCALLTYPE ToString(
/* [retval][out] */ __RPC__deref_out_opt BSTR *pszStringRepresentation) = 0;
virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0;
};
#else /* C style interface */
typedef struct ITypeNameBuilderVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ITypeNameBuilder * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ITypeNameBuilder * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *OpenGenericArguments )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *CloseGenericArguments )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *OpenGenericArgument )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *CloseGenericArgument )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *AddName )(
ITypeNameBuilder * This,
/* [in] */ __RPC__in LPCWSTR szName);
HRESULT ( STDMETHODCALLTYPE *AddPointer )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *AddByRef )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *AddSzArray )(
ITypeNameBuilder * This);
HRESULT ( STDMETHODCALLTYPE *AddArray )(
ITypeNameBuilder * This,
/* [in] */ DWORD rank);
HRESULT ( STDMETHODCALLTYPE *AddAssemblySpec )(
ITypeNameBuilder * This,
/* [in] */ __RPC__in LPCWSTR szAssemblySpec);
HRESULT ( STDMETHODCALLTYPE *ToString )(
ITypeNameBuilder * This,
/* [retval][out] */ __RPC__deref_out_opt BSTR *pszStringRepresentation);
HRESULT ( STDMETHODCALLTYPE *Clear )(
ITypeNameBuilder * This);
END_INTERFACE
} ITypeNameBuilderVtbl;
interface ITypeNameBuilder
{
CONST_VTBL struct ITypeNameBuilderVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ITypeNameBuilder_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ITypeNameBuilder_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ITypeNameBuilder_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ITypeNameBuilder_OpenGenericArguments(This) \
( (This)->lpVtbl -> OpenGenericArguments(This) )
#define ITypeNameBuilder_CloseGenericArguments(This) \
( (This)->lpVtbl -> CloseGenericArguments(This) )
#define ITypeNameBuilder_OpenGenericArgument(This) \
( (This)->lpVtbl -> OpenGenericArgument(This) )
#define ITypeNameBuilder_CloseGenericArgument(This) \
( (This)->lpVtbl -> CloseGenericArgument(This) )
#define ITypeNameBuilder_AddName(This,szName) \
( (This)->lpVtbl -> AddName(This,szName) )
#define ITypeNameBuilder_AddPointer(This) \
( (This)->lpVtbl -> AddPointer(This) )
#define ITypeNameBuilder_AddByRef(This) \
( (This)->lpVtbl -> AddByRef(This) )
#define ITypeNameBuilder_AddSzArray(This) \
( (This)->lpVtbl -> AddSzArray(This) )
#define ITypeNameBuilder_AddArray(This,rank) \
( (This)->lpVtbl -> AddArray(This,rank) )
#define ITypeNameBuilder_AddAssemblySpec(This,szAssemblySpec) \
( (This)->lpVtbl -> AddAssemblySpec(This,szAssemblySpec) )
#define ITypeNameBuilder_ToString(This,pszStringRepresentation) \
( (This)->lpVtbl -> ToString(This,pszStringRepresentation) )
#define ITypeNameBuilder_Clear(This) \
( (This)->lpVtbl -> Clear(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ITypeNameBuilder_INTERFACE_DEFINED__ */
#ifndef __ITypeNameFactory_INTERFACE_DEFINED__
#define __ITypeNameFactory_INTERFACE_DEFINED__
/* interface ITypeNameFactory */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_ITypeNameFactory;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("B81FF171-20F3-11d2-8DCC-00A0C9B00521")
ITypeNameFactory : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ParseTypeName(
/* [in] */ __RPC__in LPCWSTR szName,
/* [out] */ __RPC__out DWORD *pError,
/* [retval][out] */ __RPC__deref_out_opt ITypeName **ppTypeName) = 0;
virtual HRESULT STDMETHODCALLTYPE GetTypeNameBuilder(
/* [retval][out] */ __RPC__deref_out_opt ITypeNameBuilder **ppTypeBuilder) = 0;
};
#else /* C style interface */
typedef struct ITypeNameFactoryVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ITypeNameFactory * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ITypeNameFactory * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ITypeNameFactory * This);
HRESULT ( STDMETHODCALLTYPE *ParseTypeName )(
ITypeNameFactory * This,
/* [in] */ __RPC__in LPCWSTR szName,
/* [out] */ __RPC__out DWORD *pError,
/* [retval][out] */ __RPC__deref_out_opt ITypeName **ppTypeName);
HRESULT ( STDMETHODCALLTYPE *GetTypeNameBuilder )(
ITypeNameFactory * This,
/* [retval][out] */ __RPC__deref_out_opt ITypeNameBuilder **ppTypeBuilder);
END_INTERFACE
} ITypeNameFactoryVtbl;
interface ITypeNameFactory
{
CONST_VTBL struct ITypeNameFactoryVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ITypeNameFactory_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ITypeNameFactory_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ITypeNameFactory_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ITypeNameFactory_ParseTypeName(This,szName,pError,ppTypeName) \
( (This)->lpVtbl -> ParseTypeName(This,szName,pError,ppTypeName) )
#define ITypeNameFactory_GetTypeNameBuilder(This,ppTypeBuilder) \
( (This)->lpVtbl -> GetTypeNameBuilder(This,ppTypeBuilder) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ITypeNameFactory_INTERFACE_DEFINED__ */
#ifndef __IApartmentCallback_INTERFACE_DEFINED__
#define __IApartmentCallback_INTERFACE_DEFINED__
/* interface IApartmentCallback */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_IApartmentCallback;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("178E5337-1528-4591-B1C9-1C6E484686D8")
IApartmentCallback : public IUnknown
{
public:
virtual HRESULT __stdcall DoCallback(
/* [in] */ SIZE_T pFunc,
/* [in] */ SIZE_T pData) = 0;
};
#else /* C style interface */
typedef struct IApartmentCallbackVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IApartmentCallback * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IApartmentCallback * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IApartmentCallback * This);
HRESULT ( __stdcall *DoCallback )(
IApartmentCallback * This,
/* [in] */ SIZE_T pFunc,
/* [in] */ SIZE_T pData);
END_INTERFACE
} IApartmentCallbackVtbl;
interface IApartmentCallback
{
CONST_VTBL struct IApartmentCallbackVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IApartmentCallback_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IApartmentCallback_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IApartmentCallback_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IApartmentCallback_DoCallback(This,pFunc,pData) \
( (This)->lpVtbl -> DoCallback(This,pFunc,pData) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IApartmentCallback_INTERFACE_DEFINED__ */
#ifndef __IManagedObject_INTERFACE_DEFINED__
#define __IManagedObject_INTERFACE_DEFINED__
/* interface IManagedObject */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_IManagedObject;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C3FCC19E-A970-11d2-8B5A-00A0C9B7C9C4")
IManagedObject : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetSerializedBuffer(
/* [out] */ __RPC__deref_out_opt BSTR *pBSTR) = 0;
virtual HRESULT STDMETHODCALLTYPE GetObjectIdentity(
/* [out] */ __RPC__deref_out_opt BSTR *pBSTRGUID,
/* [out] */ __RPC__out int *AppDomainID,
/* [out] */ __RPC__out int *pCCW) = 0;
};
#else /* C style interface */
typedef struct IManagedObjectVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IManagedObject * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IManagedObject * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IManagedObject * This);
HRESULT ( STDMETHODCALLTYPE *GetSerializedBuffer )(
IManagedObject * This,
/* [out] */ __RPC__deref_out_opt BSTR *pBSTR);
HRESULT ( STDMETHODCALLTYPE *GetObjectIdentity )(
IManagedObject * This,
/* [out] */ __RPC__deref_out_opt BSTR *pBSTRGUID,
/* [out] */ __RPC__out int *AppDomainID,
/* [out] */ __RPC__out int *pCCW);
END_INTERFACE
} IManagedObjectVtbl;
interface IManagedObject
{
CONST_VTBL struct IManagedObjectVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IManagedObject_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IManagedObject_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IManagedObject_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IManagedObject_GetSerializedBuffer(This,pBSTR) \
( (This)->lpVtbl -> GetSerializedBuffer(This,pBSTR) )
#define IManagedObject_GetObjectIdentity(This,pBSTRGUID,AppDomainID,pCCW) \
( (This)->lpVtbl -> GetObjectIdentity(This,pBSTRGUID,AppDomainID,pCCW) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IManagedObject_INTERFACE_DEFINED__ */
#ifndef __ICatalogServices_INTERFACE_DEFINED__
#define __ICatalogServices_INTERFACE_DEFINED__
/* interface ICatalogServices */
/* [unique][helpstring][uuid][oleautomation][object] */
EXTERN_C const IID IID_ICatalogServices;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("04C6BE1E-1DB1-4058-AB7A-700CCCFBF254")
ICatalogServices : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Autodone( void) = 0;
virtual HRESULT STDMETHODCALLTYPE NotAutodone( void) = 0;
};
#else /* C style interface */
typedef struct ICatalogServicesVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICatalogServices * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICatalogServices * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICatalogServices * This);
HRESULT ( STDMETHODCALLTYPE *Autodone )(
ICatalogServices * This);
HRESULT ( STDMETHODCALLTYPE *NotAutodone )(
ICatalogServices * This);
END_INTERFACE
} ICatalogServicesVtbl;
interface ICatalogServices
{
CONST_VTBL struct ICatalogServicesVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICatalogServices_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICatalogServices_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICatalogServices_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICatalogServices_Autodone(This) \
( (This)->lpVtbl -> Autodone(This) )
#define ICatalogServices_NotAutodone(This) \
( (This)->lpVtbl -> NotAutodone(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICatalogServices_INTERFACE_DEFINED__ */
EXTERN_C const CLSID CLSID_ComCallUnmarshal;
#ifdef __cplusplus
class DECLSPEC_UUID("3F281000-E95A-11d2-886B-00C04F869F04")
ComCallUnmarshal;
#endif
EXTERN_C const CLSID CLSID_ComCallUnmarshalV4;
#ifdef __cplusplus
class DECLSPEC_UUID("45FB4600-E6E8-4928-B25E-50476FF79425")
ComCallUnmarshalV4;
#endif
EXTERN_C const CLSID CLSID_CorRuntimeHost;
#ifdef __cplusplus
class DECLSPEC_UUID("CB2F6723-AB3A-11d2-9C40-00C04FA30A3E")
CorRuntimeHost;
#endif
EXTERN_C const CLSID CLSID_CLRRuntimeHost;
#ifdef __cplusplus
class DECLSPEC_UUID("90F1A06E-7712-4762-86B5-7A5EBA6BDB02")
CLRRuntimeHost;
#endif
EXTERN_C const CLSID CLSID_TypeNameFactory;
#ifdef __cplusplus
class DECLSPEC_UUID("B81FF171-20F3-11d2-8DCC-00A0C9B00525")
TypeNameFactory;
#endif
#endif /* __mscoree_LIBRARY_DEFINED__ */
/* interface __MIDL_itf_mscoree_0001_0014 */
/* [local] */
typedef /* [public][public][public] */
enum __MIDL___MIDL_itf_mscoree_0001_0014_0001
{ eCurrentContext = 0,
eRestrictedContext = 0x1
} EContextType;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0001_0014_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_mscoree_0001_0014_v0_0_s_ifspec;
#ifndef __IHostSecurityContext_INTERFACE_DEFINED__
#define __IHostSecurityContext_INTERFACE_DEFINED__
/* interface IHostSecurityContext */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_IHostSecurityContext;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7E573CE4-0343-4423-98D7-6318348A1D3C")
IHostSecurityContext : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Capture(
/* [out] */ IHostSecurityContext **ppClonedContext) = 0;
};
#else /* C style interface */
typedef struct IHostSecurityContextVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostSecurityContext * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostSecurityContext * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostSecurityContext * This);
HRESULT ( STDMETHODCALLTYPE *Capture )(
IHostSecurityContext * This,
/* [out] */ IHostSecurityContext **ppClonedContext);
END_INTERFACE
} IHostSecurityContextVtbl;
interface IHostSecurityContext
{
CONST_VTBL struct IHostSecurityContextVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostSecurityContext_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostSecurityContext_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostSecurityContext_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostSecurityContext_Capture(This,ppClonedContext) \
( (This)->lpVtbl -> Capture(This,ppClonedContext) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostSecurityContext_INTERFACE_DEFINED__ */
#ifndef __IHostSecurityManager_INTERFACE_DEFINED__
#define __IHostSecurityManager_INTERFACE_DEFINED__
/* interface IHostSecurityManager */
/* [local][unique][helpstring][uuid][version][object] */
EXTERN_C const IID IID_IHostSecurityManager;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("75ad2468-a349-4d02-a764-76a68aee0c4f")
IHostSecurityManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE ImpersonateLoggedOnUser(
/* [in] */ HANDLE hToken) = 0;
virtual HRESULT STDMETHODCALLTYPE RevertToSelf( void) = 0;
virtual HRESULT STDMETHODCALLTYPE OpenThreadToken(
/* [in] */ DWORD dwDesiredAccess,
/* [in] */ BOOL bOpenAsSelf,
/* [out] */ HANDLE *phThreadToken) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThreadToken(
/* [in] */ HANDLE hToken) = 0;
virtual HRESULT STDMETHODCALLTYPE GetSecurityContext(
/* [in] */ EContextType eContextType,
/* [out] */ IHostSecurityContext **ppSecurityContext) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSecurityContext(
/* [in] */ EContextType eContextType,
/* [in] */ IHostSecurityContext *pSecurityContext) = 0;
};
#else /* C style interface */
typedef struct IHostSecurityManagerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IHostSecurityManager * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IHostSecurityManager * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IHostSecurityManager * This);
HRESULT ( STDMETHODCALLTYPE *ImpersonateLoggedOnUser )(
IHostSecurityManager * This,
/* [in] */ HANDLE hToken);
HRESULT ( STDMETHODCALLTYPE *RevertToSelf )(
IHostSecurityManager * This);
HRESULT ( STDMETHODCALLTYPE *OpenThreadToken )(
IHostSecurityManager * This,
/* [in] */ DWORD dwDesiredAccess,
/* [in] */ BOOL bOpenAsSelf,
/* [out] */ HANDLE *phThreadToken);
HRESULT ( STDMETHODCALLTYPE *SetThreadToken )(
IHostSecurityManager * This,
/* [in] */ HANDLE hToken);
HRESULT ( STDMETHODCALLTYPE *GetSecurityContext )(
IHostSecurityManager * This,
/* [in] */ EContextType eContextType,
/* [out] */ IHostSecurityContext **ppSecurityContext);
HRESULT ( STDMETHODCALLTYPE *SetSecurityContext )(
IHostSecurityManager * This,
/* [in] */ EContextType eContextType,
/* [in] */ IHostSecurityContext *pSecurityContext);
END_INTERFACE
} IHostSecurityManagerVtbl;
interface IHostSecurityManager
{
CONST_VTBL struct IHostSecurityManagerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IHostSecurityManager_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IHostSecurityManager_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IHostSecurityManager_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IHostSecurityManager_ImpersonateLoggedOnUser(This,hToken) \
( (This)->lpVtbl -> ImpersonateLoggedOnUser(This,hToken) )
#define IHostSecurityManager_RevertToSelf(This) \
( (This)->lpVtbl -> RevertToSelf(This) )
#define IHostSecurityManager_OpenThreadToken(This,dwDesiredAccess,bOpenAsSelf,phThreadToken) \
( (This)->lpVtbl -> OpenThreadToken(This,dwDesiredAccess,bOpenAsSelf,phThreadToken) )
#define IHostSecurityManager_SetThreadToken(This,hToken) \
( (This)->lpVtbl -> SetThreadToken(This,hToken) )
#define IHostSecurityManager_GetSecurityContext(This,eContextType,ppSecurityContext) \
( (This)->lpVtbl -> GetSecurityContext(This,eContextType,ppSecurityContext) )
#define IHostSecurityManager_SetSecurityContext(This,eContextType,pSecurityContext) \
( (This)->lpVtbl -> SetSecurityContext(This,eContextType,pSecurityContext) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IHostSecurityManager_INTERFACE_DEFINED__ */
#ifndef __ICLRAppDomainResourceMonitor_INTERFACE_DEFINED__
#define __ICLRAppDomainResourceMonitor_INTERFACE_DEFINED__
/* interface ICLRAppDomainResourceMonitor */
/* [object][local][unique][helpstring][uuid][version] */
EXTERN_C const IID IID_ICLRAppDomainResourceMonitor;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c62de18c-2e23-4aea-8423-b40c1fc59eae")
ICLRAppDomainResourceMonitor : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCurrentAllocated(
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pBytesAllocated) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentSurvived(
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pAppDomainBytesSurvived,
/* [out] */ ULONGLONG *pTotalBytesSurvived) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentCpuTime(
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pMilliseconds) = 0;
};
#else /* C style interface */
typedef struct ICLRAppDomainResourceMonitorVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICLRAppDomainResourceMonitor * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICLRAppDomainResourceMonitor * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ICLRAppDomainResourceMonitor * This);
HRESULT ( STDMETHODCALLTYPE *GetCurrentAllocated )(
ICLRAppDomainResourceMonitor * This,
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pBytesAllocated);
HRESULT ( STDMETHODCALLTYPE *GetCurrentSurvived )(
ICLRAppDomainResourceMonitor * This,
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pAppDomainBytesSurvived,
/* [out] */ ULONGLONG *pTotalBytesSurvived);
HRESULT ( STDMETHODCALLTYPE *GetCurrentCpuTime )(
ICLRAppDomainResourceMonitor * This,
/* [in] */ DWORD dwAppDomainId,
/* [out] */ ULONGLONG *pMilliseconds);
END_INTERFACE
} ICLRAppDomainResourceMonitorVtbl;
interface ICLRAppDomainResourceMonitor
{
CONST_VTBL struct ICLRAppDomainResourceMonitorVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICLRAppDomainResourceMonitor_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICLRAppDomainResourceMonitor_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICLRAppDomainResourceMonitor_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICLRAppDomainResourceMonitor_GetCurrentAllocated(This,dwAppDomainId,pBytesAllocated) \
( (This)->lpVtbl -> GetCurrentAllocated(This,dwAppDomainId,pBytesAllocated) )
#define ICLRAppDomainResourceMonitor_GetCurrentSurvived(This,dwAppDomainId,pAppDomainBytesSurvived,pTotalBytesSurvived) \
( (This)->lpVtbl -> GetCurrentSurvived(This,dwAppDomainId,pAppDomainBytesSurvived,pTotalBytesSurvived) )
#define ICLRAppDomainResourceMonitor_GetCurrentCpuTime(This,dwAppDomainId,pMilliseconds) \
( (This)->lpVtbl -> GetCurrentCpuTime(This,dwAppDomainId,pMilliseconds) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICLRAppDomainResourceMonitor_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * );
unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * );
unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * );
void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
|
dwindow/dwindow
|
oem-3dvstar/dwindow/WinSDK/Include/mscoree.h
|
C
|
gpl-3.0
| 239,231
|
/*********************
* status_screen.cpp *
*********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
#include "screens.h"
#include "screen_data.h"
#include "../archim2-flash/flash_storage.h"
using namespace FTDI;
using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT
#define GRID_ROWS 8
#else
#define GRID_ROWS 8
#endif
void StatusScreen::draw_axis_position(draw_mode_t what) {
CommandProcessor cmd;
#define GRID_COLS 3
if (what & BACKGROUND) {
cmd.tag(6)
#ifdef TOUCH_UI_PORTRAIT
.fgcolor(Theme::axis_label)
.font(Theme::font_large)
.button( BTN_POS(1,5), BTN_SIZE(2,1), F(""), OPT_FLAT)
.button( BTN_POS(1,6), BTN_SIZE(2,1), F(""), OPT_FLAT)
.button( BTN_POS(1,7), BTN_SIZE(2,1), F(""), OPT_FLAT)
.font(Theme::font_small)
.text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X))
.text ( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y))
.text ( BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z))
.font(Theme::font_medium)
.fgcolor(Theme::x_axis) .button( BTN_POS(2,5), BTN_SIZE(2,1), F(""), OPT_FLAT)
.fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(2,1), F(""), OPT_FLAT)
.fgcolor(Theme::z_axis) .button( BTN_POS(2,7), BTN_SIZE(2,1), F(""), OPT_FLAT);
#else
.fgcolor(Theme::axis_label)
.font(Theme::font_large)
.button( BTN_POS(1,5), BTN_SIZE(1,2), F(""), OPT_FLAT)
.button( BTN_POS(2,5), BTN_SIZE(1,2), F(""), OPT_FLAT)
.button( BTN_POS(3,5), BTN_SIZE(1,2), F(""), OPT_FLAT)
.font(Theme::font_small)
.text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X))
.text ( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y))
.text ( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z))
.font(Theme::font_medium)
.fgcolor(Theme::x_axis) .button( BTN_POS(1,6), BTN_SIZE(1,1), F(""), OPT_FLAT)
.fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT)
.fgcolor(Theme::z_axis) .button( BTN_POS(3,6), BTN_SIZE(1,1), F(""), OPT_FLAT);
#endif
}
if (what & FOREGROUND) {
using namespace ExtUI;
char x_str[15];
char y_str[15];
char z_str[15];
if (isAxisPositionKnown(X))
format_position(x_str, getAxisPosition_mm(X));
else
strcpy_P(x_str, PSTR("?"));
if (isAxisPositionKnown(Y))
format_position(y_str, getAxisPosition_mm(Y));
else
strcpy_P(y_str, PSTR("?"));
if (isAxisPositionKnown(Z))
format_position(z_str, getAxisPosition_mm(Z));
else
strcpy_P(z_str, PSTR("?"));
cmd.tag(6).font(Theme::font_medium)
#ifdef TOUCH_UI_PORTRAIT
.text ( BTN_POS(2,5), BTN_SIZE(2,1), x_str)
.text ( BTN_POS(2,6), BTN_SIZE(2,1), y_str)
.text ( BTN_POS(2,7), BTN_SIZE(2,1), z_str);
#else
.text ( BTN_POS(1,6), BTN_SIZE(1,1), x_str)
.text ( BTN_POS(2,6), BTN_SIZE(1,1), y_str)
.text ( BTN_POS(3,6), BTN_SIZE(1,1), z_str);
#endif
}
#undef GRID_COLS
}
#ifdef TOUCH_UI_PORTRAIT
#define GRID_COLS 8
#else
#define GRID_COLS 12
#endif
void StatusScreen::draw_temperature(draw_mode_t what) {
using namespace Theme;
CommandProcessor cmd;
if (what & BACKGROUND) {
cmd.font(Theme::font_small)
#ifdef TOUCH_UI_PORTRAIT
.tag(5)
.fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT)
.button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT)
.fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT)
.tag(0)
.fgcolor(progress) .button( BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT)
.button( BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT);
#else
.tag(5)
.fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT)
.button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT)
.fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT)
.tag(0)
.fgcolor(progress) .button( BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT)
.button( BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT);
#endif
// Draw Extruder Bitmap on Extruder Temperature Button
cmd.tag(5)
.cmd(BITMAP_SOURCE(Extruder_Icon_Info))
.cmd(BITMAP_LAYOUT(Extruder_Icon_Info))
.cmd(BITMAP_SIZE (Extruder_Icon_Info))
.icon (BTN_POS(1,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale)
.icon (BTN_POS(5,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale);
// Draw Bed Heat Bitmap on Bed Heat Button
cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info))
.cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info))
.cmd(BITMAP_SIZE (Bed_Heat_Icon_Info))
.icon (BTN_POS(1,2), BTN_SIZE(1,1), Bed_Heat_Icon_Info, icon_scale);
// Draw Fan Percent Bitmap on Bed Heat Button
cmd.cmd(BITMAP_SOURCE(Fan_Icon_Info))
.cmd(BITMAP_LAYOUT(Fan_Icon_Info))
.cmd(BITMAP_SIZE (Fan_Icon_Info))
.icon (BTN_POS(5,2), BTN_SIZE(1,1), Fan_Icon_Info, icon_scale);
#ifdef TOUCH_UI_USE_UTF8
load_utf8_bitmaps(cmd); // Restore font bitmap handles
#endif
}
if (what & FOREGROUND) {
using namespace ExtUI;
char e0_str[20];
char e1_str[20];
char bed_str[20];
char fan_str[20];
sprintf_P(
fan_str,
PSTR("%-3d %%"),
int8_t(getActualFan_percent(FAN0))
);
if (isHeaterIdle(BED))
format_temp_and_idle(bed_str, getActualTemp_celsius(BED));
else
format_temp_and_temp(bed_str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED));
if (isHeaterIdle(H0))
format_temp_and_idle(e0_str, getActualTemp_celsius(H0));
else
format_temp_and_temp(e0_str, getActualTemp_celsius(H0), getTargetTemp_celsius(H0));
#if EXTRUDERS == 2
if (isHeaterIdle(H1))
format_temp_and_idle(e1_str, getActualTemp_celsius(H1));
else
format_temp_and_temp(e1_str, getActualTemp_celsius(H1), getTargetTemp_celsius(H1));
#else
strcpy_P(
e1_str,
PSTR("-")
);
#endif
cmd.tag(5)
.font(font_medium)
.text(BTN_POS(2,1), BTN_SIZE(3,1), e0_str)
.text(BTN_POS(6,1), BTN_SIZE(3,1), e1_str)
.text(BTN_POS(2,2), BTN_SIZE(3,1), bed_str)
.text(BTN_POS(6,2), BTN_SIZE(3,1), fan_str);
}
}
void StatusScreen::draw_progress(draw_mode_t what) {
using namespace ExtUI;
using namespace Theme;
CommandProcessor cmd;
if (what & BACKGROUND) {
cmd.tag(0).font(font_medium)
#ifdef TOUCH_UI_PORTRAIT
.fgcolor(progress) .button(BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT)
.button(BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT);
#else
.fgcolor(progress) .button(BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT)
.button(BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT);
#endif
}
if (what & FOREGROUND) {
const uint32_t elapsed = getProgress_seconds_elapsed();
const uint8_t hrs = elapsed/3600;
const uint8_t min = (elapsed/60)%60;
char time_str[10];
char progress_str[10];
sprintf_P(time_str, PSTR(" %02d : %02d"), hrs, min);
sprintf_P(progress_str, PSTR("%-3d %%"), getProgress_percent() );
cmd.font(font_medium)
#ifdef TOUCH_UI_PORTRAIT
.tag(0).text(BTN_POS(1,3), BTN_SIZE(4,1), time_str)
.text(BTN_POS(5,3), BTN_SIZE(4,1), progress_str);
#else
.tag(0).text(BTN_POS(9,1), BTN_SIZE(4,1), time_str)
.text(BTN_POS(9,2), BTN_SIZE(4,1), progress_str);
#endif
}
}
#undef GRID_COLS
void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
#define GRID_COLS 4
if (what & FOREGROUND) {
using namespace ExtUI;
const bool has_media = isMediaInserted() && !isPrintingFromMedia();
CommandProcessor cmd;
cmd.colors(normal_btn)
.font(Theme::font_medium)
.enabled(has_media)
.colors(has_media ? action_btn : normal_btn)
.tag(3).button(
#ifdef TOUCH_UI_PORTRAIT
BTN_POS(1,8), BTN_SIZE(2,1),
#else
BTN_POS(1,7), BTN_SIZE(2,2),
#endif
isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA)
).colors(!has_media ? action_btn : normal_btn)
#ifdef TOUCH_UI_PORTRAIT
.tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_MENU));
#else
.tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), GET_TEXT_F(MSG_BUTTON_MENU));
#endif
}
#undef GRID_COLS
}
void StatusScreen::draw_status_message(draw_mode_t what, const char* message) {
#define GRID_COLS 1
if (what & BACKGROUND) {
CommandProcessor cmd;
cmd.fgcolor(Theme::status_msg)
.tag(0)
#ifdef TOUCH_UI_PORTRAIT
.button( BTN_POS(1,4), BTN_SIZE(1,1), F(""), OPT_FLAT);
#else
.button( BTN_POS(1,3), BTN_SIZE(1,2), F(""), OPT_FLAT);
#endif
draw_text_box(cmd,
#ifdef TOUCH_UI_PORTRAIT
BTN_POS(1,4), BTN_SIZE(1,1),
#else
BTN_POS(1,3), BTN_SIZE(1,2),
#endif
message, OPT_CENTER, font_large);
}
#undef GRID_COLS
}
void StatusScreen::setStatusMessage(progmem_str message) {
char buff[strlen_P((const char * const)message)+1];
strcpy_P(buff, (const char * const) message);
setStatusMessage((const char *) buff);
}
void StatusScreen::setStatusMessage(const char* message) {
CommandProcessor cmd;
cmd.cmd(CMD_DLSTART)
.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true));
draw_temperature(BACKGROUND);
draw_progress(BACKGROUND);
draw_axis_position(BACKGROUND);
draw_status_message(BACKGROUND, message);
draw_interaction_buttons(BACKGROUND);
storeBackground();
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("New status message: ", message);
#endif
if (AT_SCREEN(StatusScreen)) {
current_screen.onRefresh();
}
}
void StatusScreen::loadBitmaps() {
// Load the bitmaps for the status screen
using namespace Theme;
constexpr uint32_t base = ftdi_memory_map::RAM_G;
CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon));
CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon));
CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon));
CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon));
// Load fonts for internationalization
#ifdef TOUCH_UI_USE_UTF8
load_utf8_data(base + UTF8_FONT_OFFSET);
#endif
}
void StatusScreen::onStartup() {
UIFlashStorage::initialize();
}
void StatusScreen::onRedraw(draw_mode_t what) {
if (what & FOREGROUND) {
draw_temperature(FOREGROUND);
draw_progress(FOREGROUND);
draw_axis_position(FOREGROUND);
draw_interaction_buttons(FOREGROUND);
}
}
void StatusScreen::onEntry() {
onRefresh();
}
void StatusScreen::onIdle() {
if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
onRefresh();
refresh_timer.start();
}
BaseScreen::onIdle();
}
bool StatusScreen::onTouchEnd(uint8_t tag) {
using namespace ExtUI;
switch (tag) {
case 3: GOTO_SCREEN(FilesScreen); break;
case 4:
if (isPrinting()) {
GOTO_SCREEN(TuneMenu);
} else {
GOTO_SCREEN(MainMenu);
}
break;
case 5: GOTO_SCREEN(TemperatureScreen); break;
case 6:
if (!isPrinting()) {
GOTO_SCREEN(MoveAxisScreen);
}
break;
default:
return true;
}
// If a passcode is enabled, the LockScreen will prevent the
// user from proceeding.
LockScreen::check_passcode();
return true;
}
#endif // TOUCH_UI_FTDI_EVE
|
petrzjunior/Marlin
|
Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp
|
C++
|
gpl-3.0
| 13,488
|
# dotfiles
My very own dotfiles.
|
porfiriopaiz/dotfiles
|
README.md
|
Markdown
|
gpl-3.0
| 33
|
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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.android.build.gradle.internal.dsl;
import com.android.annotations.NonNull;
import com.google.common.collect.Sets;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* DSL object for configuring per-language splits options.
* <p>
* <p>See <a href="http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits">APK Splits</a>.
*/
public class LanguageSplitOptions {
private boolean enable = false;
private boolean auto = false;
private Set<String> include;
/**
* Collection of include patterns.
*/
public Set<String> getInclude() {
return include;
}
public void setInclude(@NonNull List<String> list) {
include = Sets.newHashSet(list);
}
/**
* Adds an include pattern.
*/
public void include(@NonNull String... includes) {
if (include == null) {
include = Sets.newHashSet(includes);
return;
}
include.addAll(Arrays.asList(includes));
}
@NonNull
public Set<String> getApplicationFilters() {
return include == null || !enable ? new HashSet<String>() : include;
}
/**
* Returns true if splits should be generated for languages.
*/
public boolean isEnable() {
return enable;
}
/**
* enables or disables splits for language
*/
public void setEnable(boolean enable) {
this.enable = enable;
}
/**
* Returns whether to use the automatic discovery mechanism for supported languages (true) or
* the manual include list (false).
*
* @return true for automatic, false for manual mode.
*/
public boolean isAuto() {
return auto;
}
/**
* Sets whether the build system should determine the splits based on the "language-*" folders
* in the resources. If the auto mode is set to true, the include list will be ignored.
*
* @param auto true to automatically set the splits list based on the folders presence, false
* to use the include list.
*/
public void setAuto(boolean auto) {
this.auto = auto;
}
}
|
tranleduy2000/javaide
|
aosp/gradle/src/main/java/com/android/build/gradle/internal/dsl/LanguageSplitOptions.java
|
Java
|
gpl-3.0
| 2,810
|
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UIKeyBinding : LuaObject {
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int IsBound_s(IntPtr l) {
try {
UnityEngine.KeyCode a1;
checkEnum(l,1,out a1);
var ret=UIKeyBinding.IsBound(a1);
pushValue(l,true);
pushValue(l,ret);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int GetKeyCode_s(IntPtr l) {
try {
System.String a1;
checkType(l,1,out a1);
UnityEngine.KeyCode a2;
UIKeyBinding.Modifier a3;
var ret=UIKeyBinding.GetKeyCode(a1,out a2,out a3);
pushValue(l,true);
pushValue(l,ret);
pushValue(l,a2);
pushValue(l,a3);
return 4;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_keyCode(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
pushValue(l,true);
pushEnum(l,(int)self.keyCode);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_keyCode(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
UnityEngine.KeyCode v;
checkEnum(l,2,out v);
self.keyCode=v;
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_modifier(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
pushValue(l,true);
pushEnum(l,(int)self.modifier);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_modifier(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
UIKeyBinding.Modifier v;
checkEnum(l,2,out v);
self.modifier=v;
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_action(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
pushValue(l,true);
pushEnum(l,(int)self.action);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int set_action(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
UIKeyBinding.Action v;
checkEnum(l,2,out v);
self.action=v;
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static public int get_captionText(IntPtr l) {
try {
UIKeyBinding self=(UIKeyBinding)checkSelf(l);
pushValue(l,true);
pushValue(l,self.captionText);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
static public void reg(IntPtr l) {
getTypeTable(l,"UIKeyBinding");
addMember(l,IsBound_s);
addMember(l,GetKeyCode_s);
addMember(l,"keyCode",get_keyCode,set_keyCode,true);
addMember(l,"modifier",get_modifier,set_modifier,true);
addMember(l,"action",get_action,set_action,true);
addMember(l,"captionText",get_captionText,null,true);
createTypeMetatable(l,null, typeof(UIKeyBinding),typeof(UnityEngine.MonoBehaviour));
}
}
|
yongkangchen/poker-client
|
Assets/Runtime/Slua/LuaObject/Dll/Lua_UIKeyBinding.cs
|
C#
|
gpl-3.0
| 3,361
|
using System;
using System.Collections.Generic;
using Server;
using Server.Events;
using Server.Buff.Icons;
using Server.Items;
namespace Server.Spells.Bard
{
public class Inspire : AreaSpellsong
{
public static void Initialize()
{
EventSink.BeforeDamage += new BeforeDamageEventHandler( EventSink_BeforeDamage );
}
private static void EventSink_BeforeDamage( BeforeDamageEventArgs e )
{
if ( e.From == null )
return;
Inspire spellsong = Spellsong.GetEffectSpellsong<Inspire>( e.From );
if ( spellsong != null )
e.Amount = (int) ( e.Amount * ( 100 + spellsong.DamageModifier ) / 100 );
}
private static SpellInfo m_Info = new SpellInfo(
"Inspire", "Uus Por",
-1,
9002
);
public override BardMastery RequiredMastery { get { return BardMastery.Provocation; } }
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.25 ); } }
public override int RequiredMana { get { return 16; } }
public override int UpkeepCost { get { return 5; } }
public override BuffIcon BuffIcon { get { return BuffIcon.Inspire; } }
// You feel inspired by the bard's spellsong.
public override int StartEffectMessage { get { return 1115736; } }
public Inspire( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
{
}
public int DamageModifier { get; private set; }
protected override void AddMods(/*ISet<AosAttribute> mods,*/ ISet<StatMod> statMods)
{
int music, peace, provo, disco;
GetSkillBonus( out music, out peace, out provo, out disco );
int weaponDamage = 10 + 5 * ( music + provo ) + 3 * ( peace + disco );
//mods.Add( new AttributeMod(AosAttribute.WeaponDamage, weaponDamage));
int spellDamage = 4 + 2 * ( music + provo ) + peace + disco;
//mods.Add( new AttributeMod( MagicalAttribute.SpellDamage, spellDamage ) );
int attackChance = 4 + 2 * ( music + provo ) + peace + disco;
//mods.Add( new AttributeMod( MagicalAttribute.AttackChance, attackChance ) );
int damageModifier = Math.Max( 1, music * provo + Math.Max( music, provo ) + ( disco + peace ) / 2 );
this.DamageModifier = damageModifier;
this.BuffInfo = new BuffInfo( this.BuffIcon, 1115612, 1151951,
String.Format( "{0}\t{1}\t{2}\t{3}", weaponDamage, spellDamage, attackChance, DamageModifier ), false );
}
}
}
|
GenerationOfWorlds/GOW
|
Scripts/Core/Stygian Abyss/Magic/Bard Masteries/Inspire.cs
|
C#
|
gpl-3.0
| 2,339
|
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TextEditorNew
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.ForeColor = System.Drawing.Color.White
Me.Label1.Location = New System.Drawing.Point(201, 9)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(38, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Save?"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(42, 47)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Save"
Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(180, 47)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 2
Me.Button2.Text = "Don't save"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(325, 47)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(75, 23)
Me.Button3.TabIndex = 3
Me.Button3.Text = "Cancel"
Me.Button3.UseVisualStyleBackColor = True
'
'TextEditorNew
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.ActiveCaptionText
Me.ClientSize = New System.Drawing.Size(436, 97)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "TextEditorNew"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Clear document without saving?"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
End Class
|
mattiemonster/fireplace
|
Fireplace/Apps/TextEditorNew.Designer.vb
|
Visual Basic
|
gpl-3.0
| 3,432
|
import DS from 'ember-data';
export default DS.LSAdapter.extend({
namespace: 'bateria_namespace'
});
|
hugoruscitti/bateria
|
app/adapters/application.js
|
JavaScript
|
gpl-3.0
| 105
|
'use strict'
const config = {
development: './env/dev',
production: './env/prod',
test: './env/test'
}
const { NODE_ENV = 'development' } = process.env
module.exports = require(config[NODE_ENV])
|
calebgregory/node-testing-with-mocha-chai
|
config/index.js
|
JavaScript
|
gpl-3.0
| 204
|
/*
* This file is part of MultiOSD <https://github.com/UncleRus/MultiOSD>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UAVTALK_LP1609RC1_GPSPOSITIONSENSOR_H
#define UAVTALK_LP1609RC1_GPSPOSITIONSENSOR_H
#include "../common.h"
UT_NAMESPACE_OPEN
namespace lp1609rc1
{
#define UAVTALK_LP1609RC1_GPSPOSITIONSENSOR_OBJID 0x9DF1F67A
enum GPSPositionSensorStatus
{
GPSPOSITIONSENSOR_STATUS_NOGPS = 0,
GPSPOSITIONSENSOR_STATUS_NOFIX = 1,
GPSPOSITIONSENSOR_STATUS_FIX2D = 2,
GPSPOSITIONSENSOR_STATUS_FIX3D = 3
};
enum GPSPositionSensorSensorType
{
GPSPOSITIONSENSOR_SENSORTYPE_UNKNOWN = 0,
GPSPOSITIONSENSOR_SENSORTYPE_NMEA = 1,
GPSPOSITIONSENSOR_SENSORTYPE_UBX = 2,
GPSPOSITIONSENSOR_SENSORTYPE_UBX7 = 3,
GPSPOSITIONSENSOR_SENSORTYPE_UBX8 = 4,
GPSPOSITIONSENSOR_SENSORTYPE_DJI = 5
};
enum GPSPositionSensorAutoConfigStatus
{
GPSPOSITIONSENSOR_AUTOCONFIGSTATUS_DISABLED = 0,
GPSPOSITIONSENSOR_AUTOCONFIGSTATUS_RUNNING = 1,
GPSPOSITIONSENSOR_AUTOCONFIGSTATUS_DONE = 2,
GPSPOSITIONSENSOR_AUTOCONFIGSTATUS_ERROR = 3
};
enum GPSPositionSensorBaudRate
{
GPSPOSITIONSENSOR_BAUDRATE_2400 = 0,
GPSPOSITIONSENSOR_BAUDRATE_4800 = 1,
GPSPOSITIONSENSOR_BAUDRATE_9600 = 2,
GPSPOSITIONSENSOR_BAUDRATE_19200 = 3,
GPSPOSITIONSENSOR_BAUDRATE_38400 = 4,
GPSPOSITIONSENSOR_BAUDRATE_57600 = 5,
GPSPOSITIONSENSOR_BAUDRATE_115200 = 6,
GPSPOSITIONSENSOR_BAUDRATE_230400 = 7,
GPSPOSITIONSENSOR_BAUDRATE_UNKNOWN = 8
};
struct GPSPositionSensor
{
int32_t Latitude;
int32_t Longitude;
float Altitude;
float GeoidSeparation;
float Heading;
float Groundspeed;
float PDOP;
float HDOP;
float VDOP;
GPSPositionSensorStatus Status;
int8_t Satellites;
GPSPositionSensorSensorType SensorType;
GPSPositionSensorAutoConfigStatus AutoConfigStatus;
GPSPositionSensorBaudRate BaudRate;
};
} // namespace lp1609rc1
UT_NAMESPACE_CLOSE
#endif // UAVTALK_LP1609RC1_GPSPOSITIONSENSOR_H
|
UncleRus/MultiOSD
|
firmware/telemetry/uavtalk/lib/lp1609rc1/gpspositionsensor.h
|
C
|
gpl-3.0
| 2,610
|
/*
* QuarkPlayer, a Phonon media player
* Copyright (C) 2008-2011 Tanguy Krotoff <tkrotoff@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "WebBrowser.h"
#include "TkTextBrowser.h"
#include "WebBrowserLogger.h"
#include <TkUtil/LanguageChangeEventFilter.h>
#ifdef WEBKIT
#include <QtWebKit/QtWebKit>
#endif //WEBKIT
#include <QtGui/QtGui>
#include <QtCore/QCoreApplication>
#include <QtCore/QUrl>
/** Detects if _homeHtml should be used or not inside WebBrowser::home(). */
static const char * HOME_HTML_INVALID = "INVALID";
WebBrowser::WebBrowser(QWidget * parent)
: QWidget(parent) {
populateActionCollection();
QVBoxLayout * layout = new QVBoxLayout();
setLayout(layout);
layout->setMargin(0);
layout->setSpacing(0);
_toolBar = new QToolBar();
_toolBar->setIconSize(QSize(16, 16));
_toolBar->addAction(_actions["WebBrowser.Backward"]);
_toolBar->addAction(_actions["WebBrowser.Forward"]);
_toolBar->addAction(_actions["WebBrowser.Reload"]);
_toolBar->addAction(_actions["WebBrowser.Stop"]);
_toolBar->addAction(_actions["WebBrowser.Home"]);
layout->addWidget(_toolBar);
_urlLineEdit = new QLineEdit();
_toolBar->addWidget(_urlLineEdit);
//Do not use QLineEdit::editingFinished() since it will trigger go()
//even with QLineEdit::setText()
connect(_urlLineEdit, SIGNAL(returnPressed()), SLOT(go()));
_toolBar->addAction(_actions["WebBrowser.Go"]);
connect(_actions["WebBrowser.Go"], SIGNAL(triggered()), SLOT(go()));
_toolBar->addAction(_actions["WebBrowser.OpenBrowser"]);
connect(_actions["WebBrowser.OpenBrowser"], SIGNAL(triggered()), SLOT(openExternalWebBrowser()));
#ifdef WEBKIT
_webView = new QWebView();
layout->addWidget(_webView);
connect(_webView, SIGNAL(urlChanged(const QUrl &)), SLOT(urlChanged(const QUrl &)));
connect(_webView, SIGNAL(urlChanged(const QUrl &)), SLOT(historyChanged()));
connect(_actions["WebBrowser.Backward"], SIGNAL(triggered()), _webView, SLOT(back()));
connect(_actions["WebBrowser.Forward"], SIGNAL(triggered()), _webView, SLOT(forward()));
connect(_actions["WebBrowser.Reload"], SIGNAL(triggered()), _webView, SLOT(reload()));
connect(_actions["WebBrowser.Home"], SIGNAL(triggered()), SLOT(home()));
connect(_actions["WebBrowser.Stop"], SIGNAL(triggered()), _webView, SLOT(stop()));
#else
_textBrowser = new TkTextBrowser();
layout->addWidget(_textBrowser);
connect(_textBrowser, SIGNAL(sourceChanged(const QUrl &)), SLOT(urlChanged(const QUrl &)));
connect(_textBrowser, SIGNAL(historyChanged()), SLOT(historyChanged()));
connect(_actions["WebBrowser.Backward"], SIGNAL(triggered()), _textBrowser, SLOT(backward()));
connect(_actions["WebBrowser.Forward"], SIGNAL(triggered()), _textBrowser, SLOT(forward()));
connect(_actions["WebBrowser.Reload"], SIGNAL(triggered()), _textBrowser, SLOT(reload()));
connect(_actions["WebBrowser.Home"], SIGNAL(triggered()), SLOT(home()));
//QTextBrowser cannot stops current rendering, multithreaded?
//connect(_actions["WebBrowser.Stop"], SIGNAL(triggered()), _textBrowser, SLOT(stop()));
_actions["WebBrowser.Stop"]->setEnabled(false);
#endif //WEBKIT
//Initializes the backward and forward QAction
setBackActionToolTip();
setForwardActionToolTip();
RETRANSLATE(this);
retranslate();
}
WebBrowser::~WebBrowser() {
}
void WebBrowser::populateActionCollection() {
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);
_actions.add("WebBrowser.Backward", new QAction(app));
_actions.add("WebBrowser.Forward", new QAction(app));
_actions.add("WebBrowser.Reload", new QAction(app));
_actions.add("WebBrowser.Stop", new QAction(app));
_actions.add("WebBrowser.Home", new QAction(app));
_actions.add("WebBrowser.Go", new QAction(app));
_actions.add("WebBrowser.OpenBrowser", new QAction(app));
}
void WebBrowser::retranslate() {
_actions["WebBrowser.Backward"]->setText(tr("Back"));
_actions["WebBrowser.Backward"]->setIcon(QIcon::fromTheme("go-previous"));
_actions["WebBrowser.Forward"]->setText(tr("Forward"));
_actions["WebBrowser.Forward"]->setIcon(QIcon::fromTheme("go-next"));
_actions["WebBrowser.Reload"]->setText(tr("Reload"));
_actions["WebBrowser.Reload"]->setIcon(QIcon::fromTheme("view-refresh"));
_actions["WebBrowser.Stop"]->setText(tr("Stop"));
_actions["WebBrowser.Stop"]->setIcon(QIcon::fromTheme("process-stop"));
_actions["WebBrowser.Home"]->setText(tr("Home"));
_actions["WebBrowser.Home"]->setIcon(QIcon::fromTheme("go-home"));
_actions["WebBrowser.Go"]->setText(tr("Go"));
_actions["WebBrowser.Go"]->setIcon(QIcon::fromTheme("go-jump-locationbar"));
_actions["WebBrowser.OpenBrowser"]->setText(tr("Open External Browser"));
_actions["WebBrowser.OpenBrowser"]->setIcon(QIcon::fromTheme("internet-web-browser"));
}
void WebBrowser::setHtml(const QString & html) {
if (_homeHtml.isEmpty()) {
_homeHtml = html;
}
#ifdef WEBKIT
_webView->setHtml(html);
#else
_textBrowser->setHtml(html);
#endif //WEBKIT
}
void WebBrowser::setUrl(const QUrl & url) {
if (_homeUrl.isEmpty()) {
_homeUrl = url.toString();
_actions["WebBrowser.Home"]->setToolTip(_homeUrl);
_homeHtml = HOME_HTML_INVALID;
}
#ifdef WEBKIT
_webView->setUrl(url);
#else
_textBrowser->setSource(url);
#endif //WEBKIT
}
void WebBrowser::setUrlLineEdit(const QString & url) {
if (_homeUrl.isEmpty()) {
_homeUrl = url;
_actions["WebBrowser.Home"]->setToolTip(_homeUrl);
}
_urlLineEdit->setText(url);
}
void WebBrowser::clear() {
setUrl(QString());
setHtml(QString());
}
void WebBrowser::go() {
QString url(_urlLineEdit->text());
/*Don't do that: url line edit can contain a simple text
that is not a URL
if (!url.contains("http://") &&
!url.contains("file://") &&
!url.contains("://")) {
url.prepend("http://");
}*/
setUrl(url);
}
void WebBrowser::setBackActionToolTip() {
QString title;
#ifdef WEBKIT
title = _webView->history()->backItem().title();
#else
title = _textBrowser->historyTitle(-1);
#endif //WEBKIT
_actions["WebBrowser.Backward"]->setEnabled(!title.isEmpty());
_actions["WebBrowser.Backward"]->setToolTip(title);
}
void WebBrowser::setForwardActionToolTip() {
QString title;
#ifdef WEBKIT
title = _webView->history()->forwardItem().title();
#else
title = _textBrowser->historyTitle(+1);
#endif //WEBKIT
_actions["WebBrowser.Forward"]->setEnabled(!title.isEmpty());
_actions["WebBrowser.Forward"]->setToolTip(title);
}
void WebBrowser::urlChanged(const QUrl & url) {
_urlLineEdit->setText(url.toString());
}
void WebBrowser::historyChanged() {
setBackActionToolTip();
setForwardActionToolTip();
}
void WebBrowser::openExternalWebBrowser() {
QDesktopServices::openUrl(QUrl::fromPercentEncoding(_urlLineEdit->text().toAscii()));
}
void WebBrowser::home() {
if (_homeHtml == HOME_HTML_INVALID) {
setUrl(_homeUrl);
} else {
setUrlLineEdit(_homeUrl);
setHtml(_homeHtml);
}
}
|
tkrotoff/QuarkPlayer
|
libs/WebBrowser/WebBrowser.cpp
|
C++
|
gpl-3.0
| 7,469
|