This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ProxyHandler.cpp | |
* fbplugin | |
* | |
* Copyright Facebook, inc | |
*/ | |
#include "HTTPClient/HTTPRequest.h" | |
#include <boost/algorithm/string.hpp> | |
#include <boost/assign/list_of.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nick = 'taxTestBot' | |
host = 'irc.freenode.net' | |
channels = ['#2600hz_bottest'] | |
owner = 'steph021' | |
password = 'F!reB0T!' | |
# These are people who will be able to use admin.py's functions... | |
admins = [owner, 'pyite'] | |
# But admin.py is disabled by default, as follows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show(self, show_name, doc_id, **params): | |
""" Execute a show function on the server and return the response. | |
If the response is json it will be deserialized, otherwise the string | |
will be returned. | |
Args: | |
@param show_name: should be 'designname/showname' | |
@param doc_id: id of the document to pass into the show document | |
@param params: params of the show | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "json.h" | |
FB::variant jsonValueToVariant( Json::Value root ) | |
{ | |
Json::Value def; | |
if (root.isString()) | |
return root.asString(); | |
else if (root.isBool()) | |
return root.asBool(); | |
else if (root.isDouble()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void *EventLoop(void *args) | |
{ | |
int state; | |
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &state); | |
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &state); | |
// In one thread run the event loop to get hotkey presses | |
EventHotKeyID gMyHotKeyID1, gMyHotKeyID2; | |
EventTypeSpec eventType; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void PluginObject::drawImage(FB::PluginWindow *wnd, FB::PluginEvent* evt, unsigned char *img, int width, int height) { | |
HDC hdc=NULL; | |
BITMAPINFO bitmapInfo; | |
bitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); | |
bitmapInfo.bmiHeader.biBitCount=32; | |
bitmapInfo.bmiHeader.biCompression=BI_RGB; | |
bitmapInfo.bmiHeader.biPlanes = 1; | |
bitmapInfo.bmiHeader.biSizeImage = width*height*4; | |
bitmapInfo.bmiHeader.biWidth = width; |
These instructions were tested on Windows 7 Professional w/ Visual Studio 2010
- Download the latest openssl from the website; at the time of this writing, it is 1.0.0d
- Extract it to your drive; I put it in c:\code\openssl-1.0.0d
- install ActiveState perl unless you already have a non-cygwin perl installed on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Platform independent | |
#include "BitBlitter.h" | |
#include "precompiled_headers.h" // Anything before this is PCH on windows | |
bool BitBlitter::onWindowRefresh( FB::RefreshEvent *evt, FB::PluginWindow *win ) | |
{ | |
boost::mutex::scoped_lock _l(preview_mutex); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string wstring_to_utf8(const std::wstring& src) { | |
std::string out_str; | |
#ifdef _WIN32 | |
utf8::utf16to8(src.begin(), src.end(), std::back_inserter(out_str)); | |
#else | |
utf8::utf32to8(src.begin(), src.end(), std::back_inserter(out_str)); | |
#endif | |
return out_str; | |
} |
OlderNewer