Skip to content

Instantly share code, notes, and snippets.

View kevinw's full-sized avatar

Kevin Watters kevinw

View GitHub Profile
def logistic(x, mu = 9):
'Smoothing function (s curve).'
return 1 - 1 /( 1 + math_e ** ((x - 1/2) * mu))
bool wxTopLevelWindowMSW::Show(bool show)
{
// don't use wxWindow version as we want to call DoShowWindow() ourselves
if ( !wxWindowBase::Show(show) )
return false;
int nShowCmd;
if ( show )
{
if ( m_maximizeOnShow )
> wxwebkit.dll!WebCore::ContainerNode::attach() Line 652 + 0xa bytes C++
wxwebkit.dll!WebCore::Element::attach() Line 719 C++
wxwebkit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 761 C++
wxwebkit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 822 C++
wxwebkit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 822 C++
wxwebkit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 822 C++
wxwebkit.dll!WebCore::Document::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 1140 C++
wxwebkit.dll!WebCore::Document::updateRendering() Line 1168 C++
wxwebkit.dll!WebCore::Document::updateLayout() Line 1196 C++
wxwebkit.dll!WebCore::Document::updateLayoutIgnorePendingStylesheets() Line 1231 C++
cl /c /nologo /TP /Fovc_mswuhdll\coredll_graphicc.obj /MD /DWIN32 /Fd
..\..\lib\vc_dll\wxmsw28uh_core_vc.pdb /O2 /D__WXMSW__ /DwxNO_EXCEPTIONS
/D_UNICODE /DwxUSE_GRAPHICS_CONTEXT=1 /I..\..\lib\vc_dll\mswuh /I..\..\inclu
de /I..\..\external\cairo-dev\include\cairo /W4 /I..\..\src\tiff /I..\..\src\j
peg /I..\..\src\png /I..\..\src\zlib /I..\..\src\regex /I..\..\src\expat\lib /D
WXUSINGDLL /DWXMAKINGDLL_CORE /DwxUSE_BASE=0 /GR /Yu"wx/wxprec.h" /Fp"vc_mswu
hdll\wxprec_coredll.pch" /GS- /Zi /GL ..\..\src\generic\graphicc.cpp
graphicc.cpp
..\..\src\generic\graphicc.cpp(852) : warning C4100: 'fillStyle' : unreferenced
formal parameter
GdiPlus.dll!DpOutputBilinearSpan_Identity::OutputSpan() + 0x4692f bytes
GdiPlus.dll!DpClipRegion::OutputSpan() + 0x69 bytes
GdiPlus.dll!StretchBitsMainLoop() + 0x32 bytes
GdiPlus.dll!DpDriver::DrawImage() + 0x305 bytes
GdiPlus.dll!GpGraphics::DrvDrawImage() - 0x877 bytes
GdiPlus.dll!GpGraphics::DrawImage() - 0x47e bytes
GdiPlus.dll!GpGraphics::DrawImage() + 0x4d bytes
GdiPlus.dll!GpGraphics::DrawImage() + 0x2c bytes
GdiPlus.dll!_GdipDrawImageRect@24() + 0x241e2 bytes
> wxmsw28uh_core_vc.dll!wxGDIPlusContext::DrawBitmap(const wxGraphicsBitmap & bmp={...}, double x=-68.000000000000000, double y=498.00000000000000, double w=640.00000000000000, double h=480.00000000000000) Line 1178 + 0x51 bytes C++
bool ThreadCondition::timedWait(Mutex& mutex, double secondsToWait)
{
if (secondsToWait < 0.0) {
wait(mutex);
return true;
}
int intervalSeconds = static_cast<int>(secondsToWait);
int intervalMicroseconds = static_cast<int>((secondsToWait - intervalSeconds) * 1000000.0);
class ScreenHDC
{
public:
ScreenHDC() { m_hdc = ::GetDC(NULL); }
~ScreenHDC() { ::ReleaseDC(NULL, m_hdc); }
operator HDC() const { return m_hdc; }
private:
HDC m_hdc;
void Layer::renderContent(GraphicsContext* cr)
{
ANIM_ASSERT(isPresentation());
cairo_surface_t* contents = modelLayer()->contents();
if (0 && contents) {
ANIM_ASSERT(cairo_surface_status(contents) == CAIRO_STATUS_SUCCESS);
cairo_set_source_surface(cr, contents, 0, 0);
cairo_rectangle(cr, 0, 0, cairo_image_surface_get_width(contents), cairo_image_surface_get_height(contents));

web content in growl-like popup notifications

On Mac, Growl has a WebKit backend. I want web content in notification popups (or toasts, or bubbles, or whatever you want to call them) on Windows. Chrome as a Prism-killer would be a lot more compelling if webapps could sit in the system tray and be able to notify the user via fully interactive nicely skinned (glass, transparency, etc) JS/CSS toasts.

From contributing bits and pieces to wxWebKit I know my way around WebKit, and I know it has the ability to render transparent pages (see the mac Dashboard). What I'm not sure about is how such an idea would be implemented in Chrome's architecture.

My initial thought was that a slim process would sit in the tray and use chrome.dll to do the rendering. I realize Chrome already has complex notions about multiprocess rendering, so I don't quite know how such a scheme would work--would growl-win.exe spawn a chrome.exe just like the real browser, or is chrome.dll

from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from functools import partial
from StringIO import StringIO
import os.path
import pstats
import sys
import re
import threading
import traceback
import time