Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3624447B2 - Component generation source program generation device - Google Patents
[go: Go Back, main page]

JP3624447B2 - Component generation source program generation device - Google Patents

Component generation source program generation device Download PDF

Info

Publication number
JP3624447B2
JP3624447B2 JP03114995A JP3114995A JP3624447B2 JP 3624447 B2 JP3624447 B2 JP 3624447B2 JP 03114995 A JP03114995 A JP 03114995A JP 3114995 A JP3114995 A JP 3114995A JP 3624447 B2 JP3624447 B2 JP 3624447B2
Authority
JP
Japan
Prior art keywords
source code
generation
source
widget
setting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP03114995A
Other languages
Japanese (ja)
Other versions
JPH08227358A (en
Inventor
瑞直 石川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP03114995A priority Critical patent/JP3624447B2/en
Publication of JPH08227358A publication Critical patent/JPH08227358A/en
Application granted granted Critical
Publication of JP3624447B2 publication Critical patent/JP3624447B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

【0001】
【産業上の利用分野】
本発明はGUI用プログラムのソースコードの、GUI部品生成部分の自動生成に関する。
コンピュータをより使い易くするために、画面上の表示を文字中心ではなく、画像中心にし、マウスのようなポインティングデバイスにより操作を行う、所謂GUIが広く取り入れられている。
【0002】
GUIを採用することにより、エンドユーザにとってコンピュータの使い勝手は格段に向上したが、GUI画面の作成や、マウスからの入力の認識等、プログラマーに対する付加が増大した。
そのため、GUI画面を構成する部品を予め準備しておき、それを選択的に画面に配置することで、画面作成を容易に行い、さらに作成した画面からその画面を構成する部品の生成処理等に対応するソースプログラムを自動的に生成する技術が現れた。
【0003】
本発明は、GUI画面を構成する部品の生成処理に対するソースプログラムの自動生成に関する。
【0004】
【従来の技術】
ところで、画面を構成する部品は複数の属性によって定義されている。部品の属性に対する値の設定は部品の生成前の行うものもあれば、生成後に行うものもある。
従来のソースコード生成装置では、部品の属性に対する値の設定に関するソースコードの出力順序の制御は、ソースコード生成装置を制御するプログラムの条件判定及び分岐により、部品毎、属性毎に個々に固定的に処理されていた。
【0005】
【発明が解決しようとする課題】
しかしながら、このような固定的な処理では、使用可能な部品が増加した場合、その部品の生成に関するソースコードの自動生成を可能にするためには、ソースコード生成装置を制御するプログラム自身を変更しなければならないという問題点があった。
【0006】
そこで本発明は、画面を構成する部品が追加された場合でも、容易にその部品の生成に関するソースコードを自動生成することを可能にする事を目的としている。
【0007】
【問題点を解決するための手段】
図1は本発明の原理説明図である。
図中1は、ソースコード生成部であり、入力された画面定義情報を解析して、部品の生成に関するソースコード及び部品の属性の設定に関するソースコードを生成するとともに、属性設定順序情報に基づき、生成したソースコードに順序情報を付加するものである。
【0008】
2は、ソースコード出力部であるり、部品生成前属性設定用ソースコード出力部3と、部品生成用ソースコード出力部4と、部品生成後属性設定用ソースコード出力部5とからなる。
部品生成前属性設定用ソースコード出力部3はソースコード生成部1の生成したソースコードのうち、順序情報として部品生成前出力が示されている属性の設定に関するソースコードを出力する。部品生成用ソースコード出力部4はソースコード生成部1で生成されたソースコードのうち、部品の生成に関するソースコードを出力する。部品生成後属性設定用ソースコード出力部5はソースコード生成部1の生成したソースコードのうち、順序情報として部品生成後出力が示されている属性の設定に関するソースコードを出力する。
【0009】
【作用】
本発明では、ソースコード生成部1が画面定義情報を解析し、各部品に属性の設定および部品の生成に関するソースコードを生成する。この際、生成する属性の設定に関するソースコードには設定値管理ソースコード出力順序情報に基づき順序情報を付加しておく。
【0010】
ソースコード生成部1においてソースコードの生成が完了すると、次にソースコード出力部2において、生成されたソースコードを出力する。出力は順序情報を参照しつつ、まず部品生成前設定ソースコード出力部3が部品の生成処理以前に処理すべき属性への設定処理に対するソースコードを出力する。次いで、部品生成ソースコード出力部4が部品の生成に関するソースコードを出力し、最後に部品生成後設定ソースコード出力部5が部品の生成処理後に値を設定する属性に対する値の設定処理に対するソースコードを出力する。
【0011】
【実施例】
本実施例はOSF/Motif 用のアプリケーションプログラムをC言語で記述することを対象としている。まずOSF/Motif について説明する。
OSF/Motif はX Window System のGUI規格の1つである。X Window System はマサチューセッツ工科大学(MIT) により開発されたUNIX上でのグラフィカル・ウィンドウシステムである。OSF/Motif はOpen Software Foundation(OSF) により開発されたX Window System 用のGUI規格である。
【0012】
OSF/Motif はX Window System 上でのアプリケーション開発を支援するツールキット、ウィンドウマネージャ、UIL(User Interface Lnaguage)およびアプリケーケョン開発におけるガイドラインを定義したスタイルガイドからなる。
OSF/Motif のツールキットは、ウィジェット(Widget)と呼ばれるユーザインタフェイスのコンポーネントとそれらを使用するための関数群から構成されている。ウィンドウマネージャは画面上でウィンドウをオープンしたり、オープンしたウィンドウのサイズを変更したり、移動したり、クローズしたりする各種GUI操作のためのユーザインタフェイスを提供するものである。また、UIL はアプリケーションの画面を作成するための専用の言語で、C言語等のプログラミング言語よりも簡単な言語仕様になっている。スタイルガイドは、アプリケーションプログラムやウィンドウマネージャ等を設計する際の設計原則や注意事項を記載したマニュアルである。
【0013】
ウィジェットはユーザインタフェイスを機能別にまとめた部品である。ウィジェットには文字列表示域、各種ボタン、テキスト入力域、スクロールバーなどの基本的なウィジェットの他に、これらのウィジェットを複数組み合わせるための入れ物的な役割を持ったコンテナウィジェットがある。ウィンドウ内に複数のボタンやテキスト入力域を持つ画面を作成する場合には、コンテナウィジェットとボタンやテキスト入力域のウィジェットを組み合わせて画面を構成する。
【0014】
それぞれのウィジェットはクラスと呼ばれる抽象的なデータ型として定義されており、そのままでは実際の部品としてプログラム中で使用することはできない。そのため、ウェジェットを使用する場合には使用する前にインスタンス(実体)を生成する必要がある。
OSF/Motif ではウィジェットクラスのインスタンスを作成するための関数が用意されいる。例えばプッシュボタンのウィジェットクラスのインスタンスを作成するには、XmCreatePushButton関数を使用する。
【0015】
各ウィジェットには、そのウェジッェトの持つ機能や性質を定義する属性がある。OSF/Motif ではこの属性のことをリソースと呼ぶ。ウィジェットクラスで提供されるリソースに値を設定すればウィジッェトの外観や振る舞いを変更することができる。そういう意味で、リソースはウィジェットをカスタマイズするためのデータということもできる。
【0016】
画面設計を行う場合には公知のビルダと呼ばれる画面設定ツールを用いる。ビルダは画面を見ながらウィジェットの配置を行うものである。ビルダは配置されたウィジェットをもとに、UIL で記述された画面定義を出力する。
UIL で記述された画面定義には、ウィジェットのインスタンスに付与される名前や、ウィジェットへの値の設定等が含まれている。
【0017】
UIL で記述された画面定義の一例を図10に示す。
図中、行番号01において、”object”はウィジェットの定義の開始を意味している。”object”に続く文字列でウィジェットのインスタンス名前を表す。この場合はウィジェットのインスタンスの名前は”Button1” である。続く文字列は使用するウィジェットクラスの名前である。この場合はウィジェットクラスの名前は”XmPushButton”である。
【0018】
すでに説明したとおり、ウィジェットクラスは抽象的なデータ型であり、それを具現化した実体のことをインスタンスと呼ぶ。
行番号02において、”arguments” に続く ”{” から対応する行番号11” }” までの間には、このウィジェットのリソースに対する値の設定が等式を用いて記述される。式の左辺にはリソース名が記述され、右辺には定数等が記述される。図中では、例えば”XmNbottomAttachment” というリソースに対して ”XmATTACH_FORM” という定数を設定することを示している。UILからウィジェットの生成に関するソースコードを自動生成するのが本発明のGUI用ソースコード生成装置の役割であるといえる。
【0019】
アプリケーションプログラム内からリソースを設定するには、ウィジェット作成時にインスタンス生成関数にパラメータとして渡す場合と、作成後のウィジェットに対しリソース設定関数を使用して設定する場合とがあり、この場合分けを効率よく行う必要がある。
以上、OSF/Motif 及びX Window System につてい簡単に説明したが、これらについては数多くの書籍や雑誌が出版されているので、より詳しくはそれらの書籍や雑誌を参照されたい。
【0020】
続いて本発明の一実施例について説明する。
図2は本発明の一実施例の構成を示す図である。図中11はビルダであり、会話的に画面定義情報を生成するものである。12はビルダ11によって定義されたUIL形式の画面定義情報を記憶するUILファイルである。
13はUILファイルを読み込みC言語のソースプログラムを生成するGUI用ソースコード生成装置である。14はUILファイルを解析しソースコードを生成するソースコード生成部であって、構文解析部15および出力データ生成部16からなっている。
【0021】
構文解析部15はUILファイルを読み込みながら構文解析を行い、図3に示す形式でウィジェット情報記憶域23にウィジェット及びそのリソースに関する情報を記憶する。出力データ生成部16はウィジェット情報記憶域23に記憶されたウィジェット毎、リソース毎にソースコードを生成して記憶する。部品生成に関するソースコードは図3中ウィジェット生成ソース32−aに記憶される。またリソースに関するソースコードは同図中34−cに記憶される。
【0022】
なお、ソースコードの生成は、ウィジェットクラス毎に、ウィジェット及び個々のリソース毎にソースコード生成用の処理を準備しておき、それを呼び出すことで行う。
出力データ生成部16はさらに、生成したソースコードに対して、設定値管理テーブル17よりソースコードのもととなったリソースに対応するアクセス条件を検索し、図3中のアクセス条件34−dとして記憶する。
【0023】
18はソースコード出力部であり、ウィジェット生成前処理用ソース出力部19とウィジェット生成処理用ソース出力部20と、ウィジェット生成後処理用ソース生成部21とからなる。ソースコード出力部から出力されたソースコードはソースファイル22に記憶される。
ここで設定値管理テーブル17およびウィジェット情報記憶域23について説明する。まず、設定値管理テーブル17について図4を用いて説明する。
【0024】
設定値管理テーブル17はリソース毎にアクセス条件及びデータタイプを示したテーブルである。
アクセス条件は、Cフラグ、Sフラグ、Gフラグの組み合わせで表される。Cフラグはリソースに対する値の設定を、ウィジェットの生成前に行う必要があることを示している。Sフラグはウィジェット生成後にリソースの値を変更できることを示している。Gフラグはリソースの値が参照可能であることを示している。なお、Gフラグについては本発明とは直接の関係はない。
【0025】
次に、ウィジェット情報記憶域23におけるデータの格納の形式について図3用いて説明する。
図3中、31はウィジェット管理テーブル、32はウィジェット情報、33はリソース管理テーブル、34はリソース情報である。
ウィジェット管理テーブル31は複数のウィジェット情報へのポインタのテーブルである。
【0026】
ウィジェット情報はウィジェット名32−a、リソース管理テーブルへのポインタ32−b、ウィジェットソース32−cを保持する。構文解析部15における構文解析の結果得られたウィジェット名はウィジェット名32−aに記憶される。出力データ生成部16で生成されたウィジェットの生成に関するソースコードはウィジェットソース32−aに記憶される。
【0027】
リソース管理テーブル33は複数のリソース情報34へのポインタのテーブルである。
リソース情報34はリソース名34−a、出力データ34−b、リソース設定ソース34−c、アクセス条件34−dを保持する。構文解析部15における構文解析の結果得られたリソース名はリソース名34−aに記憶される。出力データ生成部16で生成されたリソースの設定に関するソースコードはリソース設定ソース34−cに記憶される。出力データ34−bにはリソースに対して設定する値が記憶される。アクセス条件34−dには設定値管理テーブル17より検索されたアクセス条件が記憶される。
【0028】
次に、本実施例の処理の流れに沿って説明する。
アプリケーション作成者はまず、ビルダ11を用いて会話的に画面設計を行う。ビルダ11を用いた会話的な画面設計とは、マウスを操作して画面上でウィジェットの配置を試行錯誤的に行うことである。
画面設計が完了すると、すなわち、ウィジェットの配置が完了すると、ビルダ11は配置されたウィジェットに対応するUIL形式の画面定義情報をUILファイル12に出力する。
【0029】
次にソースコード生成部14が処理を行う。ソースコード生成部14の処理を図5に示すフローチャーとを用いて説明する。
ステップS51において、構文解析部15がUILファイル12を読み込みながら構文解析を行い、その結果をウィジッェト情報記憶域23に図3で示した形式で格納する。
【0030】
例えば図10に示すUILファイルを解析した場合、あるウィジェット情報32のウィジェット名32−aには”Button1” が格納され、その配下に7つのリソース情報34がポイントされる。各リソース情報34のリソース名34−aには、それぞれ”XmNlabelPixmap”、”XmNlabelType”、”XmNforeground” 、”XmNbottomAttachment” 、”XmNleftAttachment” 、”XmNrightAttachment”、”XmNtopAttachment”が格納される。
【0031】
続いて出力データ生成部16がステップS52〜S56の処理を行う。すなわち、ステップS53において、ウィジェットの生成に関するソースコードを生成し、ウィジェット生成ソース32−aに格納する。続いてステップS55において、リソースの設定に関するソースコードを生成し、リソース設定ソース43−cに格納する。その後、リソース名34−aで設定値管理テーブル17を検索し、対応するアクセス条件を得て、アクセス条件34−dに格納する。
【0032】
図10に示した”Button1” について処理を行うと以下の通りとなる。すなわち、リソース”XmNlabelPixmap”については、出力データとして”/home/ishikawa/bitmaps/logo” が、リソース設定ソースとして、図11中の行番号17、18、19のソースコードが、アクセス条件としてSフラグ及びGフラグが記憶される。リソース”XmNlabelType”については、出力データとして”XmPIXMAP”が、リソース設定ソースとして、図11中の行番号02、03のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
【0033】
リソース”XmNforeground” については、出力データとして”#ffff00000000” が、リソース設定ソースとして、図11中の行番号04、05、06のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
リソース”XmNbottomAttachment” については、出力データとして ”XmATTACH_FORM” が、リソース設定ソースとして、図11中の行番号07、08のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
【0034】
リソース”XmNleftAttachment” については、出力データとして ”XmATTACH_FORM” が、リソース設定ソースとして、図11中の行番号09、10のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
リソース”XmNrightAttachment”については、出力データとして ”XmATTACH_FORM” が、リソース設定ソースとして、図11中の行番号11、12のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
【0035】
リソース”XmNtopAttachment”については、出力データとして ”XmATTACH_FORM” が、リソース設定ソースとして、図11中の行番号13、14のソースコードが、アクセス条件としてSフラグ、Cフラグ、Gフラグが記憶される。
ソースコード生成部14の処理が終了すると、続いてソースコード出力部18の処理を行う。図6を用いてソースコード出力部18の処理の説明を行う。
【0036】
ソースコード出力部18処理は全てのウィジェットについて3つの処理を繰り返し行う。即ち、ステップS62において、ウィジェット生成前処理用ソースコードを出力し、次にステップS63において、ウィジェット生成処理用ソースコードを出力し、最後にステップS64において、ウィジェット生成後処理用ソースコードを出力する。
【0037】
ステップS62、ステップS63、ステップS64の処理は、それぞれウィジェット生成前処理用ソース出力部19、ウィジェット生成処理用ソース出力部20、ウィジェット生成後処理用ソース出力部21が行う。
ウィジェト生成前処理用ソース出力部19で行うステップS62の処理の詳細を図7を用いて説明する。
【0038】
先ずステップS71において、リソースに値を設定する為の処理の前処理のためのソースコードを出力する(図11中、行番号01に対応)。
続いてステップS72からS74において、ウィジェット生成前に設定すべきリソースの設定に関するソースコード出力を行う。すなわち、ステップ73において、図3のリソース設定ソース34−cに記憶されているソースコードを出力し、出力が完了するとステップS74でそれをリソース設定ソース34−cから消去する。この消去は出力完了を意味する。この処理をステップS72において終了判定をするまで繰り返す。
【0039】
ウィジェト生成処理用ソース出力部20で行うステップS63の処理の詳細を図8を用いて説明する。
先ずステップS81において、ウィジェットの生成に関するソースコードを出力する。この出力するソースコードは、図3中、ウィジェット生成ソース32−aに記憶されているものである。ウィジェットの生成に関するソースコードの出力が完了すると、ステップS82においてウィジェット生成ソース32−cを消去する。
【0040】
ウィジェト生成後処理用ソース出力部21で行うステップS64の処理の詳細を図9を用いて説明する。
先ずステップS71において、リソースに値を設定する為の処理の前処理のためのソースコードを出力する(図11中、行番号01に対応)。
続いてステップS92からS94において、ウィジェット生成後に設定すべきリソースの設定に関するソースコード出力を行う。すなわち、ステップS92の判定条件になっているとおり、アクセス条件としてSフラグが設定されており、かつ未出力のソースコードについて出力を行う。ソースコードの出力自体はウィジェト生成前の出力と同様、ステップ93において、図3のリソース設定ソース34−cに記憶されているソースコードを出力し、出力が完了するとステップS94でそれをリソース設定ソース34−cから消去する。この消去は出力完了を意味する。
【0041】
ステップS92からS94の処理はパラメータリストへの値の設定に関するソースコードのみを出力するため、ステップS95において、実際にウィジェットの属性を変更するための関数呼び出しを行う為のソースコードを出力する(図11中、行番号20に対応)。
最後に、ステップS96にて、生成したウィジェットをうまく管理するための必要な通知を行う処理として関数”XtManageChild” を呼び出すためのソースコードを出力する(図11中、行番号21)。
【0042】
以上の処理により、ウィジェットの生成に関するソースコードがソースファイル22に記憶される。アプリケーションプログラムの作成者は、このソースコードに対してウィジェット生成以外の部分を追加し、アプリケーションプログラム全体をさせる。
本実施例では、出力データ生成部16でウィジェット毎、リソース毎にソースコード生成の為の処理を呼び出してソースコードを生成し、ウィジェット生成ソース32−c及びリソース節制ソース34−cにソースコードそのものを格納したが、この領域にウィジェット毎、リソース毎に用意したソースコード生成の為の処理へのポインタを格納しておき、ソースコード出力部18でソースコードを出力する際に、出力データ34−bをパラメタとして、このポインタで示される処理を呼び出すことでソースコードを出力するようにしてもよい。これにより、ソースコードを記憶するための領域を拉小さくすることができる。
【0043】
以上でOSF/Motif を対象とした実施例の説明を終わるが、本発明がOSF/Motif 以外の他のシステムにおいても適用可能であることは言うまでもない。
【0044】
【発明の効果】
以上説明した用に、本発明によれば、画面を構成する部品の属性に対する値の設定の順序関係を設定値管理テーブルとしてプログラムとは独立して管理するため、利用可能な部品に追加・変更等あった場合に、テーブルの内容を変更するだけで、処理プログラムには一切変更を加えることなく、これらの部品に関するソースコードの自動生成が可能となる。
【図面の簡単な説明】
【図1】本発明の原理図
【図2】本発明の一実施例を表す図
【図3】ウィジェット情報記憶域のデータ構造
【図4】設定値管理テーブル
【図5】ソースコード生成部の処理フロー
【図6】ソースコード出力部の処理フロー
【図7】ウィジェット生成前処理ソース出力部の処理フロー
【図8】ウィジェット生成処理ソース出力部の処理フロー
【図9】ウィジェット生成後処理ソース出力部の処理フロー
【図10】UILファイルの一例
【図11】出力ソースコードの一例
【符号の説明】
1:ソースコード生成部
2:ソースコード出力部
3:部品生成前設定ソースコード出力部
4:部品生成ソースコード出力部
5:部品生成後設定ソースコード出力部
[0001]
[Industrial application fields]
The present invention relates to automatic generation of a GUI component generation portion of a source code of a GUI program.
In order to make the computer easier to use, a so-called GUI is widely adopted in which the display on the screen is centered on the image instead of the center of the character, and the operation is performed with a pointing device such as a mouse.
[0002]
The adoption of the GUI has greatly improved the usability of the computer for the end user, but the addition to the programmer has increased, such as the creation of a GUI screen and the recognition of input from the mouse.
For this reason, preparing the parts that make up the GUI screen in advance and selectively placing them on the screen facilitates screen creation, and from the created screen to the generation processing of the parts that make up the screen, etc. A technology has appeared that automatically generates the corresponding source program.
[0003]
The present invention relates to automatic generation of a source program for generation processing of components constituting a GUI screen.
[0004]
[Prior art]
By the way, the parts constituting the screen are defined by a plurality of attributes. Some values are set for component attributes before the component is generated, and some are set after the component is generated.
In the conventional source code generation device, the control of the output order of the source code regarding the setting of values for the component attributes is fixed individually for each component and for each attribute by determining the condition and branching of the program that controls the source code generation device. Had been processed.
[0005]
[Problems to be solved by the invention]
However, in such a fixed process, when the number of parts that can be used increases, in order to enable automatic generation of the source code related to the generation of the parts, the program itself that controls the source code generation device is changed. There was a problem of having to.
[0006]
In view of the above, an object of the present invention is to make it possible to easily automatically generate a source code relating to generation of a part even when a part constituting a screen is added.
[0007]
[Means for solving problems]
FIG. 1 is a diagram illustrating the principle of the present invention.
In the figure, reference numeral 1 denotes a source code generation unit that analyzes input screen definition information to generate a source code related to component generation and a source code related to setting of component attributes, and based on attribute setting order information, Order information is added to the generated source code.
[0008]
Reference numeral 2 denotes a source code output unit, and includes a pre-component generation attribute setting source code output unit 3, a component generation source code output unit 4, and a post-component generation attribute setting source code output unit 5.
The source code output unit 3 for attribute setting before component generation outputs a source code related to the setting of the attribute indicating the output before component generation as the order information among the source codes generated by the source code generation unit 1. The component generation source code output unit 4 outputs a source code related to component generation among the source codes generated by the source code generation unit 1. The post-part generation attribute setting source code output unit 5 outputs the source code related to the setting of the attribute indicating the post-part generation output as the order information among the source codes generated by the source code generation unit 1.
[0009]
[Action]
In the present invention, the source code generation unit 1 analyzes the screen definition information and generates a source code related to attribute setting and component generation for each component. At this time, order information is added to the source code related to the attribute setting to be generated based on the set value management source code output order information.
[0010]
When the source code generation unit 1 completes the generation of the source code, the source code output unit 2 next outputs the generated source code. For output, referring to the order information, first, the setting source code output unit 3 before component generation outputs the source code for the setting processing to the attribute to be processed before the component generation processing. Next, the component generation source code output unit 4 outputs a source code related to component generation, and finally the source code for the value setting processing for the attribute for which the post-component generation setting source code output unit 5 sets a value after the component generation processing. Is output.
[0011]
【Example】
This embodiment is intended to describe an OSF / Motif application program in C language. First, OSF / Motif will be described.
OSF / Motif is one of the GUI specifications of X Window System. X Window System is a graphical window system on UNIX developed by the Massachusetts Institute of Technology (MIT). OSF / Motif is a GUI standard for X Window System developed by Open Software Foundation (OSF).
[0012]
OSF / Motif consists of a toolkit that supports application development on the X Window System, a window manager, UIL (User Interface Language), and a style guide that defines guidelines for application development.
The OSF / Motif toolkit is composed of user interface components called widgets and functions for using them. The window manager provides a user interface for various GUI operations for opening a window on the screen, changing the size of the opened window, moving, and closing the window. UIL is a dedicated language for creating application screens, and has a simpler language specification than programming languages such as C language. A style guide is a manual that describes design principles and precautions when designing application programs, window managers, and the like.
[0013]
Widgets are parts that group user interfaces by function. In addition to basic widgets such as a character string display area, various buttons, a text input area, and a scroll bar, there are container widgets having a container role for combining a plurality of these widgets. When creating a screen having a plurality of buttons and text input areas in the window, the screen is configured by combining a container widget and buttons and text input area widgets.
[0014]
Each widget is defined as an abstract data type called a class, and cannot be used in a program as an actual part as it is. For this reason, when using a widget, it is necessary to generate an instance (substance) before using the widget.
OSF / Motif provides a function for creating an instance of a widget class. For example, to create an instance of a push button widget class, the XmCreatePushButton function is used.
[0015]
Each widget has attributes that define the functions and properties of the widget. In OSF / Motif, this attribute is called a resource. You can change the appearance and behavior of the widget by setting values for the resources provided by the widget class. In that sense, resources can also be referred to as data for customizing widgets.
[0016]
When designing a screen, a known screen setting tool called a builder is used. The builder arranges widgets while looking at the screen. The builder outputs the screen definition described in UIL based on the arranged widgets.
The screen definition described in UIL includes a name given to a widget instance, a value setting for the widget, and the like.
[0017]
An example of the screen definition described in UIL is shown in FIG.
In the figure, at line number 01, “object” means the start of the definition of the widget. The character string following “object” represents the instance name of the widget. In this case, the name of the widget instance is “Button1”. The string that follows is the name of the widget class to use. In this case, the name of the widget class is “XmPushButton”.
[0018]
As already explained, a widget class is an abstract data type, and an entity that embodies it is called an instance.
In line number 02, between “{” following “arguments” to the corresponding line number 11 ”}”, the setting of the value for the resource of this widget is described using an equation. A resource name is described on the left side of the expression, and a constant is described on the right side. In the figure, for example, a constant “XmATTACH_FORM” is set for a resource “XmNbottomAttachment”. It can be said that the role of the GUI source code generation apparatus of the present invention is to automatically generate source code related to generation of a widget from the UIL.
[0019]
There are two ways to set resources from within the application program: passing them as parameters to the instance creation function when creating the widget, and setting the resources using the resource setting function for the created widget. There is a need to do.
Although the OSF / Motif and the X Window System have been briefly described above, since many books and magazines have been published for these, please refer to those books and magazines in more detail.
[0020]
Next, an embodiment of the present invention will be described.
FIG. 2 is a diagram showing the configuration of an embodiment of the present invention. In the figure, 11 is a builder that generates screen definition information interactively. A UIL file 12 stores screen definition information in the UIL format defined by the builder 11.
Reference numeral 13 denotes a GUI source code generation device that reads a UIL file and generates a C language source program. Reference numeral 14 denotes a source code generation unit that analyzes the UIL file and generates a source code, and includes a syntax analysis unit 15 and an output data generation unit 16.
[0021]
The syntax analysis unit 15 performs syntax analysis while reading the UIL file, and stores information on the widget and its resources in the widget information storage area 23 in the format shown in FIG. The output data generation unit 16 generates and stores a source code for each widget and each resource stored in the widget information storage area 23. The source code related to component generation is stored in the widget generation source 32-a in FIG. The source code related to the resource is stored in 34-c in the figure.
[0022]
Note that source code generation is performed by preparing a source code generation process for each widget class and each resource and for each widget class.
Further, the output data generation unit 16 searches the set value management table 17 for an access condition corresponding to the resource that is the source of the source code for the generated source code, as an access condition 34-d in FIG. Remember.
[0023]
A source code output unit 18 includes a widget generation pre-processing source output unit 19, a widget generation processing source output unit 20, and a widget generation post-processing source generation unit 21. The source code output from the source code output unit is stored in the source file 22.
Here, the setting value management table 17 and the widget information storage area 23 will be described. First, the set value management table 17 will be described with reference to FIG.
[0024]
The set value management table 17 is a table showing access conditions and data types for each resource.
The access condition is represented by a combination of a C flag, an S flag, and a G flag. The C flag indicates that it is necessary to set a value for the resource before generating the widget. The S flag indicates that the resource value can be changed after the widget is generated. The G flag indicates that the resource value can be referred to. The G flag is not directly related to the present invention.
[0025]
Next, a data storage format in the widget information storage area 23 will be described with reference to FIG.
In FIG. 3, 31 is a widget management table, 32 is widget information, 33 is a resource management table, and 34 is resource information.
The widget management table 31 is a table of pointers to a plurality of widget information.
[0026]
The widget information includes a widget name 32-a, a pointer 32-b to a resource management table, and a widget source 32-c. The widget name obtained as a result of the syntax analysis in the syntax analysis unit 15 is stored in the widget name 32-a. Source code related to generation of the widget generated by the output data generation unit 16 is stored in the widget source 32-a.
[0027]
The resource management table 33 is a table of pointers to a plurality of resource information 34.
The resource information 34 holds a resource name 34-a, output data 34-b, a resource setting source 34-c, and an access condition 34-d. The resource name obtained as a result of the syntax analysis in the syntax analysis unit 15 is stored in the resource name 34-a. The source code related to the resource setting generated by the output data generating unit 16 is stored in the resource setting source 34-c. A value set for the resource is stored in the output data 34-b. The access condition retrieved from the set value management table 17 is stored in the access condition 34-d.
[0028]
Next, it demonstrates along the flow of a process of a present Example.
First, the application creator interactively designs a screen using the builder 11. The conversational screen design using the builder 11 means that the widgets are arranged on the screen by trial and error by operating the mouse.
When the screen design is completed, that is, when the placement of the widget is completed, the builder 11 outputs screen definition information in UIL format corresponding to the placed widget to the UIL file 12.
[0029]
Next, the source code generation unit 14 performs processing. The processing of the source code generation unit 14 will be described using the flowchart shown in FIG.
In step S51, the syntax analysis unit 15 performs syntax analysis while reading the UIL file 12, and stores the result in the widget information storage area 23 in the format shown in FIG.
[0030]
For example, when the UIL file shown in FIG. 10 is analyzed, “Button 1” is stored in the widget name 32-a of a certain widget information 32, and seven resource information 34 is pointed under that. The resource name 34-a of each resource information 34 includes "XmNlabelPixmap", "XmNlabelType", "XmNforeground", "XmNbottomAttachment", "XmNleftAttachment", "mNttmt"
[0031]
Subsequently, the output data generation unit 16 performs steps S52 to S56. That is, in step S53, source code relating to widget generation is generated and stored in the widget generation source 32-a. Subsequently, in step S55, a source code relating to resource setting is generated and stored in the resource setting source 43-c. Thereafter, the setting value management table 17 is searched with the resource name 34-a, the corresponding access condition is obtained, and stored in the access condition 34-d.
[0032]
Processing for “Button 1” shown in FIG. 10 is as follows. That is, for the resource “XmNlabelPixmap”, “/ home / shikawa / bitmaps / logo” as output data, the source code of line numbers 17, 18, and 19 in FIG. 11 as the resource setting source, and the S flag as the access condition And the G flag are stored. For the resource “XmNlabelType”, “XmPIXMAP” is stored as output data, the source codes of line numbers 02 and 03 in FIG. 11 are stored as resource setting sources, and the S flag, C flag, and G flag are stored as access conditions.
[0033]
For the resource “XmNforeground”, “# ffff00000000” is stored as output data, the source code of line numbers 04, 05, and 06 in FIG. 11 is stored as the resource setting source, and the S flag, C flag, and G flag are stored as access conditions. Is done.
For the resource “XmNbottomAttachment”, “XmATTACH_FORM” is output as output data, the source codes of line numbers 07 and 08 in FIG. 11 are stored as resource setting sources, and the S flag, C flag, and G flag are stored as access conditions.
[0034]
For the resource “XmNleftAttachment”, “XmATTACH_FORM” is stored as output data, the source code of line numbers 09 and 10 in FIG. 11 is stored as the resource setting source, and the S flag, C flag, and G flag are stored as access conditions.
For the resource “XmNrightAttachment”, “XmATTACH_FORM” is stored as output data, the source codes of line numbers 11 and 12 in FIG. 11 are stored as resource setting sources, and the S flag, C flag, and G flag are stored as access conditions.
[0035]
For the resource “XmNtopAttachment”, “XmATTACH_FORM” is stored as output data, the source codes of line numbers 13 and 14 in FIG. 11 are stored as resource setting sources, and the S flag, C flag, and G flag are stored as access conditions.
When the process of the source code generation unit 14 is completed, the process of the source code output unit 18 is subsequently performed. The processing of the source code output unit 18 will be described with reference to FIG.
[0036]
The source code output unit 18 process repeats three processes for all widgets. That is, in step S62, the widget generation preprocessing source code is output, in step S63, the widget generation processing source code is output. Finally, in step S64, the widget generation postprocessing source code is output.
[0037]
The processing in step S62, step S63, and step S64 is performed by the widget generation preprocessing source output unit 19, the widget generation processing source output unit 20, and the widget generation postprocessing source output unit 21, respectively.
Details of the processing of step S62 performed by the widget generation preprocessing source output unit 19 will be described with reference to FIG.
[0038]
First, in step S71, source code for preprocessing of processing for setting a value in a resource is output (corresponding to line number 01 in FIG. 11).
Subsequently, in steps S72 to S74, source code output relating to the setting of resources to be set before widget generation is performed. That is, in step 73, the source code stored in the resource setting source 34-c in FIG. 3 is output, and when the output is completed, it is deleted from the resource setting source 34-c in step S74. This erasure means completion of output. This process is repeated until an end determination is made in step S72.
[0039]
Details of the processing in step S63 performed by the widget generation processing source output unit 20 will be described with reference to FIG.
First, in step S81, source code relating to generation of a widget is output. The output source code is stored in the widget generation source 32-a in FIG. When the output of the source code related to the generation of the widget is completed, the widget generation source 32-c is deleted in step S82.
[0040]
Details of the processing in step S64 performed by the post-processing generation post-processing source output unit 21 will be described with reference to FIG.
First, in step S71, source code for preprocessing of processing for setting a value in a resource is output (corresponding to line number 01 in FIG. 11).
Subsequently, in steps S92 to S94, source code output relating to setting of resources to be set after generation of the widget is performed. That is, as the determination condition of step S92, the S flag is set as the access condition and output is performed for the unoutput source code. The output of the source code itself is the same as the output before the generation of the widget. In step 93, the source code stored in the resource setting source 34-c in FIG. 3 is output, and when the output is completed, the output is completed in step S94. Delete from 34-c. This erasure means completion of output.
[0041]
Since the processing of steps S92 to S94 outputs only the source code related to setting of values in the parameter list, in step S95, the source code for making a function call for actually changing the attribute of the widget is output (FIG. 11 corresponds to line number 20).
Finally, in step S96, a source code for calling the function “XtManageChild” is output as a process for performing a notification necessary for successfully managing the generated widget (line number 21 in FIG. 11).
[0042]
Through the above processing, the source code relating to the generation of the widget is stored in the source file 22. The creator of the application program adds a part other than widget generation to the source code to make the entire application program.
In the present embodiment, the output data generation unit 16 calls a process for generating a source code for each widget and each resource to generate a source code, and the source code itself is added to the widget generation source 32-c and the resource moderation source 34-c. In this area, a pointer to the source code generation process prepared for each widget and each resource is stored, and when the source code is output by the source code output unit 18, output data 34- You may make it output a source code by calling the process shown by this pointer by using b as a parameter. As a result, the area for storing the source code can be reduced.
[0043]
Although the description of the embodiment for the OSF / Motif is completed as described above, it is needless to say that the present invention can be applied to other systems other than the OSF / Motif.
[0044]
【The invention's effect】
For the reasons described above, according to the present invention, the order relationship of the value setting for the attributes of the parts constituting the screen is managed as a setting value management table independently of the program, so that addition / change to available parts is possible. In such a case, it is possible to automatically generate source codes relating to these components by changing the contents of the table and without changing the processing program at all.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating the principle of the present invention. FIG. 2 is a diagram illustrating an embodiment of the present invention. FIG. 3 is a data structure of a widget information storage area. Processing Flow [Fig. 6] Processing Flow of Source Code Output Unit [Fig. 7] Processing Flow of Widget Generation Pre-processing Source Output Unit [Fig. 8] Processing Flow of Widget Generation Processing Source Output Unit [Fig. 9] Post-Widget Generation Processing Source Output FIG. 10 shows an example of a UIL file. FIG. 11 shows an example of output source code.
1: source code generation unit 2: source code output unit 3: set source code output unit before component generation 4: component generation source code output unit 5: set source code output unit after component generation

Claims (1)

入力された画面定義情報を解析してソースコードを出力する部品生成ソースプログラム生成装置であって、
部品の属性の各々について属性値の設定と部品の生成の順序関係を示すアクセス条件と、該属性のデータタイプとを対応付けて管理する設定値管理テーブルと、
入力された画面定義情報を解析して画面を構成する部品についてその部品の生成に関するソースコード及びその部品に対する属性への値の設定に関するソースコードを生成するとともに、生成したソースコードに対して前記設定値管理テーブルを属性名で検索して得られたアクセス情報を付与するソースコード生成部と、
前記ソースコード生成部の生成したソースコードのうち、部品の生成処理以前に処理すべき属性が付与されているソースコードを出力する部品生成前設定ソースコード出力部と、
前記ソースコード生成部の生成したソースコードのうち、部品生成に関するソースコードを出力する部品生成ソースコード出力部と、
前記ソースコード生成部が生成したソースコードのうち、部品の生成処理以後に処理すべき属性が付与されているソースコードを出力する部品生成後設定ソースコード出力部と
を有する部品生成ソースプログラム生成装置。
A component generation source program generation device that analyzes input screen definition information and outputs source code,
And access conditions for each of the components of the attributes indicating the order relationship set and component generation of attribute values, and setting value management table for managing in association with the data type of the attribute,
For the parts that compose the screen by analyzing the input screen definition information, the source code for generating the part and the source code for setting the value of the attribute for the part are generated, and the setting is made for the generated source code. A source code generation unit for providing access information obtained by searching the value management table by attribute name ;
Among the source codes generated by the source code generation unit, a setting source code output unit before component generation that outputs a source code to which an attribute to be processed before component generation processing is given ,
Among the source codes generated by the source code generation unit, a component generation source code output unit that outputs a source code related to component generation;
A component generation source program generation device having a post-part generation setting source code output unit that outputs a source code to which an attribute to be processed after component generation processing is given among the source codes generated by the source code generation unit .
JP03114995A 1995-02-20 1995-02-20 Component generation source program generation device Expired - Fee Related JP3624447B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03114995A JP3624447B2 (en) 1995-02-20 1995-02-20 Component generation source program generation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03114995A JP3624447B2 (en) 1995-02-20 1995-02-20 Component generation source program generation device

Publications (2)

Publication Number Publication Date
JPH08227358A JPH08227358A (en) 1996-09-03
JP3624447B2 true JP3624447B2 (en) 2005-03-02

Family

ID=12323388

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03114995A Expired - Fee Related JP3624447B2 (en) 1995-02-20 1995-02-20 Component generation source program generation device

Country Status (1)

Country Link
JP (1) JP3624447B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114089985A (en) * 2021-11-17 2022-02-25 南斗六星系统集成有限公司 Automatic code generation graphical method and system for intelligent cockpit

Also Published As

Publication number Publication date
JPH08227358A (en) 1996-09-03

Similar Documents

Publication Publication Date Title
US7039875B2 (en) Computer user interfaces that are generated as needed
Mori et al. Tool support for designing nomadic applications
US5487141A (en) Development system with methods for visual inheritance and improved object reusability
US6804686B1 (en) System and methodology for providing fixed UML layout for an object oriented class browser
Wong Rigi user’s manual
US6002867A (en) Development system with methods providing visual form inheritance
US6490719B1 (en) System and method for configuring and executing a flexible computer program comprising component structures
US8386919B2 (en) System for displaying an annotated programming file
JPH08137646A (en) Method and system for displaying dialogue box
JP2000003274A (en) Method for generating text element of editor executable on computer and device therefor and computer-readable storing medium for storing program constituted for generating text element on editor
US6518979B1 (en) Automatically-maintained customizable user interfaces
US20010017622A1 (en) Apparatus and method for generating a configurable program explanation using templates and transparent graphical user interfaces
Ludolph et al. The Fabrik programming environment
CN112256573B (en) SIMSCRIPT language oriented simulation program visualization method
Jelinek et al. GUI generation from annotated source code
JP3624447B2 (en) Component generation source program generation device
Meixner et al. Udit–a graphical editor for task models
CN112199097B (en) Installation package generation method, installation package generation device, computer equipment and storage medium
CA2095779A1 (en) User interface system for computers
US20170109140A1 (en) Method and System for Editing and Generating Syntax
Grundy et al. A visual programming environment for object-oriented languages
JP3168762B2 (en) Dialogue processing system
Lecolinet Designing guis by sketch drawing and visual programming
JPH06243223A (en) Interactive processing system
Cummings The development of user interface tools for the Computer Aided Prototyping System

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040817

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041018

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041109

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041122

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071210

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081210

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091210

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091210

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101210

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111210

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees