public ImageSource TryGetImage(IconId iconId, IconTheme theme, IThemedIconManagerPerThemeCache cache, OnError onerror)
        {
            var emojiIconId = iconId as EmojiIconId;

            var image = emojiIconId?.Emoji.Bitmap();
            return image;
        }
 public override int CompareTo(IconId otherRaw)
 {
     EmojiIconId imageSourceIconId = otherRaw as EmojiIconId;
     if (imageSourceIconId == null)
         return string.Compare(GetType().Name, otherRaw.GetType().Name, StringComparison.Ordinal);
     return string.Compare(Emoji.Name, imageSourceIconId.Emoji.Name, StringComparison.InvariantCultureIgnoreCase);
 }
        public AbbreviatedTextLookupItem(string text, CodeCompletionContext context, IconId image)
            : base(text, image, true)
        {
            this.context = context;

            // When dealing with dynamic items providers, static items are simply merged into the list
            // on each keystroke. If the dynamic item provider adds dynamic items, the merging happens
            // like this:
            // 1. Get a list of existing dynamic items
            // 2. Remove any items that fail ILookupItem.Match
            // 3. Retrieve the item's BaseDynamicRule.PrefixKey value. If it exists and is longer
            //    than the current prefix, remove it
            //    (I'm not sure on the reason for this, perhaps to handle deleting chars in the prefix?)
            // 4. Loop over the new items
            //    a. If the item is ITextualLookupItem and has a BaseDynamicRule.PrefixKey value, look
            //       for the name in the (filtered) list of previous dynamic results. If it exists,
            //       don't add a new item
            //    b. Otherwise, add the item
            //
            // So, static items are always added and never removed. Dynamic items are only merged if
            // they are ITextualLookupItem and have a BaseDynamicRule.PrefixKey value. Dynamic items
            // are removed if they are ITextualLookupItem and their PrefixKey value is longer than
            // the current prefix, presumably when the prefix has chars deleted
            //
            // Which means, to allow us to remove dynamic items on each keystroke, even when adding
            // chars to the prefix, we need a dynamic item that implements ITextualLookupItem and
            // that has a really long PrefixKey value. This is a hack.
            PutData(BaseDynamicRule.PrefixKey, "really_long_string_that_shouldnt_match_so_that_the_item_is_removed");
        }
		public void AddMessage (string msg, IconId icon)
		{
			if (lastImage != null) {
				HSeparator sep = new HSeparator ();
				sep.Show ();
				msgBox.PackStart (sep, false, false, 0);
				lastImage.IconSize = Gtk.IconSize.Menu;
			}
			
			HBox box = new HBox ();
			box.Spacing = 12;
			Alignment imgBox = new Alignment (0, 0, 0, 0);
			var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
			imgBox.Add (img);
			lastImage = img;
			box.PackStart (imgBox, false, false, 0);
			Label lab = new Label (msg);
			lab.UseUnderline = false;
			lab.Xalign = 0;
			lab.Yalign = 0;
			lab.Wrap = true;
			lab.WidthRequest = 500;
			box.PackStart (lab, true, true, 0);
			msgBox.PackStart (box, false, false, 0);
			box.ShowAll ();
		}
		internal CommandInfo (Command cmd)
		{
			text = cmd.Text;
			icon = cmd.Icon;
			accelKey = cmd.AccelKey;
			description = cmd.Description;
		}
		public CompletionData (string displayText, IconId icon, string description, string completionText)
		{
			this.DisplayText = displayText;
			this.Icon = icon;
			this.Description = description;
			this.CompletionText = completionText;
		}
 public ZenSharpLookupItem(Template template, GenerateTree tree, IEnumerable<string> scopes, IconId iconId)
     : base(null, template, true)
 {
     _tree = tree;
     _scopes = scopes;
     _template = template;
     // fixme: what is it?
     Log.Info("Creating ZenSharpLookupItem with template = {0}", template);
     _iconId = iconId;
     _displayName = _template.Text;
 }
		public BackgroundProgressMonitor (string title, IconId iconName)
		{
			this.title = title;
			if (!iconName.IsNull) {
				Application.Invoke (delegate {
					Gdk.Pixbuf img = ImageService.GetPixbuf (iconName, IconSize.Menu);
					icon = IdeApp.Workbench.StatusBar.ShowStatusIcon (img);
					if (icon == null)
						LoggingService.LogError ("Icon '" + iconName + "' not found.");
				});
			}
		}
		void Update (CommandInfo cmdInfo)
		{
			updating = true;
			Label = cmdInfo.Text;
			if (cmdInfo.Icon != stockId) {
				stockId = cmdInfo.Icon;
				this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
			}
			Sensitive = cmdInfo.Enabled;
			Visible = cmdInfo.Visible;
			Active = cmdInfo.Checked;
			updating = false;
		}
Beispiel #10
0
		public void ShowMessage (IconId iconId, string message, bool isMarkup)
		{
			Message = message;
			StatusText.ToolTip = message;

			if (iconId.IsNull)
				iconId = BrandingService.StatusSteadyIconId;

			// don't reload same icon
			if (currentIcon == iconId)
				return;

			currentIcon = iconId;

			if (xwtAnimation != null) {
				xwtAnimation.Dispose ();
				xwtAnimation = null;
			}

			if (ImageService.IsAnimation (currentIcon, Gtk.IconSize.Menu)) {
				animatedIcon = ImageService.GetAnimatedIcon (currentIcon, Gtk.IconSize.Menu);
				StatusImage = animatedIcon.FirstFrame;
				xwtAnimation = animatedIcon.StartAnimation (p => {
					StatusImage = p;
				});
			} else
				StatusImage = currentIcon.GetStockIcon ().WithSize (Xwt.IconSize.Small);
		}
		void Update (CommandInfo cmdInfo)
		{
			lastCmdInfo = cmdInfo;
			if (isArray && !isArrayItem) {
				this.Visible = false;
				Gtk.Menu menu = (Gtk.Menu) Parent;  
				
				if (itemArray != null) {
					foreach (Gtk.MenuItem item in itemArray)
						menu.Remove (item);
				}
				
				itemArray = new ArrayList ();
				int i = Array.IndexOf (menu.Children, this);
				
				if (cmdInfo.ArrayInfo != null) {
					foreach (CommandInfo info in cmdInfo.ArrayInfo) {
						Gtk.MenuItem item;
						if (info.IsArraySeparator) {
							item = new Gtk.SeparatorMenuItem ();
							item.Show ();
						} else {
							item = CommandEntry.CreateMenuItem (commandManager, commandId, false);
							ICommandMenuItem mi = (ICommandMenuItem) item; 
							mi.SetUpdateInfo (info, initialTarget);
						}
						menu.Insert (item, ++i);
						itemArray.Add (item);
					}
				}
			} else {
				Gtk.Widget child = Child;
				if (child == null)
					return;
				
				Gtk.Label accel_label = null;
				Gtk.Label label = null;
				
				if (!(child is Gtk.HBox)) {
					child = new Gtk.HBox (false, 0);
					accel_label = new Gtk.Label ("");
					accel_label.UseUnderline = false;
					accel_label.Xalign = 1.0f;
					accel_label.Show ();
					
					label = new Gtk.Label ("");
					label.UseUnderline = true;
					label.Xalign = 0.0f;
					label.Show ();
					
					((Gtk.Box) child).PackStart (label);
					((Gtk.Box) child).PackStart (accel_label);
					child.Show ();
					
					this.Remove (Child);
					this.Add (child);
				} else {
					accel_label = (Gtk.Label) ((Gtk.Box) child).Children[1];
					label = (Gtk.Label) ((Gtk.Box) child).Children[0];
				}
				
				if (cmdInfo.AccelKey != null)
					accel_label.Text = "    " + KeyBindingManager.BindingToDisplayLabel (cmdInfo.AccelKey, true);
				else
					accel_label.Text = String.Empty;
				
				if (cmdInfo.UseMarkup) {
					label.Markup = overrideLabel ?? cmdInfo.Text;
					label.UseMarkup = true;
				} else {
					label.Text = overrideLabel ?? cmdInfo.Text;
					label.UseMarkup = false;
				}
				
				label.UseUnderline = true;
				
				this.Sensitive = cmdInfo.Enabled;
				this.Visible = cmdInfo.Visible && (disabledVisible || cmdInfo.Enabled);
				
				if (!cmdInfo.Icon.IsNull && cmdInfo.Icon != lastIcon) {
					Image = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
					lastIcon = cmdInfo.Icon;
				}
				
				if (cmdInfo is CommandInfoSet) {
					CommandInfoSet ciset = (CommandInfoSet) cmdInfo;
					Gtk.Menu smenu = new Gtk.Menu ();
					Submenu = smenu;
					foreach (CommandInfo info in ciset.CommandInfos) {
						Gtk.MenuItem item;
						if (info.IsArraySeparator) {
							item = new Gtk.SeparatorMenuItem ();
							item.Show ();
						} else {
							item = CommandEntry.CreateMenuItem (commandManager, commandId, false);
							ICommandMenuItem mi = (ICommandMenuItem) item; 
							mi.SetUpdateInfo (info, initialTarget);
						}
						smenu.Add (item);
					}
				}
			}			
		}
 protected LambdaRunMarkerGutterMark([NotNull] IconId iconId) : base(iconId)
 {
 }
Beispiel #13
0
 public FSharpDeclaredElementType(string name, [CanBeNull] IconId imageName) : base(name, imageName)
 {
 }
		public IProgressMonitor GetOutputProgressMonitor (string id, string title, IconId icon, bool bringToFront, bool allowMonitorReuse)
		{
			Pad pad = CreateMonitorPad (id, title, icon, bringToFront, allowMonitorReuse, true);
			pad.Visible = true;
			return ((DefaultMonitorPad) pad.Content).BeginProgress (title);
		}
Beispiel #15
0
		void LoadPixbuf (IconId iconId)
		{
			// We dont need to load the same image twice
			if (icon == iconId && iconLoaded)
				return;

			icon = iconId;
			iconAnimation = null;

			// clean up previous running animation
			if (xwtAnimation != null) {
				xwtAnimation.Dispose ();
				xwtAnimation = null;
			}

			// if we have nothing, use the default icon
			if (iconId == IconId.Null)
				iconId = Stock.StatusSteady;

			// load image now
			if (ImageService.IsAnimation (iconId, Gtk.IconSize.Menu)) {
				iconAnimation = ImageService.GetAnimatedIcon (iconId, Gtk.IconSize.Menu);
				image = iconAnimation.FirstFrame.ToNSImage ();
				xwtAnimation = iconAnimation.StartAnimation (p => {
					image = p.ToNSImage ();
					ReconstructString ();
				});
			} else {
				image = ImageService.GetIcon (iconId).ToNSImage ();
			}

			iconLoaded = true;
		}
 public CompletionStepLookupItem(string text, IconId image, bool isDynamic = false)
     : this(text, string.Empty, isDynamic)
     => Image = image;
		/******************************/
		
		
		public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs)
		{
			return new StatusProgressMonitor (title, icon, showErrorDialogs, true, false, null);
		}
Beispiel #18
0
 public CommandEntrySet(string name, IconId icon) : base((object)null)
 {
     this.name = name;
     this.icon = icon;
 }
 public EmojiLookupItem(Emoji.Emoji emoji) : base(true)
 {
     Text  = $":{emoji.Name}:";
     Image = new EmojiIconId(emoji);
 }
Beispiel #20
0
 private void ShowMessage(string strMessage, TipoMsg msgType = TipoMsg.PRI_SimplesOk, IconId iconId = IconId.PRI_Exclama)
 {
     PriEngine.Platform.Dialogos.MostraMensagem(msgType, strMessage, iconId);
 }
Beispiel #21
0
 public RoslynCompletionData(ICompletionDataKeyHandler keyHandler, string displayText, IconId icon, string description, string completionText) : base(displayText, icon, description, completionText)
 {
     this.KeyHandler = keyHandler;
 }
Beispiel #22
0
 public RoslynCompletionData(ICompletionDataKeyHandler keyHandler, string text, IconId icon, string description) : base(text, icon, description)
 {
     this.KeyHandler = keyHandler;
 }
Beispiel #23
0
		public void ShowMessage (IconId image, string message)
		{
			ShowMessage (image, message, false, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
		}
Beispiel #24
0
 protected JsonNewDeclaredElementType(string name, IconId iconId)
     : base(name)
 {
     PresentableName = name;
     myIconId        = iconId;
 }
Beispiel #25
0
		public void ShowMessage (IconId image, string message, bool isMarkup, NSColor color)
		{
			DispatchService.AssertGuiThread ();

			LoadText (message, isMarkup, color);
			LoadPixbuf (image);
			ReconstructString ();
		}
 public void BeginProgress(IconId image, string name)
 {
     EndProgress();
     Status = StatusBarStatus.Normal;
     ShowMessage(image, name);
 }
		public IProgressMonitor GetBackgroundProgressMonitor (string title, IconId icon)
		{
			return new BackgroundProgressMonitor (title, icon);
		}
		public CompletionData (string text, IconId icon, string description) : this (text, icon, description, text) {}
Beispiel #29
0
		public void ShowMessage (IconId image, string message, bool isMarkup)
		{
			ShowMessage (image, message, isMarkup, MessageType.Information);
		}
Beispiel #30
0
 public void ShowMessage(IconId image, string message)
 {
     ShowMessage(image, message, false, NSColor.FromRgba(0.34f, 0.34f, 0.34f, 1));
 }
Beispiel #31
0
 public HaxeCompletionData(string text, IconId icon, string description) : base(text, icon, description)
 {
 }
Beispiel #32
0
 public Pad ShowPad(PadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
 {
     return(ShowPad(new PadCodon(padContent, id, label, defaultPlacement, defaultStatus, icon)));
 }
Beispiel #33
0
 public Pad AddPad(PadContent padContent, string id, string label, string defaultPlacement, IconId icon)
 {
     return(AddPad(new PadCodon(padContent, id, label, defaultPlacement, icon)));
 }
Beispiel #34
0
        void Update(CommandInfo cmdInfo)
        {
            lastCmdInfo = cmdInfo;
            if (isArray && !isArrayItem)
            {
                this.Visible = false;
                Gtk.Menu menu = (Gtk.Menu)Parent;

                if (itemArray != null)
                {
                    foreach (Gtk.MenuItem item in itemArray)
                    {
                        menu.Remove(item);
                    }
                }

                itemArray = new ArrayList();
                int i = Array.IndexOf(menu.Children, this);

                if (cmdInfo.ArrayInfo != null)
                {
                    foreach (CommandInfo info in cmdInfo.ArrayInfo)
                    {
                        Gtk.MenuItem item;
                        if (info.IsArraySeparator)
                        {
                            item = new Gtk.SeparatorMenuItem();
                            item.Show();
                        }
                        else
                        {
                            item = CommandEntry.CreateMenuItem(commandManager, commandId, false);
                            ICommandMenuItem mi = (ICommandMenuItem)item;
                            mi.SetUpdateInfo(info, initialTarget);
                        }
                        menu.Insert(item, ++i);
                        itemArray.Add(item);
                    }
                }
            }
            else
            {
                Gtk.Widget child = Child;
                if (child == null)
                {
                    return;
                }

                Gtk.Label accel_label = null;
                Gtk.Label label       = null;

                if (!(child is Gtk.HBox))
                {
                    child       = new Gtk.HBox(false, 0);
                    accel_label = new Gtk.Label("");
                    accel_label.UseUnderline = false;
                    accel_label.Xalign       = 1.0f;
                    accel_label.Show();

                    label = new Gtk.Label("");
                    label.UseUnderline = true;
                    label.Xalign       = 0.0f;
                    label.Show();

                    ((Gtk.Box)child).PackStart(label);
                    ((Gtk.Box)child).PackStart(accel_label);
                    child.Show();

                    this.Remove(Child);
                    this.Add(child);
                }
                else
                {
                    accel_label = (Gtk.Label)((Gtk.Box)child).Children[1];
                    label       = (Gtk.Label)((Gtk.Box)child).Children[0];
                }

                if (cmdInfo.AccelKey != null)
                {
                    accel_label.Text = "    " + KeyBindingManager.BindingToDisplayLabel(cmdInfo.AccelKey, true);
                }
                else
                {
                    accel_label.Text = String.Empty;
                }

                if (cmdInfo.UseMarkup)
                {
                    label.Markup    = overrideLabel ?? cmdInfo.Text;
                    label.UseMarkup = true;
                }
                else
                {
                    label.Text      = overrideLabel ?? cmdInfo.Text;
                    label.UseMarkup = false;
                }

                if (!string.IsNullOrEmpty(cmdInfo.Description) && label.TooltipText != cmdInfo.Description)
                {
                    label.TooltipText = cmdInfo.Description;
                }
                label.UseUnderline = true;

                this.Sensitive = cmdInfo.Enabled;
                this.Visible   = cmdInfo.Visible && (disabledVisible || cmdInfo.Enabled);

                if (!cmdInfo.Icon.IsNull && cmdInfo.Icon != lastIcon)
                {
                    Image    = new ImageView(cmdInfo.Icon, Gtk.IconSize.Menu);
                    lastIcon = cmdInfo.Icon;
                }

                if (cmdInfo is CommandInfoSet)
                {
                    CommandInfoSet ciset = (CommandInfoSet)cmdInfo;
                    Gtk.Menu       smenu = new Gtk.Menu();
                    Submenu = smenu;
                    foreach (CommandInfo info in ciset.CommandInfos)
                    {
                        Gtk.MenuItem item;
                        if (info.IsArraySeparator)
                        {
                            item = new Gtk.SeparatorMenuItem();
                            item.Show();
                        }
                        else
                        {
                            item = CommandEntry.CreateMenuItem(commandManager, commandId, false);
                            ICommandMenuItem mi = (ICommandMenuItem)item;
                            mi.SetUpdateInfo(info, initialTarget);
                        }
                        smenu.Add(item);
                    }
                }
            }
        }
 public CompletionCategory(string displayText, IconId icon)
 {
     this.DisplayText = displayText;
     this.Icon        = icon;
 }
Beispiel #36
0
 public CompletionData(string text, IconId icon) : this(text, icon, null)
 {
 }
Beispiel #37
0
		public void ShowMessage (IconId image, string message)
		{
			ShowMessage (image, message, false);
		}
Beispiel #38
0
 public CompletionData(string text, IconId icon, string description) : this(text, icon, description, text)
 {
 }
Beispiel #39
0
		public LinkCommandEntry (string text, string url, IconId icon): base (Id)
		{
			this.text = text;
			this.url = url;
			this.icon = icon;
		}
Beispiel #40
0
        /******************************/


        public IProgressMonitor GetStatusProgressMonitor(string title, IconId icon, bool showErrorDialogs)
        {
            return(new StatusProgressMonitor(title, icon, showErrorDialogs, true, false, null));
        }
		void Update (CommandInfo cmdInfo)
		{
			if (lastDesc != cmdInfo.Description) {
				string toolTip;
				if (string.IsNullOrEmpty (cmdInfo.AccelKey)) {
					toolTip = cmdInfo.Description;
				} else {
					toolTip = cmdInfo.Description + " (" + KeyBindingManager.BindingToDisplayLabel (cmdInfo.AccelKey, false) + ")";
				}
				TooltipText = toolTip;
				lastDesc = cmdInfo.Description;
			}
			
			if (Label != cmdInfo.Text)
				Label = cmdInfo.Text;
			if (cmdInfo.Icon != stockId) {
				stockId = cmdInfo.Icon;
				this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
			}
			if (cmdInfo.Enabled != Sensitive)
				Sensitive = cmdInfo.Enabled;
			if (cmdInfo.Visible != Visible)
				Visible = cmdInfo.Visible;
			if (cmdInfo.Icon.IsNull)
				IsImportant = true;
		}
Beispiel #42
0
 public IProgressMonitor GetStatusProgressMonitor(string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui, Pad statusSourcePad)
 {
     return(new StatusProgressMonitor(title, icon, showErrorDialogs, showTaskTitle, lockGui, statusSourcePad));
 }
Beispiel #43
0
		public void ShowMessage (IconId image, string message, bool isMarkup)
		{
			ShowMessage (image, message, isMarkup, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
		}
Beispiel #44
0
 public IProgressMonitor GetBackgroundProgressMonitor(string title, IconId icon)
 {
     return(new BackgroundProgressMonitor(title, icon));
 }
Beispiel #45
0
		public void BeginProgress (IconId image, string name)
		{
			EndProgress ();
			ShowMessage (image, name);
			oldFraction = 0;

			if (AutoPulse)
				StartProgressAutoPulse ();
		}
Beispiel #46
0
 public IProgressMonitor GetOutputProgressMonitor(string title, IconId icon, bool bringToFront, bool allowMonitorReuse)
 {
     return(GetOutputProgressMonitor(null, title, icon, bringToFront, allowMonitorReuse));
 }
		public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui, Pad statusSourcePad)
		{
			return new StatusProgressMonitor (title, icon, showErrorDialogs, showTaskTitle, lockGui, statusSourcePad);
		}
 public void ShowMessage(IconId image, string message, bool isMarkup)
 {
     ShowMessage(image, message, isMarkup, statusBar.ShowMessage);
 }
		public IProgressMonitor GetOutputProgressMonitor (string title, IconId icon, bool bringToFront, bool allowMonitorReuse)
		{
			return GetOutputProgressMonitor (null, title, icon, bringToFront, allowMonitorReuse);
		}
 void ResetMessage()
 {
     image   = IconId.Null;
     message = string.Empty;
 }
Beispiel #51
0
		public void ShowMessage (IconId image, string message)
		{
			ShowMessage (image, message, false, MessageType.Information);
		}
Beispiel #52
0
 public Message(IconId icon, string text, bool markup)
 {
     Text     = text;
     Icon     = icon;
     IsMarkup = markup;
 }
Beispiel #53
0
		public void ShowMessage (IconId image, string message, bool isMarkup, MessageType statusType)
		{
			Runtime.AssertMainThread ();

			bool changed = LoadText (message, isMarkup, statusType);
			LoadPixbuf (image);
			if (changed)
				ReconstructString ();
		}
Beispiel #54
0
 private AsmDefDeclaredElementType(string name, [CanBeNull] IconId imageName)
     : base(name, imageName)
 {
 }
Beispiel #55
0
		public void BeginProgress (IconId image, string name)
		{
			EndProgress ();
			ShowMessage (image, name);

			if (AutoPulse)
				progressView.StartProgressAutoPulse ();
			else
				progressView.BeginProgress ();
		}
 public OwnerProjectInfo(Microsoft.CodeAnalysis.Project project, IconId iconId)
 {
     Project   = project;
     StockIcon = iconId;
 }
		public CompletionData (string text, IconId icon) : this (text, icon, null) {}
Beispiel #58
0
 public void ShowMessage(IconId image, string message, bool isMarkup)
 {
     ShowMessage(image, message, isMarkup, NSColor.FromRgba(0.34f, 0.34f, 0.34f, 1));
 }
Beispiel #59
0
 public void ShowMessage(IconId image, string message)
 {
     ShowMessage(image, message, false);
 }
 public PresentableNode([CanBeNull] ITreeNode node, [CanBeNull] IconId icon)
 {
     Node = node;
     Icon = icon;
 }