예제 #1
0
        public Cdn.Selector PeekSelector()
        {
            IntPtr raw_ret = cdn_parser_context_peek_selector(Handle);

            Cdn.Selector ret = GLib.Object.GetObject(raw_ret) as Cdn.Selector;
            return(ret);
        }
예제 #2
0
        private void HandleEntryChanged(object sender, EventArgs e)
        {
            d_searchText = d_entry.Text.ToLowerInvariant();
            d_selected   = null;

            if (d_searchText.LastIndexOfAny(new char[] { '/', '"', '.', ':', '(' }) != -1)
            {
                Cdn.Selector selector = null;
                string       s;

                if (d_searchText.EndsWith("."))
                {
                    s = d_searchText.Substring(0, d_searchText.Length - 1) + " | children";
                }
                else
                {
                    s = d_searchText;
                }

                try
                {
                    selector = Cdn.Selector.Parse(d_group, s);
                }
                catch
                {
                }

                if (selector != null)
                {
                    selector.Partial = true;

                    d_selected = new Dictionary <GLib.Object, bool>();

                    List <Wrappers.Object> all = new List <Wrappers.Object>();
                    AllObjects(d_group, all);

                    foreach (Wrappers.Object o in all)
                    {
                        Cdn.Selection[] selections = selector.Select(o, SelectorType.Any, null);

                        foreach (Cdn.Selection sel in selections)
                        {
                            AddAll(GLib.Object.GetObject(sel.Object), d_selected);
                        }
                    }
                }
            }

            d_treeview.NodeStore.Filter(FilterFunc);
        }
예제 #3
0
        public static unsafe Cdn.Selector Parse(Cdn.Object root, string s)
        {
            IntPtr native_s = GLib.Marshaller.StringToPtrGStrdup(s);
            IntPtr error    = IntPtr.Zero;
            IntPtr raw_ret  = cdn_selector_parse(root == null ? IntPtr.Zero : root.Handle, native_s, out error);

            Cdn.Selector ret = GLib.Object.GetObject(raw_ret) as Cdn.Selector;
            GLib.Marshaller.Free(native_s);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }
            return(ret);
        }
예제 #4
0
 protected virtual void OnSelectorItemPushed(Cdn.Selector p0)
 {
     GLib.Value      ret             = GLib.Value.Empty;
     GLib.ValueArray inst_and_params = new GLib.ValueArray(2);
     GLib.Value[]    vals            = new GLib.Value [2];
     vals [0] = new GLib.Value(this);
     inst_and_params.Append(vals [0]);
     vals [1] = new GLib.Value(p0);
     inst_and_params.Append(vals [1]);
     g_signal_chain_from_overridden(inst_and_params.ArrayPtr, ref ret);
     foreach (GLib.Value v in vals)
     {
         v.Dispose();
     }
 }
예제 #5
0
 public void DebugSelector(Cdn.Selector selector)
 {
     cdn_parser_context_debug_selector(Handle, selector == null ? IntPtr.Zero : selector.Handle);
 }
예제 #6
0
 public void PushSelection(Cdn.Selector selector, Cdn.SelectorType type, GLib.SList templates)
 {
     cdn_parser_context_push_selection(Handle, selector == null ? IntPtr.Zero : selector.Handle, (int)type, templates == null ? IntPtr.Zero : templates.Handle);
 }
예제 #7
0
 public void AddEventSetVariable(Cdn.Selector selector, Cdn.EmbeddedString value)
 {
     cdn_parser_context_add_event_set_variable(Handle, selector == null ? IntPtr.Zero : selector.Handle, value == null ? IntPtr.Zero : value.Handle);
 }
예제 #8
0
 public void UnapplyTemplate(Cdn.Selector templates, Cdn.Selector targets)
 {
     cdn_parser_context_unapply_template(Handle, templates == null ? IntPtr.Zero : templates.Handle, targets == null ? IntPtr.Zero : targets.Handle);
 }
예제 #9
0
 public void AddLayoutPosition(Cdn.Selector selector, GLib.PtrArray x, GLib.PtrArray y, Cdn.Selector of, bool cartesian)
 {
     cdn_parser_context_add_layout_position(Handle, selector == null ? IntPtr.Zero : selector.Handle, x == null ? IntPtr.Zero : x.Handle, y == null ? IntPtr.Zero : y.Handle, of == null ? IntPtr.Zero : of.Handle, cartesian);
 }