本文整理汇总了C#中Plasma类的典型用法代码示例。如果您正苦于以下问题:C# Plasma类的具体用法?C# Plasma怎么用?C# Plasma使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Plasma类属于命名空间,在下文中一共展示了Plasma类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitExtenderItem
//Implement this function to make ExtenderItems persistent.
//This function will get called on plasma start for every
//ExtenderItem that belonged to this applet, and is still
//around. Instantiate the widget to be wrapped in the
//ExtenderItem here.
public override void InitExtenderItem(Plasma.ExtenderItem item)
{
//Create a Meter widget and wrap it in the ExtenderItem
Plasma.Meter meter = new Plasma.Meter(item) {
meterType = Plasma.Meter.MeterType.BarMeterHorizontal,
Svg = "widgets/bar_meter_horizontal",
Maximum = 100,
Value = 0
};
meter.SetMinimumSize(new QSizeF(250, 45));
meter.SetPreferredSize(new QSizeF(250, 45));
//often, you'll want to connect dataengines or set properties
//depending on information contained in item.config().
//In this situation that won't be necessary though.
item.Widget = meter;
//Job names are not unique across plasma restarts (kuiserver
//engine just starts with Job1 again), so avoid problems and
//just don't give reinstantiated items a name.
item.Name = "";
//Show a close button.
item.ShowCloseButton();
}
示例2: LoadScriptEngine
/// <remarks>
/// Loads an DataEngine script engine for the given language.
/// <param> name="language" the language to load for
/// </param><param> name="dataEngine" the Plasma.DataEngine for this script;
/// </param></remarks> <return> pointer to the DataEngineScript or 0 on failure; the caller is responsible
/// for the return object which will be parented to the DataEngine
/// </return>
/// <short> Loads an DataEngine script engine for the given language.</short>
public static Plasma.DataEngineScript LoadScriptEngine(string language, Plasma.DataEngine dataEngine)
{
return (Plasma.DataEngineScript) staticInterceptor.Invoke("loadScriptEngine$#", "loadScriptEngine(const QString&, Plasma::DataEngine*)", typeof(Plasma.DataEngineScript), typeof(string), language, typeof(Plasma.DataEngine), dataEngine);
}
示例3: ConnectVisualization
/// <remarks>
/// Connects an object to this DataContainer.
/// May be called repeatedly for the same visualization without
/// side effects
/// <param> name="visualization" the object to connect to this DataContainer
/// </param><param> name="pollingInterval" the time in milliseconds between updates
/// </param><param> name="alignment" the clock position to align updates to
/// </param></remarks> <short> Connects an object to this DataContainer.</short>
public void ConnectVisualization(QObject visualization, uint pollingInterval, Plasma.IntervalAlignment alignment)
{
interceptor.Invoke("connectVisualization#$$", "connectVisualization(QObject*, uint, Plasma::IntervalAlignment)", typeof(void), typeof(QObject), visualization, typeof(uint), pollingInterval, typeof(Plasma.IntervalAlignment), alignment);
}
示例4: ConnectSource
/// <remarks>
/// Connects a source to an object for data updates. The object must
/// have a slot with the following signature:
/// dataUpdated(stringsourceName, const Plasma.DataEngine.Data &data)
/// The data is a QHash of QVariants keyed by string names, allowing
/// one data source to provide sets of related data.
/// <param> name="source" the name of the data source
/// </param><param> name="visualization" the object to connect the data source to
/// </param><param> name="pollingInterval" the frequency, in milliseconds, with which to check for updates;
/// a value of 0 (the default) means to update only
/// when there is new data spontaneously generated
/// (e.g. by the engine); any other value results in
/// periodic updates from this source. This value is
/// per-visualization and can be handy for items that require
/// constant updates such as scrolling graphs or clocks.
/// If the data has not changed, no update will be sent.
/// </param><param> name="intervalAlignment" the number of ms to align the interval to
/// </param></remarks> <short> Connects a source to an object for data updates.</short>
public void ConnectSource(string source, QObject visualization, uint pollingInterval, Plasma.IntervalAlignment intervalAlignment)
{
interceptor.Invoke("connectSource$#$$", "connectSource(const QString&, QObject*, uint, Plasma::IntervalAlignment) const", typeof(void), typeof(string), source, typeof(QObject), visualization, typeof(uint), pollingInterval, typeof(Plasma.IntervalAlignment), intervalAlignment);
}
示例5: QueryMatch
/// <remarks>
/// Copy constructor
/// </remarks> <short> Copy constructor </short>
public QueryMatch(Plasma.QueryMatch other)
: this((Type) null)
{
CreateProxy();
interceptor.Invoke("QueryMatch#", "QueryMatch(const Plasma::QueryMatch&)", typeof(void), typeof(Plasma.QueryMatch), other);
}
示例6: SetType
/// <remarks>
/// Sets the type of match this action represents.
/// </remarks> <short> Sets the type of match this action represents.</short>
public void SetType(Plasma.QueryMatch.TypeOf type)
{
interceptor.Invoke("setType$", "setType(Plasma::QueryMatch::Type)", typeof(void), typeof(Plasma.QueryMatch.TypeOf), type);
}
示例7: SetImmutability
public void SetImmutability(Plasma.ImmutabilityType immutable)
{
applet.SetImmutability(immutable);
}
示例8: InitExtenderItem
public virtual void InitExtenderItem(Plasma.ExtenderItem item)
{
Console.WriteLine("Missing implementation of initExtenderItem in the applet {0}!",
item.Config().ReadEntry("SourceAppletPluginName", ""));
Console.WriteLine("Any applet that uses extenders should implement initExtenderItem to instantiate a widget.");
}
示例9: SetAspectRatioMode
/// <remarks>
/// Sets the preferred aspect ratio mode for placement and resizing
/// </remarks> <short> Sets the preferred aspect ratio mode for placement and resizing </short>
public void SetAspectRatioMode(Plasma.AspectRatioMode mode)
{
interceptor.Invoke("setAspectRatioMode$", "setAspectRatioMode(Plasma::AspectRatioMode)", typeof(void), typeof(Plasma.AspectRatioMode), mode);
}
示例10: AnimatedShow
/// <remarks>
/// Causes an animated show; requires compositing to work, otherwise
/// the dialog will simply show.
/// </remarks> <short> Causes an animated show; requires compositing to work, otherwise the dialog will simply show.</short>
public void AnimatedShow(Plasma.Direction direction)
{
interceptor.Invoke("animatedShow$", "animatedShow(Plasma::Direction)", typeof(void), typeof(Plasma.Direction), direction);
}
示例11: Open
public void Open(string file)
{
objects = new List<MapObject>();
BufferReader reader = new BufferReader(file);
if (Path.GetExtension(file) != ".adm")
{
throw new ArgumentException("File does not have *.adm extension.");
}
if (reader.ReadString() != "ADmapv2")
{
throw new ArgumentException("Not a valid Adrenaline map file.");
}
// general map info
this.version = reader.ReadByte();
this.gridSize = reader.ReadByte();
// spare slots
reader.Skip(15);
this.Name = reader.ReadString();
this.Author = reader.ReadString();
this.floorType = reader.ReadByte();
// objects
while (reader.HasMore())
{
string objectType = reader.ReadString();
int instances = (int)reader.ReadUShort();
for (int i = 0; i < instances; i++)
{
ushort x = reader.ReadUShort();
ushort y = reader.ReadUShort();
MapObject obj = null;
#region Object Creation
switch (objectType)
{
// pickups
case "objAbArmor":
obj = new BulletArmorPickup();
break;
case "objAbIncendary":
obj = new BulletIncendiaryPickup();
break;
case "objAbDefault":
obj = new BulletNormalPickup();
break;
case "objAbVelocity":
obj = new BulletVelocityPickup();
break;
case "objAnades":
obj = new GrenadePickup();
break;
case "objMedkit":
obj = new HealthPickup();
break;
case "objAeNormal":
obj = new LaserPickup();
break;
case "objAmines":
obj = new MinePickup();
break;
case "objApDisc":
obj = new PlasmaDiscPickup();
break;
case "objApFragma":
obj = new PlasmaFragmaPickup();
break;
case "objApHigh":
obj = new PlasmaHighPickup();
break;
case "objApNormal":
obj = new PlasmaNormalPickup();
break;
case "objAmNormal":
obj = new RocketDualPickup();
break;
case "objAmNade":
obj = new RocketNukePickup();
break;
case "objAcSniper":
obj = new SniperPickup();
break;
case "objAeSuper":
obj = new SuperLaserPickup();
break;
// static
case "objSpawn":
obj = new AllSpawn();
break;
case "objFlagBlue":
obj = new BlueFlag();
break;
case "objFlagRed":
obj = new RedFlag();
break;
//.........这里部分代码省略.........
示例12: ScalingFactor
/// <remarks>
/// </remarks> <return> the scaling factor (0..1) for a ZoomLevel
/// </return>
/// <short> </short>
public static double ScalingFactor(Plasma.ZoomLevel level)
{
return (double) staticInterceptor.Invoke("scalingFactor$", "scalingFactor(Plasma::ZoomLevel)", typeof(double), typeof(Plasma.ZoomLevel), level);
}
示例13: PackageStructure
/// <remarks>
/// Loads an appropriate PackageStructure for the given language and type
/// <param> name="language" the language to load the PackageStructure for
/// </param><param> name="type" the component type
/// </param></remarks> <return> a guarded PackageStructure pointer
/// </return>
/// <short> Loads an appropriate PackageStructure for the given language and type </short>
public static Plasma.PackageStructure PackageStructure(string language, Plasma.ComponentType type)
{
return (Plasma.PackageStructure) staticInterceptor.Invoke("packageStructure$$", "packageStructure(const QString&, Plasma::ComponentType)", typeof(Plasma.PackageStructure), typeof(string), language, typeof(Plasma.ComponentType), type);
}
示例14: LocationToInverseDirection
/// <remarks>
/// Converts a location to the direction facing it. Handy for figuring out which way to collapse
/// a popup or to point arrows at the item itself.
/// <param> name="location" the location of the container the element will appear in
/// </param></remarks> <return> the visual direction the element should be oriented in
/// </return>
/// <short> Converts a location to the direction facing it.</short>
public static Plasma.Direction LocationToInverseDirection(Plasma.Location location)
{
return (Plasma.Direction) staticInterceptor.Invoke("locationToInverseDirection$", "locationToInverseDirection(Plasma::Location)", typeof(Plasma.Direction), typeof(Plasma.Location), location);
}
示例15: Run
/// <remarks>
/// Runs a given match
/// @arg match the match to be executed
/// </remarks> <short> Runs a given match @arg match the match to be executed </short>
public void Run(Plasma.QueryMatch match)
{
interceptor.Invoke("run#", "run(const Plasma::QueryMatch&)", typeof(void), typeof(Plasma.QueryMatch), match);
}