void IStyleEngine.StyleAt(int Index, ref style_info Style) { string toBeRegisteredVoices = ""; foreach (InstalledVoice voice in vox.GetInstalledVoices()) { toBeRegisteredVoices += voice.VoiceInfo.Name + "|"; numberOfVoices++; } if (toBeRegisteredVoices.Length > 0) { toBeRegisteredVoices = toBeRegisteredVoices.Substring(0, toBeRegisteredVoices.Length - 1); } string pathToIcon = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\sayHello.ico"; pathToIcon = pathToIcon.Replace("file:\\", ""); Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS | S_STYLE_FLAGS.S_STYLE_IS_CONFIGURABLE; Style.IconPath = pathToIcon; Style.Major = Assembly.GetExecutingAssembly().GetName().Version.Major; Style.Minor = Assembly.GetExecutingAssembly().GetName().Version.Minor; Style.Name = "Say Hello"; Style.Path = Assembly.GetExecutingAssembly().CodeBase; Style.Schemes = toBeRegisteredVoices; Style.Copyright = "Tlhan Ghun"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://tlhan-ghun.de/"; Style.Description = "Speaks the title and the text"; }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { string pathToIcon = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\mailMe.ico"; pathToIcon = pathToIcon.Replace("file:\\", ""); Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS | S_STYLE_FLAGS.S_STYLE_IS_CONFIGURABLE; Style.IconPath = pathToIcon; Style.Major = Assembly.GetExecutingAssembly().GetName().Version.Major; Style.Minor = Assembly.GetExecutingAssembly().GetName().Version.Minor; Style.Name = "Mail me"; Style.Path = Assembly.GetExecutingAssembly().CodeBase; Style.Schemes = "Default"; Style.Copyright = "Tlhan Ghun"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://tlhan-ghun.de/"; Style.Description = "Sends the notification using email"; }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { string pathToIcon = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\blueBird.png"; pathToIcon = pathToIcon.Replace("file:\\", ""); Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS; Style.IconPath = pathToIcon; Style.Major = 1; Style.Minor = 1; Style.Name = "Tweet it"; Style.Path = Assembly.GetExecutingAssembly().CodeBase; Style.Schemes = "Standard"; Style.Copyright = "Tlhan Ghun"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://tlhan-ghun.de/"; Style.Description = "This style forwards your notification to your Twitter account as tweet. Your credential will be asked for on first usage automatically"; }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { string pathToIcon = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase) + "\\someImageName.png"; pathToIcon = pathToIcon.Replace("file:\\", ""); // we create a windowless one in this example Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS; Style.IconPath = pathToIcon; Style.Major = 1; Style.Minor = 0; Style.Name = "My style"; Style.Path = System.Reflection.Assembly.GetExecutingAssembly().CodeBase; Style.Schemes = "Standard"; Style.Copyright = "Your anem"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://example.com/"; Style.Description = "This my first Snarl style - it just opens a message box"; }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { string pathToIcon = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\hover.ico"; pathToIcon = pathToIcon.Replace("file:\\", ""); Style.Flags = S_STYLE_FLAGS.S_STYLE_SINGLE_INSTANCE; Style.IconPath = pathToIcon; Style.Major = Assembly.GetExecutingAssembly().GetName().Version.Major; Style.Minor = Assembly.GetExecutingAssembly().GetName().Version.Minor; Style.Name = "Hover"; Style.Path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Substring(6); Style.Schemes = "Icon only|Title|Text|Meter"; Style.Copyright = "Tlhan Ghun 2010"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://tlhan-ghun.de/"; Style.Description = "Shows a semitransparent rectangle on the center of the screen"; }
// Sweeps one scanline with one style index. The style ID can be // determined by calling style(). //template<class Scanline> public bool sweep_scanline(IScanlineCache sl, int style_idx) { int scan_y = m_scan_y - 1; if (scan_y > m_Rasterizer.max_y()) { return(false); } sl.ResetSpans(); int master_alpha = aa_mask; if (style_idx < 0) { style_idx = 0; } else { style_idx++; master_alpha = m_master_alpha[(int)(m_ast[(int)style_idx] + m_min_style - 1)]; } style_info st = m_styles[m_ast[style_idx]]; int num_cells = (int)st.num_cells; int CellOffset = st.start_cell; cell_aa cell = m_cells[CellOffset]; int cover = 0; while (num_cells-- != 0) { int alpha; int x = cell.x; int area = cell.area; cover += cell.cover; cell = m_cells[++CellOffset]; if (area != 0) { alpha = calculate_alpha((cover << (poly_subpixel_shift + 1)) - area, master_alpha); sl.add_cell(x, alpha); x++; } if (num_cells != 0 && cell.x > x) { alpha = calculate_alpha(cover << (poly_subpixel_shift + 1), master_alpha); if (alpha != 0) { sl.add_span(x, cell.x - x, alpha); } } } if (sl.num_spans() == 0) { return(false); } sl.finalize(scan_y); return(true); }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { string pathToIcon = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\runMe.ico"; pathToIcon = pathToIcon.Replace("file:\\", ""); Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS | S_STYLE_FLAGS.S_STYLE_IS_CONFIGURABLE; Style.IconPath = pathToIcon; Style.Major = Assembly.GetExecutingAssembly().GetName().Version.Major; Style.Minor = Assembly.GetExecutingAssembly().GetName().Version.Minor; Style.Name = "Run me"; Style.Path = Assembly.GetExecutingAssembly().CodeBase; Style.Schemes = "System execute|Open webpage|HTTP Get|HTTP Put"; Style.Copyright = "Tlhan Ghun"; Style.SupportEmail = "*****@*****.**"; Style.URL = "http://tlhan-ghun.de/"; Style.Description = "Executes commands or HTTP-requests on Snarl notifications"; }
void IStyleEngine.StyleAt(int Index, ref style_info Style) { if (Index == -1) { // don't ask... Style.Name = this.lastRedirect; } else if (Index == 0) { // return info about the engine Style.Name = "NetRedirect"; Style.IconPath = Path.Combine(this.bootPath, "icon.png"); Style.Date = LIB_DATE; Style.Major = LIB_VERSION; Style.Minor = LIB_REVISION; } else { Redirect item = loadedStyles[Index - 1]; if (item != null) { RedirectInfo info = item.GetInfo(); Style.Copyright = info.vendorCopyright; Style.Date = info.date; Style.Description = info.description; Style.Flags = S_STYLE_FLAGS.S_STYLE_IS_WINDOWLESS | S_STYLE_FLAGS.S_STYLE_V42_CONTENT; if (info.isConfigurable) Style.Flags = Style.Flags | S_STYLE_FLAGS.S_STYLE_IS_CONFIGURABLE; if (info.supportsWebAdmin) Style.Flags = Style.Flags + 0x2000; // S_STYLE_SUPPORTS_WEB_ADMIN if (info.isWebRedirect) Style.Flags = Style.Flags + 0x8000; // S_STYLE_WEB_REDIRECT (R4.0) Style.Major = info.versionMajor; Style.Minor = info.versionMinor; Style.Name = info.name; Style.Path = Path.Combine(this.redirectsPath, item.BaseName); // Style.Path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), // "full phat\\snarl\\redirects.net", item.baseName); string schemeList = ""; foreach (KeyValuePair<string, string> scheme in info.schemes) { schemeList += scheme.Key + "=" + scheme.Value + "|"; } Style.Schemes = schemeList.TrimEnd('|'); Style.SupportEmail = info.vendorEmail; Style.URL = info.vendorURL; // do after setting .Path! Style.IconPath = Path.Combine(Style.Path, "icon.png"); } else { // invalid index Style.Name = "???notfound???"; } } }