Anatomy of a Skin スキンの解剖学

The goal of this guide is to familiarize users who are new to Rainmeter with what a Rainmeter skin is, and how it works. This is not intended to be comprehensive, but at a level of detail that will help users grasp the fundamentals of Rainmeter. Once you understand what a Rainmeter skin "is", it will be far easier to come to terms with the huge amount of options and functionality described in detail in the rest of the documentation.このガイドの目的は、Rainmeterに慣れていないユーザーに、Rainmeterスキンとは何か、そしてそれがどのように機能するのかを理解することです。これは包括的であることを意図していませんが、ユーザーがRainmeterの基本を理解するのを助けるであろう詳細なレベルで。Rainmeterスキンが「何」であるかを理解すれば、残りのドキュメントで詳細に説明されている膨大な量のオプションと機能性を理解することがはるかに容易になるでしょう。

The skin windowスキンウィンドウ

In a simplified sense, each skin in Rainmeter is a free-floating window, which periodically gathers system and other information using various Measures, and displays the results on the window with various Meters.簡単に言うと、Rainmeterの各スキンは、さまざまな測定値を使用してシステムやその他の情報を定期的に収集し、さまざまなメーターを使用して結果をウィンドウに表示する、フローティングウィンドウです。

So at its most basic, measures are "input" and meters are "output". That is Rainmeter in a nutshell.したがって、最も基本的には、測定値は「入力」でメーターは「出力」です。それは一言で言えばRainmeterです。

While the skin can simply obtain information and display it, the skin can also react to changing values in the information it measures, or react to your mouse clicks. The skin can be very visibly dynamic and interactive.スキンは単に情報を取得して表示することができますが、スキンは測定する情報の値の変化に反応したり、マウスクリックに反応したりすることもできます。スキンは非常に視覚的に動的かつインタラクティブにすることができます。

How a skin is writtenスキンの書き方

Let's start with what a skin file looks like. Rainmeter uses a standard plain-text .INI format that consists of only three types of lines:スキンファイルの外観から始めましょう。Rainmeterは、3種類の行だけで構成される標準のプレーンテキストの.INI形式を使用します。

[SectionName]
OptionName=Option Value
;Comment[SectionName]
OptionName =オプション値
;コメント

There are only a few rules for the .INI format:.INI形式にはいくつかの規則しかありません。

  • All section names in a skin must be unique.スキン内のすべてのセクション名は一意でなければなりません。
  • All option names within a section must be unique.セクション内のすべてのオプション名は一意でなければなりません。
  • Section and option names should include alphanumeric characters only (no spaces or punctuation).セクション名とオプション名には、英数字のみを含める必要があります(スペースや句読点は使用できません)。
  • Option values must be kept on a single line.オプション値は1行に収める必要があります。

The following is an example of a very simple Rainmeter skin file. It updates the skin once a second, measures the used CPU as a percentage, and displays that percentage.以下は非常に単純なRainmeterスキンファイルの例です。1秒に1回スキンを更新し、使用されたCPUを割合として測定し、その割合を表示します。

[Rainmeter]
Update=1000

[MeasureCPU]
Measure=CPU

[MeterCPU]
Meter=String
MeasureName=MeasureCPU

There are six types of [Sections][セクション]には6種類あります

[Rainmeter]
This section will always be named [Rainmeter], and is used as sort of a header for the skin, to set up some options that impact the entire skin. This might be things like the update rate of the skin, the background color or image for the skin, or actions you want to take when something happens to the entire skin.[Rainmeter]
このセクションは常に[Rainmeter]という名前になり、スキン全体に影響を与えるいくつかのオプションを設定するために、スキンの一種のヘッダとして使用されます。これは、スキンの更新レート、スキンの背景色や画像、スキン全体に何か問題が発生したときに実行するアクションなどです。

[Rainmeter] section details.[Rainmeter]セクションの詳細

[Metadata]
This section will always be named [Metadata], and is used to provide information about your skin. The author's name, the version number, configuration or usage instructions and other information. This information will be visible when someone selects your skin in the Rainmeter Manage window.[Metadata]
このセクションは常に[Metadata]という名前になり、スキンに関する情報を提供するために使用されます。作者の名前、バージョン番号、設定または使用方法の説明、その他の情報。この情報は、他のユーザーが[Rainmeter管理]ウィンドウで自分のスキンを選択したときに表示されます。

[Metadata] section details.[メタデータ]セクションの詳細

[Variables]
This section will always be named [Variables], and is used to define values that can be used anywhere in the skin by enclosing the variable name inside #PoundSigns#. This can be helpful to create a value that you want to use many places in the skin, while allowing you to change it in only one place. A simple example might be:[変数]
このセクションは常に[変数]という名前になり、#PoundSigns#で変数名を囲むことによってスキンのどこでも使用できる値を定義するために使用されます。これを使用すると、スキン内のさまざまな場所で使用する値を作成しながら、1か所だけで値を変更できます。簡単な例は次のとおりです。

[Variables]
MyFontColor=255,255,255,255

[MeterOne]
Meter=String
FontColor=#MyFontColor#

[MeterTwo]
Meter=String
FontColor=#MyFontColor#

[Variables] section details.[変数]セクションの詳細

[MeterStyles]
These sections can have any unique name, and are similar to [Variables] in function. They allow you to set up "styles" for meters where you can for instance define some or all of the "formatting" options for your meters, and use the MeterStyle in many meters while again allowing you to only have to change it in one place. A simple example might be:[MeterStyles]
これらのセクションは任意のユニークな名前を持つことができ、機能的には[Variables]に似ています。それらはあなたが例えばあなたのメーターのための "フォーマット"オプションのいくつかあるいはすべてを定義することができるメーターのための "スタイル"を設定することを可能にします。 。簡単な例は次のとおりです。

[MyTextStyle]
FontFace=Arial
FontSize=12
FontColor=255,255,255,255
AntiAlias=1

[MeterOne]
Meter=String
MeterStyle=MyTextStyle

[MeterTwo]
Meter=String
MeterStyle=MyTextStyle

[MeterStyle] section details.[MeterStyle]セクションの詳細

[Measures]
These sections can have any unique name, and are used to "measure" some system or other information. There are many measure types, defined by the value of the Measure=MeasureType option on the section.[対策]
これらのセクションには一意の名前を付けることができ、システムやその他の情報を「測定する」ために使用されます。Measure=MeasureTypeセクションのオプションの値によって定義された、多くのメジャータイプがあります。

There are two kinds of options used on a measure. There are general measure options that define behaviors for most or all measure types, and measure options that are specific to the type of measure. These specific options are explained in the manual section for each measure type. Some simple examples might be:メジャーには2種類のオプションがあります。あり、一般的な対策オプションほとんどの行動やすべてのメジャータイプ、および測定の種類に固有の測定オプションを定義します。これらの特定のオプションは各小節タイプのマニュアルセクションで説明されています。いくつかの簡単な例は次のようになります。

[MeasureDateTime]
Measure=Time
Format=%A, %B %#d, %Y %#I:%M %p

[MeasureFreeDriveC]
Measure=FreeDiskSpace
Drive=C:

[Measures] section details.[対策]セクションの詳細。

[Meters]
These sections can have any unique name, and are used to "display" things in the skin window. Most often, a meter will be used to display some information obtained by a measure, which is done by "binding" the meter to one or more measures with the MeasureName=SomeMeasure option. A simple example might be:[メーター]
これらのセクションは任意のユニークな名前を持つことができ、スキンウィンドウにものを「表示する」ために使用されます。ほとんどの場合、メジャーによって得られた情報を表示するためにメーターが使用されます。これは、MeasureName=SomeMeasureオプションを使用してメーターを1つ以上のメジャーに「バインド」することによって行われます。簡単な例は次のとおりです。

[MeasureDateTime]
Measure=Time
Format=%A, %B %#d, %Y %#I:%M %p

[MeterDateTime]
Meter=String
MeasureName=MeasureDateTime

The meter [MeterDateTime] is "bound" to the measure [MeasureDateTime], and will display the current value of the measure as it changes.メーター[MeterDateTime]は、メジャー[MeasureDateTime]に「バインド」されており、メジャーの現在の値が変化するにつれて表示されます。

There are many meter types, defined by the value of the Meter=MeterType option on the section. These can display information as strings of text, various kinds of graphs, images you associate with values, interactive buttons or even animations. While a meter is most often used to display the results of measures "bound" to the meter. They can also be used to display text or images you define yourself. Meters are the "paint", the skin window is the "canvas".Meter=MeterTypeセクションのオプションの値によって定義された多くの種類のメーターがあります。これらは、情報をテキストの文字列、さまざまな種類のグラフ、値に関連付ける画像、インタラクティブボタン、さらにはアニメーションとして表示できます。メーターは、メーターに「バインド」されている測定結果を表示するために最もよく使用されますが。自分で定義したテキストや画像を表示するためにも使用できます。メーターは「ペンキ」、スキンウィンドウは「キャンバス」です。

There are two kinds of options used on a meter. There are general meter options that define behaviors for most or all meter types, and meter options that are specific to the type of meter. These specific options are explained in the manual section for each meter type.メーターには2種類のオプションがあります。あり、一般的なメーターのオプションほとんどの行動やすべてのメーターの種類、メーターの種類に固有のメーターオプションを定義します。これらの特定のオプションは、各メータータイプのマニュアルセクションで説明されています。

[Meters] section details.[メートル]セクションの詳細

How a skin behavesスキンのしくみ

The easiest way to envision how a skin works is to picture it in a big "loop".スキンがどのように機能するかを想像する最も簡単な方法は、大きな「ループ」でスキンを描くことです。

In the [Rainmeter] section of the skin, you will define an Update rate, which is how often, in milliseconds, that the "loop" will be run by Rainmeter for that skin. How often the skin will be "updated" by Rainmeter.スキンの[Rainmeter]セクションで、更新レートを定義します。これは、そのスキンに対して "ループ"がRainmeterによって実行される頻度(ミリ秒)です。どのくらいの頻度でスキンがRainmeterによって "更新"されるでしょう。

If you for instance have the default Update=1000 in [Rainmeter], then once a second (every 1000 milliseconds) Rainmeter will:たとえばUpdate=1000、[Rainmeter]にデフォルト値がある場合、1秒に1回(1000ミリ秒ごと)、Rainmeterは次のことを行います。

  1. Start the update cycle.更新サイクルを開始してください。

  2. Update measures
    Each measure in the skin, in the order they are in the skin .ini file, will be updated. They will perform whatever work they are designed to do, and will then have a "value" that is the result.

    You can further control how often a measure is updated by adding an UpdateDivider option to the measure. This will in effect say "update this measure only every UpdateDivider skin updates". It is a way to have a measure that doesn't need to update once a second for instance, update once a minute or once an hour instead.
    メジャーの更新スキン内の各メジャーは、スキンの.iniファイル内にある順序で更新されます。彼らは彼らがするように設計されているどんな仕事でも実行します、そしてその結果である「価値」を持っているでしょう。

    メジャーにUpdateDividerオプションを追加することで、メジャーが更新される頻度をさらに制御できます。これは実質的に「UpdateDividerスキンの更新があるたびにのみこの指標を更新する」と言うでしょう。たとえば、1秒に1回更新する必要がない、1分に1回更新、または1時間に1回更新するメジャーを使用する方法です。


  3. Update meters
    Each meter in the skin, in the order they are in the skin .ini file, will be updated. They will get the current values of any measures they are "bound" to, and apply any meter options to the result. At this point the meter is ready to be displayed.
    メーターの更新スキンの各メーターは、スキンの.iniファイルにある順に更新されます。彼らは、彼らが「束縛されている」あらゆる小節の現在の値を得て、そして結果にあらゆるメーターオプションを適用します。この時点でメーターは表示される準備ができています。


  4. Redraw the skin
    The entire skin window, any skin background set in [Rainmeter], and all meters, in the order they are in the skin .ini file, will be "redrawn". The order that meters are in the skin .ini file can be important, as meters that overlap will visibly be in the "front to back" order that they are in the code. First behind, last in front.スキンに再描画
    全体のスキンのウィンドウ、[Rainmeter]で設定した任意のスキンの背景、およびすべてのメーターを、彼らはスキン.iniファイルであるためには、「再描画」になります。メーターがスキンの.iniファイル内にある順序は重要です。重なっているメーターは、コード内に表示されている順に「前後に」並んでいるためです。最初の後ろ、最後の前。


  5. Restart the update cycle.更新サイクルを再開してください。

Yes, it does all that in the space of a second, and in fact can do the entire update cycle in far less than a second. Rainmeter is very efficient, and computers are really, really fast...はい、それはすべてのことを1秒のスペースで行います。実際、更新サイクル全体を1秒未満で実行できます。Rainmeterは非常に効率的です、そしてコンピュータは本当に、本当に速いです...

That is all you need to know for the basics of how a Rainmeter skin behaves. If you understand what we have so far, how to measure things, how to display things, and how the skin updates to gather and display the changing results, you are off to a great start. This is an important "foundation" that we can now build on.Rainmeterスキンがどのように振る舞うかの基本について知る必要があるのはこれだけです。私たちがこれまでに持ってきたこと、物事を測定する方法、物事を表示する方法、そして変化する結果を集めて表示するためにスキンがどのように更新されるかを理解したなら、あなたは素晴らしいスタートを切ります。これは私達が今構築することができる重要な「基礎」です。

Actions in a skinスキンの中のアクション

So your skin might be kind of boring if it is just measuring some value and displaying the result. As useful as just that is, the real power of Rainmeter is having your skin react to changing values in a dynamic way, and in allowing you to dynamically interact with the skin with your mouse. This is done by setting "action" options on measures and meters.

There are two primary kinds of action options:それで、それは単にそれがある値を測定しそして結果を表示しているならばあなたのスキンは一種の退屈であるかもしれません。まさにそれと同じくらい便利です、Rainmeterの本当の力はあなたのスキンが動的な方法で変化する値に反応すること、そしてあなたがあなたのマウスで動的にスキンと対話することを可能にすることです。これは、小節とメーターに「動作」オプションを設定することによって行われます。

アクションオプションには主に2つの種類があります。

Measure actions
These are options that in a sense "test" the value or state of the measure they are on, and take actions, which are bangs or commands, based on that test being "true" or "false". These actions are evaluated and executed on each update of the measure. There are several types of actions for measures, which are detailed in the rest of the documentation. Certainly you can test if a measure's current value is above or below some range you define, contains some string of text you define, or has changed since the last update.メジャーアクション
これらは、ある意味でそれらがオンになっているメジャーの値または状態を「テスト」し、そのテストが「true」または「false」であることに基づいて前髪またはコマンドであるアクションを実行するオプションです。これらのアクションは、数値データが更新されるたびに評価および実行されます。対策にはいくつかの種類のアクションがあります。これについては、残りの資料で詳しく説明しています。メジャーの現在の値が、定義した範囲を超えているか下回っているか、定義しているテキストの文字列が含まれているか、最後の更新以降に変更されているかをテストできます。

A simple example might be:簡単な例は次のとおりです。

[MeasureCPU]
Measure=CPU
IfCondition=MeasureCPU > 60
IfTrueAction=[!SetOption MeterCPU FontColor "255,0,0"]
IfFalseAction=[!SetOption MeterCPU FontColor "0,255,0"]

If the value of [MeasureCPU] is greater than 60, then change the FontColor of the String meter [MeterCPU] to "red", if not, change it to "green".[MeasureCPU]の値が60より大きい場合は、文字列メーター[MeterCPU]のFontColorを "red"に変更し、そうでない場合は "green"に変更します。

Measure Action details.アクション詳細を測定します。

Mouse actions
These are options you put on meters, (or the skin background) that can react to various kinds of mouse hovers, clicks and scrolls, and take actions, which are bangs or commands. These action are immediate, when the mouse action is detected by the meter, and do not have to wait for the next skin or meter update cycle. This can make your skin very dynamic indeed to user interaction.マウスアクション
これらはメーター(またはスキンの背景)に付けるオプションで、さまざまな種類のマウスホバー、クリックおよびスクロールに反応したり、強打やコマンドのようなアクションを実行したりできます。マウスの動作がメーターによって検出されると、これらの動作は即座に行われ、次のスキンまたはメーターの更新サイクルを待つ必要はありません。これはあなたのスキンを確かにユーザーインタラクションに対して非常にダイナミックにすることができます。

A simple example might be:簡単な例は次のとおりです。

[MeterCPU]
Meter=String
FontColor=0,255,0
MouseOverAction=[!SetOption MeterCPU FontColor "255,0,0"]
MouseLeaveAction=[!SetOption MeterCPU FontColor "0,255,0"]
LeftMouseUpAction=["taskmgr.exe"]

Mouse Action details.マウスアクションの詳細

There are two kinds of actions you can take when an action option is executed:アクションオプションが実行されたときに実行できるアクションは2種類あります。

Bangs
These are internal Rainmeter commands, that allow you do a wide range of things in your skin. You might want to change some formatting option on a meter, set or change a variable value, hide or show meters, disable or enable measures, even load and unload skins. Multiple bangs can be executed by one action option by simply enclosing them in [Square brackets].前髪
これらはあなたがあなたのスキンの中で広範囲のことをすることを可能にする内部のRainmeterコマンドです。メーターの書式設定オプションの変更、変数値の設定または変更、メーターの非表示または表示、メジャーの無効化または有効化、さらにはスキンのロードとアンロードを行うことができます。[角括弧]で囲むだけで、複数の前髪を1つのアクションオプションで実行できます。

There are a great many bangs, each of which is described in the manual.非常に多くの前髪があり、それぞれがマニュアルに記載されています。

Bang details.バンの詳細

Commands
In addition, you can have an action option execute any external command to the Windows operating system. This is what allows you to create an "application launcher" in Rainmeter, by simply having a meter that for instance displays an image of a calculator run the program "calc.exe" when clicked. You can also open a web site in your default browser by simply executing the URL as a Windows command.

Some simple examples might be:コマンド
さらに、アクションオプションを使用して、Windowsオペレーティングシステムに対する外部コマンドを実行することもできます。これは、たとえば計算機の画像を表示するメーターをクリックするとプログラム "calc.exe"を実行するだけで、Rainmeterで "アプリケーションランチャー"を作成できるようにするものです。WindowsコマンドとしてURLを実行するだけで、デフォルトのブラウザでWebサイトを開くこともできます。

いくつかの簡単な例は次のようになります。

LeftMouseUpAction=["C:\Program Files\WinRar\WinRar.exe"]
LeftMouseUpAction=["http://cnn.com"]

Hopefully this will get you off and running with Rainmeter skins. There are other areas of how the application itself works that are important to understand, and the Getting Started and User Interface sections of the manual are important references. Don't skip them.うまくいけば、これはあなたを降ろしてRainmeterスキンで走らせるでしょう。アプリケーション自体がどのように機能するかを理解するのに重要な他の領域があります。また、マニュアルの「はじめに」および「ユーザインタフェース」のセクションは重要な参考資料です。スキップしないでください。


Continue to: Basic Tutorials » « Back to: Creating Skins

関連記事

スポンサーリンク

/data/anr/traces.txtファイルとは

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る