コード例 #1
0
        public GLib.SList DiscreteEdgeActions()
        {
            IntPtr raw_ret = cdn_integrator_state_discrete_edge_actions(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #2
0
        public GLib.SList ToSlist()
        {
            IntPtr raw_ret = rc_package_dep_array_to_slist(ref this);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #3
0
ファイル: Rollback.cs プロジェクト: joeshaw/libredcarpet
        public static GLib.SList GetActions(System.DateTime when)
        {
            IntPtr raw_ret = rc_rollback_get_actions(GLib.Marshaller.DateTimeTotime_t(when));

            GLib.SList ret = new GLib.SList(raw_ret, typeof(RC.RollbackAction));
            return(ret);
        }
コード例 #4
0
        public static GLib.SList SlistSort(GLib.SList old_slist)
        {
            IntPtr raw_ret = rc_package_update_slist_sort(old_slist.Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #5
0
        private Menu CreateMenu(int depth, bool tearoff)
        {
            if (depth < 1)
            {
                return(null);
            }

            Menu menu = new Menu();

            GLib.SList group = new GLib.SList(IntPtr.Zero);

            if (tearoff)
            {
                TearoffMenuItem menuitem = new TearoffMenuItem();
                menu.Append(menuitem);
            }

            for (int i = 0, j = 1; i < 5; i++, j++)
            {
                RadioMenuItem menuitem = new RadioMenuItem(group, String.Format("item {0} - {1}", depth, j));
                group = menuitem.Group;

                menu.Append(menuitem);
                if (i == 3)
                {
                    menuitem.Sensitive = false;
                }

                menuitem.Submenu = CreateMenu((depth - 1), true);
            }

            return(menu);
        }
コード例 #6
0
        public static GLib.SList SlistCopy(GLib.SList old_update)
        {
            IntPtr raw_ret = rc_package_update_slist_copy(old_update.Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #7
0
        public bool Transact(GLib.SList install_packages, GLib.SList remove_packages, int flags)
        {
            bool raw_ret = rc_world_transact(Handle, install_packages.Handle, remove_packages.Handle, flags);
            bool ret     = raw_ret;

            return(ret);
        }
コード例 #8
0
ファイル: Packman.cs プロジェクト: joeshaw/libredcarpet
        public GLib.SList PatchParents(RC.Package package)
        {
            IntPtr raw_ret = rc_packman_patch_parents(Handle, package == null ? IntPtr.Zero : package.Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #9
0
ファイル: Global.cs プロジェクト: joeshaw/libredcarpet
        public static GLib.SList ArchGetCompatList(RC.Arch arch)
        {
            IntPtr raw_ret = rc_arch_get_compat_list((int)arch);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #10
0
        public bool SetFromList(GLib.SList timedvalues)
        {
            bool raw_ret = gst_timed_value_control_source_set_from_list(Handle, timedvalues == null ? IntPtr.Zero : timedvalues.Handle);
            bool ret     = raw_ret;

            return(ret);
        }
コード例 #11
0
        public GLib.SList Events()
        {
            IntPtr raw_ret = cdn_integrator_state_events(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #12
0
ファイル: Node.cs プロジェクト: codyn-net/codyn-sharp
        public GLib.SList GetAutoTemplatesForChild(Cdn.Object child)
        {
            IntPtr raw_ret = cdn_node_get_auto_templates_for_child(Handle, child == null ? IntPtr.Zero : child.Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #13
0
ファイル: Hash.cs プロジェクト: joeshaw/libredcarpet
        public static GLib.SList KeysToList(System.IntPtr hash_table)
        {
            IntPtr raw_ret = rc_hash_keys_to_list(hash_table);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #14
0
        public bool SetRunAttributes(GLib.SList attrib_set, int start_offset, int end_offset)
        {
            bool raw_ret = atk_editable_text_set_run_attributes(Handle, attrib_set == null ? IntPtr.Zero : attrib_set.Handle, start_offset, end_offset);
            bool ret     = raw_ret;

            return(ret);
        }
コード例 #15
0
ファイル: Global.cs プロジェクト: joeshaw/libredcarpet
        public static int ArchGetCompatScore(GLib.SList compat_arch_list, RC.Arch arch)
        {
            int raw_ret = rc_arch_get_compat_score(compat_arch_list.Handle, (int)arch);
            int ret     = raw_ret;

            return(ret);
        }
コード例 #16
0
ファイル: Packman.cs プロジェクト: joeshaw/libredcarpet
        public GLib.SList QueryAll()
        {
            IntPtr raw_ret = rc_packman_query_all(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #17
0
        public void SetState(Cdn.Node node, string st, GLib.SList events_added, GLib.SList events_removed)
        {
            IntPtr native_st = GLib.Marshaller.StringToPtrGStrdup(st);

            cdn_integrator_state_set_state(Handle, node == null ? IntPtr.Zero : node.Handle, native_st, events_added == null ? IntPtr.Zero : events_added.Handle, events_removed == null ? IntPtr.Zero : events_removed.Handle);
            GLib.Marshaller.Free(native_st);
        }
コード例 #18
0
        public GLib.SList Functions()
        {
            IntPtr raw_ret = cdn_integrator_state_functions(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #19
0
        public GLib.SList RandInstructions()
        {
            IntPtr raw_ret = cdn_integrator_state_rand_instructions(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #20
0
        public GLib.SList ListShortcuts()
        {
            IntPtr raw_ret = gtk_places_sidebar_list_shortcuts(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #21
0
        public GLib.SList ToInstructions()
        {
            IntPtr raw_ret = cdn_expression_tree_iter_to_instructions(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #22
0
        public object Get()
        {
            switch (val_type)
            {
            case ValueType.String:
                return(GLib.Marshaller.Utf8PtrToString(gconf_value_get_string(Raw)));

            case ValueType.Int:
                return(gconf_value_get_int(Raw));

            case ValueType.Float:
                return(gconf_value_get_float(Raw));

            case ValueType.Bool:
                return(gconf_value_get_bool(Raw));

            case ValueType.List:
                GLib.SList list   = new GLib.SList(gconf_value_get_list(Raw), typeof(Value));
                Array      result = Array.CreateInstance(GetListType(), list.Count);
                int        i      = 0;
                foreach (Value v in list)
                {
                    ((IList)result) [i] = v.Get();
                    v.managed           = false;                   // This is the trick to prevent a crash
                    i++;
                }

                return(result);

            default:
                throw new InvalidValueTypeException();
            }
        }
コード例 #23
0
        public bool Process(RC.ResolverContext context, GLib.SList arg2)
        {
            bool raw_ret = rc_queue_item_process(Handle, context == null ? IntPtr.Zero : context.Handle, arg2.Handle);
            bool ret     = raw_ret;

            return(ret);
        }
コード例 #24
0
        public Package[] Query(params QueryPart[] queryParts)
        {
            // FIXME: Set owned and items owned correctly
            GLib.SList query = new GLib.SList(IntPtr.Zero, typeof(IntPtr));
            foreach (QueryPart part in queryParts)
            {
                IntPtr key_as_native       = GLib.Marshaller.StringToPtrGStrdup(part.Key);
                IntPtr query_str_as_native = GLib.Marshaller.StringToPtrGStrdup(part.QueryStr);
                IntPtr rawPart             = rc_query_part_new(key_as_native, (int)part.Type, query_str_as_native);
                GLib.Marshaller.Free(key_as_native);
                GLib.Marshaller.Free(query_str_as_native);

                query.Append(rawPart);
            }

            IntPtr raw_ret = rc_query_packages(Handle, query.Handle);

            foreach (IntPtr p in query)
            {
                rc_query_part_free(p);
            }

            query.Dispose();
            return((RC.Package[])GLib.Marshaller.ListToArray(new GLib.SList(raw_ret, typeof(RC.Package), false, false),
                                                             typeof(RC.Package)));
        }
コード例 #25
0
ファイル: ActionGroup.cs プロジェクト: mhutch/gtk-sharp
        public void Add(RadioActionEntry[] entries, int value, ChangedHandler changed)
        {
            GLib.SList    group   = new GLib.SList(typeof(RadioAction));
            RadioAction[] actions = new RadioAction[entries.Length];
            for (int i = 0; i < entries.Length; i++)
            {
                actions[i] = new RadioAction(entries[i].name, entries[i].label,
                                             entries[i].tooltip, entries[i].stock_id, entries[i].value);
                actions[i].Group  = group;
                group             = actions[i].Group;
                actions[i].Active = value == entries[i].value;
                if (entries[i].accelerator == null)
                {
                    Add(actions[i]);
                }
                else
                {
                    Add(actions[i], entries[i].accelerator);
                }
            }

            // Add the ChangedHandler when we're done adding all the actions.
            // Otherwise, setting the Active property will trigger a premature event.
            if (changed != null)
            {
                actions[0].Changed += changed;
            }
        }
コード例 #26
0
ファイル: Packman.cs プロジェクト: joeshaw/libredcarpet
        public GLib.SList QueryFileList(GLib.SList filenames, bool filter_file_deps)
        {
            IntPtr raw_ret = rc_packman_query_file_list(Handle, filenames.Handle, filter_file_deps);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #27
0
        public static Gnome.CanvasPathDef Concat(GLib.SList list)
        {
            IntPtr raw_ret = gnome_canvas_path_def_concat(list == null ? IntPtr.Zero : list.Handle);

            Gnome.CanvasPathDef ret = raw_ret == IntPtr.Zero ? null : (Gnome.CanvasPathDef)GLib.Opaque.GetOpaque(raw_ret, typeof(Gnome.CanvasPathDef), false);
            return(ret);
        }
コード例 #28
0
        public GLib.SList DiscreteVariables()
        {
            IntPtr raw_ret = cdn_integrator_state_discrete_variables(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #29
0
        public GLib.SList PhaseIntegratedEdgeActions()
        {
            IntPtr raw_ret = cdn_integrator_state_phase_integrated_edge_actions(Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #30
0
        public static GLib.SList SlistCopy(GLib.SList list)
        {
            IntPtr raw_ret = rc_package_dep_slist_copy(list.Handle);

            GLib.SList ret = new GLib.SList(raw_ret);
            return(ret);
        }
コード例 #31
0
		public bool NativeCallback (IntPtr world, IntPtr install_packages, IntPtr remove_packages, int flags)
		{
			RC.World _arg0 = GLib.Object.GetObject(world) as RC.World;
			GLib.SList _arg1 = new GLib.SList(install_packages);
			GLib.SList _arg2 = new GLib.SList(remove_packages);
			int _arg3 = flags;
			return (bool) managed ( _arg0,  _arg1,  _arg2,  _arg3);
		}
コード例 #32
0
ファイル: EntryMenu.cs プロジェクト: moscrif/ide
        GLib.SList rbGroup; //= new GLib.SList(typeof(RadioMenuItem));

        #endregion Fields

        #region Constructors

        public EntryMenu(List<string> menu1,string labelMenu1, List<string> menu2,string labelMenu2, string defValue)
            : base(false, 6)
        {
            if (!String.IsNullOrEmpty(defValue)){
                LabelText = defValue;
                entryTxt.Text = defValue;
            }

            this.PackStart(entryTxt,true,true,0);

            Gdk.Pixbuf default_pixbuf = null;
            string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");
            if (System.IO.File.Exists(file)) {
                default_pixbuf = new Gdk.Pixbuf(file);

                Gtk.Button btnClose = new Gtk.Button(new Gtk.Image(default_pixbuf));
                btnClose.TooltipText = MainClass.Languages.Translate("insert_condition_name");
                btnClose.Relief = Gtk.ReliefStyle.None;
                btnClose.CanFocus = false;
                btnClose.WidthRequest = btnClose.HeightRequest = 22;

                popupCondition.AttachToWidget(btnClose,new Gtk.MenuDetachFunc(DetachWidget));

                btnClose.Clicked += delegate {
                    popupCondition.Popup();
                    //popupCondition.Popup(btnClose,null,new Gtk.MenuPositionFunc (GetPosition),3,Gtk.Global.CurrentEventTime);
                };

                this.PackEnd(btnClose,false,false,0);
            }

            rbGroup = new GLib.SList (typeof(RadioMenuItem));

            Gtk.MenuItem mi = new Gtk.MenuItem(labelMenu1);
            mi.Name = labelMenu1;
            mi.Sensitive = false;
            popupCondition.Add(mi);

            foreach(string m in menu1){
                AddMenuItem(popupCondition,m);
            }

            Gtk.MenuItem mi2 = new Gtk.MenuItem(labelMenu2);
            mi2.Name = labelMenu2;
            mi2.Sensitive = false;
            popupCondition.Add(mi2);

            //Gtk.Menu subPopup2 = new Gtk.Menu();
            foreach(string m in menu2){
                AddMenuItem(popupCondition,m);
            }

            //popupCondition.State = StateType.Insensitive;
            //popupCondition.
            popupCondition.ShowAll();
            this.ShowAll();
        }
コード例 #33
0
ファイル: UIManager.cs プロジェクト: liberostelios/gtk-sharp
		public Widget[] GetToplevels (Gtk.UIManagerItemType types) {
			IntPtr raw_ret = gtk_ui_manager_get_toplevels (Handle, (int) types);
			GLib.SList list = new GLib.SList (raw_ret);
 			Widget[] result = new Widget [list.Count];
			for (int i = 0; i < list.Count; i++)
				result [i] = list [i] as Widget;

			return result;
		}
コード例 #34
0
ファイル: TextIter.cs プロジェクト: liberostelios/gtk-sharp
		public TextTag[] GetToggledTags (bool toggled_on)
		{
			IntPtr raw_ret = gtk_text_iter_get_toggled_tags (ref this, toggled_on);
			if (raw_ret == IntPtr.Zero)
				return new TextTag [0];
			GLib.SList list = new GLib.SList(raw_ret);
			TextTag[] result = new TextTag [list.Count];
			for (int i = 0; i < list.Count; i++)
				result [i] = list [i] as TextTag;
			return result;
		}
コード例 #35
0
ファイル: Accel.cs プロジェクト: Gravecorp/gtk-sharp
 public static AccelGroup[] GroupsFromObject(GLib.Object obj)
 {
     IntPtr raw_ret = gtk_accel_groups_from_object(obj.Handle);
     if (raw_ret == IntPtr.Zero)
         return new AccelGroup [0];
     GLib.SList list = new GLib.SList(raw_ret);
     AccelGroup[] result = new AccelGroup [list.Count];
     for (int i = 0; i < list.Count; i++)
         result [i] = list [i] as AccelGroup;
     return result;
 }
コード例 #36
0
ファイル: Stock.cs プロジェクト: Gravecorp/gtk-sharp
 public static string[] ListIds()
 {
     IntPtr raw_ret = gtk_stock_list_ids ();
     if (raw_ret == IntPtr.Zero)
         return new string [0];
     GLib.SList list = new GLib.SList(raw_ret, typeof (string));
     string[] result = new string [list.Count];
     for (int i = 0; i < list.Count; i++)
         result [i] = (string) list [i];
     return result;
 }
コード例 #37
0
		public Display[] ListDisplays ()
		{
			IntPtr raw_ret = gdk_display_manager_list_displays (Handle);
			if (raw_ret == IntPtr.Zero)
				return new Display [0];
			GLib.SList list = new GLib.SList(raw_ret);
			Display[] result = new Display [list.Count];
			for (int i = 0; i < list.Count; i++)
				result [i] = list [i] as Display;
			return result;
		}
コード例 #38
0
ファイル: GlyphItem.cs プロジェクト: liberostelios/gtk-sharp
		public GlyphItem[] ApplyAttrs (string text, Pango.AttrList list)
		{
			IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text);
			IntPtr list_handle = pango_glyph_item_apply_attrs (ref this, native_text, list.Handle);
			GLib.Marshaller.Free (native_text);
			if (list_handle == IntPtr.Zero)
				return new GlyphItem [0];
			GLib.SList item_list = new GLib.SList (list_handle, typeof (GlyphItem));
			GlyphItem[] result = new GlyphItem [item_list.Count];
			int i = 0;
			foreach (GlyphItem item in item_list)
				result [i++] = item;
			return result;
		}
コード例 #39
0
		public void GetFont (out Pango.FontDescription desc, out Pango.Language language, out Pango.Attribute[] extra_attrs)
		{
			desc = new FontDescription ();
			IntPtr language_handle, list_handle;
			pango_attr_iterator_get_font (Handle, desc.Handle, out language_handle, out list_handle);
			desc.Family = desc.Family; // change static string to allocated one
			language = language_handle == IntPtr.Zero ? null : new Language (language_handle);
			if (list_handle == IntPtr.Zero) {
				extra_attrs = new Pango.Attribute [0];
				return;
			}
			GLib.SList list = new GLib.SList (list_handle);
			extra_attrs = new Pango.Attribute [list.Count];
			int i = 0;
			foreach (IntPtr raw_attr in list)
				extra_attrs [i++] = Pango.Attribute.GetAttribute (raw_attr);
		}
コード例 #40
0
        public void Add(RadioActionEntry[] entries, int value, ChangedHandler changed)
        {
            GLib.SList group = new GLib.SList (typeof (RadioAction));
            RadioAction[] actions = new RadioAction[entries.Length];
            for (int i = 0; i < entries.Length; i++) {
                actions[i] = new RadioAction (entries[i].name, entries[i].label,
                                              entries[i].tooltip, entries[i].stock_id, entries[i].value);
                actions[i].Group = group;
                group = actions[i].Group;
                actions[i].Active = value == entries[i].value;
                if (entries[i].accelerator == null)
                    Add (actions[i]);
                else
                    Add (actions[i], entries[i].accelerator);
            }

            // Add the ChangedHandler when we're done adding all the actions.
            // Otherwise, setting the Active property will trigger a premature event.
            if (changed != null)
                actions[0].Changed += changed;
        }
コード例 #41
0
ファイル: World.cs プロジェクト: joeshaw/libredcarpet
    public Package[] Query (params QueryPart[] queryParts) {
        // FIXME: Set owned and items owned correctly
        GLib.SList query = new GLib.SList (IntPtr.Zero, typeof (IntPtr));
        foreach (QueryPart part in queryParts) {
            IntPtr key_as_native = GLib.Marshaller.StringToPtrGStrdup (part.Key);
            IntPtr query_str_as_native = GLib.Marshaller.StringToPtrGStrdup (part.QueryStr);
            IntPtr rawPart = rc_query_part_new (key_as_native, (int) part.Type, query_str_as_native);
            GLib.Marshaller.Free (key_as_native);
            GLib.Marshaller.Free (query_str_as_native);

            query.Append (rawPart);
        }

        IntPtr raw_ret = rc_query_packages (Handle, query.Handle);

        foreach (IntPtr p in query)
            rc_query_part_free (p);

        query.Dispose ();
        return (RC.Package[]) GLib.Marshaller.ListToArray (new GLib.SList (raw_ret, typeof (RC.Package), false, false),
                                                           typeof (RC.Package));
    }
コード例 #42
0
		public PropertyEditorRadioButton (string key, RadioButton button, Type enum_type, int[] enum_values) : base (key, button, enum_type, enum_values)
		{
			group = button.Group;
		}
コード例 #43
0
		public PropertyEditorRadioButton (string key, RadioButton button) : base (key, button)
		{
			group = button.Group;
		}
コード例 #44
0
ファイル: Marshaller.cs プロジェクト: ystk/debian-gtk-sharp2
		public static Array ListPtrToArray (IntPtr list_ptr, Type list_type, bool owned, bool elements_owned, Type elem_type)
		{
			ListBase list;
			if (list_type == typeof(GLib.List))
				list = new GLib.List (list_ptr, elem_type, owned, elements_owned);
			else
				list = new GLib.SList (list_ptr, elem_type, owned, elements_owned);

			using (list)
				return ListToArray (list, elem_type);
		}
コード例 #45
0
		public PropertyEditorRadioButton (string key, RadioButton button, Type enum_type) : base (key, button, enum_type)
		{
			group = button.Group;
		}
コード例 #46
0
		GLib.SList GetListFromCollection (ICollection data, out ValueType listType)
		{
			object [] arr = (object []) Array.CreateInstance (typeof (object), data.Count);
			data.CopyTo (arr, 0);

			listType = ValueType.Invalid;
			GLib.SList list = new GLib.SList (IntPtr.Zero);
			GC.SuppressFinalize (list);

			if (data.Count == 0) {
				if (data is string [])
					listType = ValueType.String;
				else if (data is int [])
					listType = ValueType.Int;
				else if (data is double [])
					listType = ValueType.Float;
				else if (data is bool [])
					listType = ValueType.Bool;
			}

			if (arr.Length == 0) {
				if (data is Array)
					listType = LookupType (data.GetType ().GetElementType ());
				else
					throw new InvalidValueTypeException ();
				return list;
			}

			foreach (object o in arr) {
				ValueType type = LookupType (o.GetType ());
				if (listType == ValueType.Invalid)
					listType = type;

				if (listType == ValueType.Invalid || type != listType)
					throw new InvalidValueTypeException ();

				Value v = new Value (o);
				GC.SuppressFinalize (v);
				list.Append (v.Raw);
			}
			
			return list;
		}
コード例 #47
0
ファイル: Package.cs プロジェクト: joeshaw/libredcarpet
		public static GLib.SList SlistSortByPrettyName(GLib.SList packages) {
			IntPtr raw_ret = rc_package_slist_sort_by_pretty_name(packages.Handle);
			GLib.SList ret = new GLib.SList(raw_ret);
			return ret;
		}
コード例 #48
0
ファイル: Widget.cs プロジェクト: liberostelios/gtk-sharp
		static void ClassInit (GLib.GType gtype, Type t)
		{
			object[] attrs = t.GetCustomAttributes (typeof (BindingAttribute), true);
			if (attrs.Length == 0) return;

			string signame = t.Name.Replace (".", "_") + "_bindings";
			IntPtr native_signame = GLib.Marshaller.StringToPtrGStrdup (signame);
			RegisterSignal (signame, gtype, GLib.Signal.Flags.RunLast | GLib.Signal.Flags.Action, GLib.GType.None, new GLib.GType[] {GLib.GType.Long}, BindingDelegate);

			if (binding_invokers == null)
				binding_invokers = new List<BindingInvoker> ();

			foreach (BindingAttribute attr in attrs) {
				System.Reflection.MethodInfo mi = t.GetMethod (attr.Handler, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public);
				if (mi == null)
					throw new Exception ("Instance method " + attr.Handler + " not found in " + t);

				GtkBindingArg arg = new GtkBindingArg ();
				arg.arg_type = GLib.GType.Long.Val;

				var bi = new BindingInvoker (mi, attr.Parms);
				binding_invokers.Add (bi);
				int binding_invoker_idx = binding_invokers.IndexOf (bi);
#if WIN64LONGS
				arg.data.long_data = binding_invoker_idx;
#else
				arg.data.long_data = new IntPtr (binding_invoker_idx);
#endif

				GLib.SList binding_args = new GLib.SList (new object[] {arg}, typeof (GtkBindingArg), false, false);
				gtk_binding_entry_add_signall (gtk_binding_set_by_class (gtype.GetClassPtr ()), (uint) attr.Key, attr.Mod, native_signame, binding_args.Handle);
				binding_args.Dispose ();
			}
			GLib.Marshaller.Free (native_signame);
		}
コード例 #49
0
        // options menu for filterSearchEntry
        public Menu CreateOptionsMenu()
        {
            Menu menu = new Menu ();

            MenuItem searchInMenu = new MenuItem (GettextCatalog.GetString ("_Search in"));
            Menu sub = new Menu ();
            searchInMenu.Submenu = sub;

            Gtk.RadioMenuItem  name = null, baseValue = null, value =null, comment = null, all = null;
            GLib.SList group = new GLib.SList (IntPtr.Zero);

            name = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Name"));
            group = name.Group;
            name.ButtonPressEvent += delegate { name.Activate (); };
            sub.Append (name);

            baseValue = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Base Value"));
            baseValue.ButtonPressEvent += delegate { baseValue.Activate (); };
            group = baseValue.Group;
            sub.Append (baseValue);

            value = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Value"));
            value.ButtonPressEvent += delegate { value.Activate (); };
            group = value.Group;
            sub.Append (value);

            comment = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Comment"));
            comment.ButtonPressEvent += delegate { comment.Activate (); };
            group = comment.Group;
            sub.Append (comment);

            all = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_All"));
            all.ButtonPressEvent += delegate { all.Activate (); };
            sub.Append (all);

            switch (DoSearchIn) {
            case SearchIn.All:
                all.Activate ();
                break;
            case SearchIn.BaseValue:
                baseValue.Activate ();
                break;
            case SearchIn.Value:
                value.Activate ();
                break;
            case SearchIn.Name:
                name.Activate ();
                break;
            case SearchIn.Comment:
                comment.Activate ();
                break;
            }
            menu.Append (searchInMenu);
            all.Activated += delegate {
                if (DoSearchIn != SearchIn.All) {
                    DoSearchIn = SearchIn.All;
                    Refresh ();
                    menu.Destroy ();
                }
            };
            baseValue.Activated += delegate {
                if (DoSearchIn != SearchIn.BaseValue) {
                    DoSearchIn = SearchIn.BaseValue;
                    Refresh ();
                    menu.Destroy ();
                }
            };
            value.Activated += delegate {
                if (DoSearchIn != SearchIn.Value) {
                    DoSearchIn = SearchIn.Value;
                    Refresh ();
                    menu.Destroy ();
                }
            };
            name.Activated += delegate {
                if (DoSearchIn != SearchIn.Name) {
                    DoSearchIn = SearchIn.Name;
                    Refresh ();
                    menu.Destroy ();
                }
            };
            comment.Activated += delegate {
                if (DoSearchIn != SearchIn.Comment) {
                    DoSearchIn = SearchIn.Comment;
                    Refresh ();
                    menu.Destroy ();
                }
            };

            Gtk.CheckMenuItem regexSearch = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Regex search"));
            regexSearch.Active = RegexSearch;
            regexSearch.ButtonPressEvent += delegate {
                RegexSearch = !RegexSearch;
                Refresh ();
            };
            menu.Append (regexSearch);

            Gtk.CheckMenuItem caseSensitive = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Case sensitive"));
            caseSensitive.Active = IsCaseSensitive;
            caseSensitive.ButtonPressEvent += delegate {
                IsCaseSensitive = !IsCaseSensitive;
                Refresh ();
            };
            menu.Append (caseSensitive);

            Gtk.CheckMenuItem wholeWordsOnly = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Whole words only"));
            wholeWordsOnly.Active = IsWholeWordOnly;
            wholeWordsOnly.Sensitive = !RegexSearch;
            wholeWordsOnly.ButtonPressEvent += delegate {
                IsWholeWordOnly = !IsWholeWordOnly;
                Refresh ();
            };
            menu.Append (wholeWordsOnly);
            menu.ShowAll ();
            return menu;
        }
コード例 #50
0
ファイル: GtkTypeDisplayer.cs プロジェクト: emtees/old-code
		private static void CreateEntriesFromFactory (MenuItem menu, TreeStore store, EventHandler handler, TypeFactory factory, IList menuEntries)
		{
			GLib.SList group = new GLib.SList (IntPtr.Zero);
			Menu submenu = new Menu ();

			foreach (DictionaryEntry de in factory) {
				TypeFactoryEntry entry = (TypeFactoryEntry) de.Value;
				if (store != null)
					store.AppendValues (false, entry.Description, entry.Key);
				RadioMenuItem item = new RadioMenuItem (group, entry.Description);
				item.Activated += handler;
				group = item.Group;
				submenu.Append (item);
				menuEntries.Add (new RadioMenuItemInfo (item, entry.Key));
			}

			menu.Submenu = submenu;
			menu.ShowAll ();
		}
コード例 #51
0
ファイル: Marshaller.cs プロジェクト: nuxleus/gtk-sharp
        public static Array ListPtrToArray(IntPtr list_ptr, Type list_type, bool owned, bool elements_owned, Type elem_type)
        {
            Type array_type = elem_type == typeof (ListBase.FilenameString) ? typeof (string) : elem_type;
            ListBase list;
            if (list_type == typeof(GLib.List))
                list = new GLib.List (list_ptr, elem_type, owned, elements_owned);
            else
                list = new GLib.SList (list_ptr, elem_type, owned, elements_owned);

            using (list)
                return ListToArray (list, array_type);
        }
コード例 #52
0
ファイル: Package.cs プロジェクト: joeshaw/libredcarpet
		public static GLib.SList HashTableBySpecToList(System.IntPtr ht) {
			IntPtr raw_ret = rc_package_hash_table_by_spec_to_list(ht);
			GLib.SList ret = new GLib.SList(raw_ret);
			return ret;
		}
コード例 #53
0
ファイル: Global.cs プロジェクト: joeshaw/libredcarpet
		public static GLib.SList ArchGetCompatList(RC.Arch arch) {
			IntPtr raw_ret = rc_arch_get_compat_list((int) arch);
			GLib.SList ret = new GLib.SList(raw_ret);
			return ret;
		}
コード例 #54
0
		public object Get ()
		{
			switch (val_type)
			{
				case ValueType.String:
					return GLib.Marshaller.Utf8PtrToString (gconf_value_get_string (Raw));
				case ValueType.Int:
					return gconf_value_get_int (Raw);
				case ValueType.Float:
					return gconf_value_get_float (Raw);
				case ValueType.Bool:
					return gconf_value_get_bool (Raw);
				case ValueType.List:
					GLib.SList list = new GLib.SList (gconf_value_get_list (Raw), typeof (Value));
					Array result = Array.CreateInstance (GetListType (), list.Count);
					int i = 0;
					foreach (Value v in list) {
						((IList) result) [i] =  v.Get ();
						v.managed = false; // This is the trick to prevent a crash
						i++;
					}

					return result;
				default:
					throw new InvalidValueTypeException ();
			}
		}
コード例 #55
0
ファイル: POEditorWidget.cs プロジェクト: Kalnor/monodevelop
		public Menu CreateOptionsMenu ()
		{
			Menu menu = new Menu ();
			
			MenuItem searchInMenu = new MenuItem (GettextCatalog.GetString ("_Search in"));
			Menu sub = new Menu ();
			searchInMenu.Submenu = sub;
			Gtk.RadioMenuItem  original = null, translated = null, both = null;
			GLib.SList group = new GLib.SList (IntPtr.Zero);
			original = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Original"));
			group = original.Group;
			original.ButtonPressEvent += delegate { original.Activate (); };
			sub.Append (original);
			
			translated = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Translated"));
			translated.ButtonPressEvent += delegate { translated.Activate (); };
			group = translated.Group;
			sub.Append (translated);
			
			both = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Both"));
			both.ButtonPressEvent += delegate { both.Activate (); };
			sub.Append (both);
			switch (DoSearchIn) {
			case SearchIn.Both:
				both.Activate ();
				break;
			case SearchIn.Original:
				original.Activate ();
				break;
			case SearchIn.Translated:
				translated.Activate ();
				break;
			}
			menu.Append (searchInMenu);
			both.Activated += delegate {
				if (DoSearchIn != SearchIn.Both) {
					DoSearchIn = SearchIn.Both;
					UpdateFromCatalog ();
					menu.Destroy ();
				}
			};
			original.Activated += delegate {
				if (DoSearchIn != SearchIn.Original) {
					DoSearchIn = SearchIn.Original;
					UpdateFromCatalog ();
					menu.Destroy ();
				}
			};
			translated.Activated += delegate {
				if (DoSearchIn != SearchIn.Translated) {
					DoSearchIn = SearchIn.Translated;
					UpdateFromCatalog ();
					menu.Destroy ();
				}
			};
			
			Gtk.CheckMenuItem regexSearch = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Regex search"));
			regexSearch.Active = RegexSearch;
			regexSearch.ButtonPressEvent += delegate { 
				RegexSearch = !RegexSearch;
				UpdateFromCatalog ();
			};
			menu.Append (regexSearch);
			
			Gtk.CheckMenuItem caseSensitive = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Case sensitive"));
			caseSensitive.Active = IsCaseSensitive;
			caseSensitive.ButtonPressEvent += delegate { 
				IsCaseSensitive = !IsCaseSensitive;
				UpdateFromCatalog ();
			};
			menu.Append (caseSensitive);
			
			Gtk.CheckMenuItem wholeWordsOnly = new Gtk.CheckMenuItem (MonoDevelop.Core.GettextCatalog.GetString ("_Whole words only"));
			wholeWordsOnly.Active = IsWholeWordOnly;
			wholeWordsOnly.Sensitive = !RegexSearch;
			wholeWordsOnly.ButtonPressEvent += delegate {
				IsWholeWordOnly = !IsWholeWordOnly;
				UpdateFromCatalog ();
			};
			menu.Append (wholeWordsOnly);
			menu.ShowAll ();
			return menu;
		}
コード例 #56
0
ファイル: Summa.Gui.Browser.cs プロジェクト: wfarr/newskit
        public void SetUpActionGroup()
        {
            // menus
            file_menu = new Gtk.Action("FileMenu", "_File", null, null);
            action_group.Add(file_menu);
            edit_menu = new Gtk.Action("EditMenu", "_Edit", null, null);
            action_group.Add(edit_menu);
            view_menu = new Gtk.Action("ViewMenu", "_View", null, null);
            action_group.Add(view_menu);
            subs_menu = new Gtk.Action("SubsMenu", "_Feed", null, null);
            action_group.Add(subs_menu);
            item_menu = new Gtk.Action("ItemMenu", "_Item", null, null);
            action_group.Add(item_menu);
            help_menu = new Gtk.Action("HelpMenu", "_Help", null, null);
            action_group.Add(help_menu);

            // the file menu
            addaction = new Summa.Actions.AddAction(this);
            action_group.Add(addaction, "<ctrl>n");

            import_action = new Summa.Actions.ImportAction(this);
            action_group.Add(import_action);

            Up_all_action = new Summa.Actions.UpdateAllAction(this);
            action_group.Add(Up_all_action, "<ctrl>r");

            print_action = new Summa.Actions.PrintAction(this);
            action_group.Add(print_action, "<ctrl>p");

            print_prev_action = new Summa.Actions.PrintPreviewAction(this);
            action_group.Add(print_prev_action, "<shift><ctrl>p");

            email_action = new Summa.Actions.EmailLinkAction(this);
            action_group.Add(email_action);

            bookmark_action = new Summa.Actions.BookmarkAction(this);
            bookmark_action.Sensitive = false;
            action_group.Add(bookmark_action, "<ctrl>d");

            new_tab_action = new Summa.Actions.NewTabAction(this);
            new_tab_action.Sensitive = false;
            action_group.Add(new_tab_action, "<ctrl>t");

            new_win_action = new Summa.Actions.NewWindowAction(this);
            action_group.Add(new_win_action, "<shift><ctrl>N");

            close_action = new Summa.Actions.CloseWindowAction(this);
            action_group.Add(close_action, "<ctrl>W");

            // edit menu
            copy_action = new Summa.Actions.CopyAction(this);
            action_group.Add(copy_action, "<ctrl>C");

            select_all_action = new Summa.Actions.SelectAllAction(this);
            action_group.Add(select_all_action, "<ctrl>A");

            find_action = new Summa.Actions.FindAction(this);
            action_group.Add(find_action, "<ctrl>F");

            prefs_action = new Summa.Actions.PreferencesAction(this);
            action_group.Add(prefs_action);

            // subscription menu
            update_action = new Summa.Actions.UpdateAction(this);
            action_group.Add(update_action, "<ctrl>u");

            read_action = new Summa.Actions.MarkReadAction(this);
            action_group.Add(read_action, "<ctrl>m");

            delete_action = new Summa.Actions.DeleteAction(this);
            action_group.Add(delete_action);

            props_action = new Summa.Actions.PropertiesAction(this);
            action_group.Add(props_action);

            tags_action = new Summa.Actions.TagsAction(this);
            action_group.Add(tags_action);

            // item menu
            zoom_in_action = new Summa.Actions.ZoomInAction(this);
            zoom_in_action.Sensitive = false;
            action_group.Add(zoom_in_action, null);

            zoom_out_action = new Summa.Actions.ZoomOutAction(this);
            zoom_out_action.Sensitive = false;
            action_group.Add(zoom_out_action, null);

            load_images_action = new Summa.Actions.LoadImagesAction(this);
            action_group.Add(load_images_action, null);

            hide_read_action = new Summa.Actions.HideReadAction(this);
            action_group.Add(hide_read_action, null);

            next_item_action = new Summa.Actions.NextItemAction(this);
            action_group.Add(next_item_action, "n");

            prev_item_action = new Summa.Actions.PreviousItemAction(this);
            action_group.Add(prev_item_action, "j");

            flag_action = new Summa.Actions.FlagAction(this);
            flag_action.Sensitive = false;
            action_group.Add(flag_action);

            unread_action = new Summa.Actions.UnreadAction(this);
            unread_action.Sensitive = false;
            action_group.Add(unread_action);

            play_action = new Summa.Actions.EnclosureAction(this);
            play_action.Sensitive = false;
            action_group.Add(play_action);

            save_action = new Summa.Actions.SaveEnclosureAction(this);
            save_action.Sensitive = false;
            action_group.Add(save_action);

            // help menu
            help_action = new Summa.Actions.HelpAction(this);
            action_group.Add(help_action, "F11");

            about_action = new Summa.Actions.AboutAction(this);
            action_group.Add(about_action);

            view_slist = new GLib.SList(typeof(ToggleAction));

            normal_view_action = new Summa.Actions.NormalViewAction(this);
            action_group.Add(normal_view_action);
            normal_view_action.Group = view_slist;
            view_slist = normal_view_action.Group;

            widescreen_view_action = new Summa.Actions.WidescreenViewAction(this);
            action_group.Add(widescreen_view_action);
            widescreen_view_action.Group = view_slist;
            view_slist = widescreen_view_action.Group;
        }
コード例 #57
0
ファイル: Package.cs プロジェクト: joeshaw/libredcarpet
		public static GLib.SList SlistRef(GLib.SList packages) {
			IntPtr raw_ret = rc_package_slist_ref(packages.Handle);
			GLib.SList ret = new GLib.SList(raw_ret);
			return ret;
		}
コード例 #58
0
ファイル: RadioGroupManager.cs プロジェクト: mono/stetic
        public string this[Gtk.Widget radio]
        {
            get {
                RadioGroup group = widgets[radio] as RadioGroup;
                if (group != null)
                    return group.Name;
                else
                    return null;
            }
            set {
                GLib.SList group_value;

                RadioGroup oldGroup = widgets[radio] as RadioGroup;
                if (oldGroup == null) {
                    radio.Destroyed += RadioDestroyed;
                } else {
                    if (oldGroup.Name == value)
                        return;
                    oldGroup.Widgets.Remove (radio);
                    if (oldGroup.Widgets.Count == 0) {
                        groups.Remove (oldGroup);
                        EmitGroupsChanged ();
                    }
                }

                if (value == null) {
                    radio.Destroyed -= RadioDestroyed;
                    groupProperty.SetValue (radio, new GLib.SList (IntPtr.Zero), null);
                    widgets.Remove (radio);
                    return;
                }

                RadioGroup newGroup = FindGroup (value);
                if (newGroup == null)
                    newGroup = Add (value);

                if (newGroup.Widgets.Count == 0)
                    group_value = new GLib.SList (IntPtr.Zero);
                else
                    group_value = (GLib.SList)groupProperty.GetValue (newGroup.Widgets[0], null);

                groupProperty.SetValue (radio, group_value, null);
                newGroup.Widgets.Add (radio);
                widgets[radio] = newGroup;
            }
        }
コード例 #59
0
ファイル: TestMenus.cs プロジェクト: saraa/fishtastic
        static Menu Create_Menu(int depth, bool tearoff)
        {
            if (depth < 1)
                return null;

            Menu menu = new Menu ();
            MenuItem menuitem = null;
            string label = null;
            GLib.SList group = new GLib.SList (IntPtr.Zero);

            if (tearoff) {
                menuitem = new TearoffMenuItem ();
                menu.Append (menuitem);
                menuitem.Show ();
            }

            for (int i = 0, j = 1; i < 5; i++, j++) {

                label = String.Format ("item {0} - {1}", depth, j);
                menuitem = new RadioMenuItem (group, label);
                group = ((RadioMenuItem) menuitem).Group;
                menuitem = new MenuItem (label);
                menu.Append (menuitem);

                if (i == 3)
                    menuitem.Sensitive = false;

                Menu child = Create_Menu ((depth - 1), true);

                if (child != null)
                    menuitem.Submenu = child;
            }

            return menu;
        }
コード例 #60
0
ファイル: Data.cs プロジェクト: MulziSAW/newRBS
		public static GLib.SList MeasruementGetSchedule(Epsara.DataMeasurement measurement) {
			IntPtr raw_ret = epsara_data_measruement_get_schedule(measurement == null ? IntPtr.Zero : measurement.Handle);
			GLib.SList ret = new GLib.SList(raw_ret);
			return ret;
		}