summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/prc-tool
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/prc-tool
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/prc-tool')
-rw-r--r--languages/cpp/app_templates/prc-tool/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/prc-tool/Makefile.am17
-rw-r--r--languages/cpp/app_templates/prc-tool/callback.h24
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.c117
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.pbitm32
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.rcp11
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhelloRsc.h1
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool11
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool.kdevelop51
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate136
-rw-r--r--languages/cpp/app_templates/prc-tool/src-Makefile63
11 files changed, 463 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/prc-tool/.kdev_ignore b/languages/cpp/app_templates/prc-tool/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/.kdev_ignore
diff --git a/languages/cpp/app_templates/prc-tool/Makefile.am b/languages/cpp/app_templates/prc-tool/Makefile.am
new file mode 100644
index 00000000..3d4b5610
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = prc-tool.png src-Makefile prc-tool.kdevelop callback.h \
+ palmhello.c palmhello.pbitm palmhello.rcp palmhelloRsc.h
+templateName = prc-tool
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/prc-tool/callback.h b/languages/cpp/app_templates/prc-tool/callback.h
new file mode 100644
index 00000000..bf0ead45
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/callback.h
@@ -0,0 +1,24 @@
+#ifndef __CALLBACK_H__
+#define __CALLBACK_H__
+
+/* This is a workaround for a bug in the current version of gcc:
+
+ gcc assumes that no one will touch %a4 after it is set up in crt0.o.
+ This isn't true if a function is called as a callback by something
+ that wasn't compiled by gcc (like FrmCloseAllForms()). It may also
+ not be true if it is used as a callback by something in a different
+ shared library.
+
+ We really want a function attribute "callback" which will insert this
+ progloue and epilogoue automatically.
+
+ - Ian */
+
+register void *reg_a4 asm("%a4");
+
+#define CALLBACK_PROLOGUE \
+ void *save_a4 = reg_a4; asm("move.l %%a5,%%a4; sub.l #edata,%%a4" : :);
+
+#define CALLBACK_EPILOGUE reg_a4 = save_a4;
+
+#endif
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.c b/languages/cpp/app_templates/prc-tool/palmhello.c
new file mode 100644
index 00000000..0a34b6c4
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.c
@@ -0,0 +1,117 @@
+
+/* Main code for PalmHello */
+
+#include <PalmOS.h>
+#include <PalmCompatibility.h>
+#include "callback.h"
+
+#include "palmhelloRsc.h"
+
+static Boolean MainFormHandleEvent (EventPtr e)
+{
+ Boolean handled = false;
+ FormPtr frm;
+
+ CALLBACK_PROLOGUE
+
+ switch (e->eType) {
+ case frmOpenEvent:
+ frm = FrmGetActiveForm();
+ FrmDrawForm(frm);
+ handled = true;
+ break;
+
+ case menuEvent:
+ MenuEraseStatus(NULL);
+
+ switch(e->data.menu.itemID) {
+ }
+
+ handled = true;
+ break;
+
+ case ctlSelectEvent:
+ switch(e->data.ctlSelect.controlID) {
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ CALLBACK_EPILOGUE
+
+ return handled;
+}
+
+static Boolean ApplicationHandleEvent(EventPtr e)
+{
+ FormPtr frm;
+ Word formId;
+ Boolean handled = false;
+
+ if (e->eType == frmLoadEvent) {
+ formId = e->data.frmLoad.formID;
+ frm = FrmInitForm(formId);
+ FrmSetActiveForm(frm);
+
+ switch(formId) {
+ case MainForm:
+ FrmSetEventHandler(frm, MainFormHandleEvent);
+ break;
+ }
+ handled = true;
+ }
+
+ return handled;
+}
+
+/* Get preferences, open (or create) app database */
+static Word StartApplication(void)
+{
+ FrmGotoForm(MainForm);
+ return 0;
+}
+
+/* Save preferences, close forms, close app database */
+static void StopApplication(void)
+{
+ FrmSaveAllForms();
+ FrmCloseAllForms();
+}
+
+/* The main event loop */
+static void EventLoop(void)
+{
+ Word err;
+ EventType e;
+
+ do {
+ EvtGetEvent(&e, evtWaitForever);
+ if (! SysHandleEvent (&e))
+ if (! MenuHandleEvent (NULL, &e, &err))
+ if (! ApplicationHandleEvent (&e))
+ FrmDispatchEvent (&e);
+ } while (e.eType != appStopEvent);
+}
+
+/* Main entry point; it is unlikely you will need to change this except to
+ handle other launch command codes */
+DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
+{
+ Word err;
+
+ if (cmd == sysAppLaunchCmdNormalLaunch) {
+
+ err = StartApplication();
+ if (err) return err;
+
+ EventLoop();
+ StopApplication();
+
+ } else {
+ return sysErrParamErr;
+ }
+
+ return 0;
+}
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.pbitm b/languages/cpp/app_templates/prc-tool/palmhello.pbitm
new file mode 100644
index 00000000..5291d5a4
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.pbitm
@@ -0,0 +1,32 @@
+------------#######-------------
+----------###########-----------
+---------#############----------
+--------###############---------
+-------#################--------
+------###################-------
+------###################-------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+------###################-------
+------###################-------
+-------#################--------
+--------###############---------
+---------#############----------
+----------###########-----------
+------------#######-------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.rcp b/languages/cpp/app_templates/prc-tool/palmhello.rcp
new file mode 100644
index 00000000..0b37e81d
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.rcp
@@ -0,0 +1,11 @@
+#include "palmhelloRsc.h"
+
+FORM MainForm 1 1 158 158
+BEGIN
+ TITLE "PalmHello"
+END
+
+APPLICATIONICONNAME 1000 "palmhello"
+ICON "palmhello.pbitm"
+
+VERSION 1 "0.0.1"
diff --git a/languages/cpp/app_templates/prc-tool/palmhelloRsc.h b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h
new file mode 100644
index 00000000..6dde2ec7
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h
@@ -0,0 +1 @@
+#define MainForm 1000
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool b/languages/cpp/app_templates/prc-tool/prc-tool
new file mode 100644
index 00000000..d856c80b
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool
@@ -0,0 +1,11 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[fr]=Un simple programme de test � Hello world
+Icon=chellogba.png
+Category=C/PalmOS
+Comment=Generates a template for palm application
+Comment[fr]=G�n�re un mod�le d'application pour l'environnement PALM.
+#tShowFileAfterGeneration=README.devel
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=APPNAME.c
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop
new file mode 100644
index 00000000..2c5a6c0a
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ <keywords>
+ <keyword>C</keyword>
+ <keyword>PalmOS</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="Makefile" name="Build" />
+ <group pattern="*.c" name="Source" />
+ </groups>
+ </kdevfileview>
+<kdevcustomproject>
+ <run>
+ <mainprogram>make test</mainprogram>
+ <programargs/>
+ <terminal>true</terminal>
+ <envvars/>
+ </run>
+ <envvars/>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <envvars/>
+ </make>
+ <makeenvvars/>
+ </kdevcustomproject>
+
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate
new file mode 100644
index 00000000..4216c466
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate
@@ -0,0 +1,136 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[ca]=Programa Hello world
+Name[da]=Goddag verden program
+Name[de]="Hello World"-Programm
+Name[el]=Πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo»
+Name[et]="Tere,maailm" programm
+Name[eu]="Kaixo mundua" programa
+Name[fa]=برنامۀ Hello world
+Name[fr]=Programme « Bonjour monde »
+Name[ga]=Ríomhchlár "Hello world"
+Name[gl]=Programa Ola mundo
+Name[it]=Programma di "Hello world"
+Name[ja]=Hello world プログラム
+Name[nds]="Moin Welt"-Programm
+Name[ne]=हेल्डो वोल्ड कार्यक्रम
+Name[nl]=Hello World-programma
+Name[pl]=Program 'Witaj świecie'
+Name[pt]=Programa 'Olá mundo'
+Name[pt_BR]=Programa 'Olá mundo'
+Name[ru]=Программа Hello world
+Name[sk]=Ahoj svet program
+Name[sl]=Program Hello world
+Name[sr]=Програм „Здраво свете“
+Name[sr@Latn]=Program „Zdravo svete“
+Name[sv]=Hello world-program
+Name[tr]=Merhaba Dünya Programı
+Name[zh_CN]=Hello world 程序
+Name[zh_TW]=Hello world 程式
+Icon= # got none
+Category=C/PalmOS
+Comment=Generates a template for palm application
+Comment[ca]=Genera una plantilla d'aplicació per a Palm
+Comment[da]=Genererer en skabelon for et palm-program
+Comment[de]=Erstellt das Gerüst für eine Palm-Anwendung
+Comment[el]=Δημιουργία ενός προτύπου εφαρμογής για palm
+Comment[es]=Genera una plantilla para una aplicación Palm
+Comment[et]=Palmi rakenduse malli loomine.
+Comment[eu]=Palm aplikazio baten txantiloi bat sortzen du
+Comment[fa]=قالبی برای کاربرد palm تولید می‌کند
+Comment[fr]=Génère un modèle pour une application Palm
+Comment[gl]=Xera un modelo para aplicación palm
+Comment[hu]=Létrehoz egy Palm-os alkalmazássablont
+Comment[it]=Genera un modello per un'applicazione palm
+Comment[ja]=Palm アプリケーションのためのテンプレートを作成します
+Comment[nds]=Stellt dat Rahmenwark för en Palm-Programm op
+Comment[ne]=पाम अनुप्रयोगका लागि टेम्प्लेट उत्पन्न गर्दछ
+Comment[nl]=Genereert een sjabloon voor een Palm-toepassing
+Comment[pl]=Generuje szablon programu dla Palma
+Comment[pt]=Gera um modelo para aplicações do Palm
+Comment[pt_BR]=Gera um modelo para aplicações do Palm
+Comment[ru]=Создание простого приложения Palm
+Comment[sk]=Vygeneruje šablónu pre Palm aplikáciu
+Comment[sr]=Прави шаблон за palm програм
+Comment[sr@Latn]=Pravi šablon za palm program
+Comment[sv]=Skapar en mall för ett Palm-program
+Comment[tr]=Bir avuçiçi uygulaması için bir şablon yaratır
+Comment[zh_CN]=生成一个 Palm 应用程序的模板
+Comment[zh_TW]=產生一個 palm 應用程式樣本
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAME}.c
+Archive=prc-tool.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/prc-tool.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/src-Makefile
+Dest=%{dest}/Makefile
+
+[FILE3]
+Type=install
+Source=%{src}/palmhello.c
+Dest=%{dest}/%{APPNAME}.c
+
+[FILE4]
+Type=install
+Source=%{src}/palmhello.pbitm
+Dest=%{dest}/%{APPNAME}.pbitm
+
+[FILE5]
+Type=install
+Source=%{src}/palmhello.rcp
+Dest=%{dest}/%{APPNAME}.rcp
+
+[FILE6]
+Type=install
+Source=%{src}/palmhelloRsc.h
+Dest=%{dest}/%{APPNAME}Rsc.h
+
+[FILE7]
+Type=install
+Source=%{src}/callback.h
+Dest=%{dest}/callback.h
+
+[MSG]
+Type=message
+Comment=A palm application was created in %{dest}
+Comment[ca]=Una aplicació per a Palm ha estat creada en %{dest}
+Comment[da]=Et palm-program blev oprettet i %{dest}
+Comment[de]=Eine Palm-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή palm δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Palm ha sido creada en %{dest}
+Comment[et]=Palmi rakendus loodi asukohta %{dest}
+Comment[eu]=Palm aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد palm در %{dest} ایجاد شد
+Comment[fr]=Une application Palm a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár Palm i %{dest}
+Comment[gl]=Creouse unha aplicación palm en %{dest}
+Comment[hu]=Létrejött egy Palmos alkalmazássablon itt: %{dest}
+Comment[it]=È stata creata un'applicazione palm in %{dest}
+Comment[ja]=Palm アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Palm-Programm opstellt
+Comment[ne]=पाम अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Palm-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program dla Palma został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Palm em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Palm em %{dest}
+Comment[ru]=Приложение Palm создано в %{dest}
+Comment[sk]=Palm aplikácia bola vytvorená v %{dest}
+Comment[sr]=Palm програм је направљен у %{dest}
+Comment[sr@Latn]=Palm program je napravljen u %{dest}
+Comment[sv]=Ett Palm-program skapades i %{dest}
+Comment[tr]=Bir avuçiçi uygulaması %{dest} içinde yaratıldı
+Comment[zh_CN]=在 %{dest} 中创建了一个 Palme 应用程序
+Comment[zh_TW]=一個 palm 應用程式樣本已建立於 %{dest}
diff --git a/languages/cpp/app_templates/prc-tool/src-Makefile b/languages/cpp/app_templates/prc-tool/src-Makefile
new file mode 100644
index 00000000..a64d5cfa
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/src-Makefile
@@ -0,0 +1,63 @@
+## Makefile for PalmHello
+
+TARGET = palmhello
+APPNAME = "PalmHello"
+APPID = "0000"
+
+OBJS = $(TARGET).o
+LIBS =
+
+target=m68k-palmos-
+
+CC = $(target)gcc
+
+CFLAGS = -Wall -g -O2
+
+PILRC = pilrc
+OBJRES = $(target)obj-res
+NM = $(target)nm
+BUILDPRC = build-prc
+PILOTXFER = pilot-xfer
+
+all: $(TARGET).prc
+
+.S.o:
+ $(CC) $(TARGETFLAGS) -c $<
+
+.c.s:
+ $(CC) $(CSFLAGS) $<
+
+$(TARGET).prc: code0000.$(TARGET).grc code0001.$(TARGET).grc data0000.$(TARGET).grc pref0000.$(TARGET).grc rloc0000.$(TARGET).grc bin.res
+ $(BUILDPRC) $(TARGET).prc $(APPNAME) $(APPID) code0001.$(TARGET).grc code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc rloc0000.$(TARGET).grc
+
+code0000.$(TARGET).grc: $(TARGET)
+ $(OBJRES) $(TARGET)
+
+code0001.$(TARGET).grc: code0000.$(TARGET).grc
+
+data0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+pref0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+rloc0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+bin.res: $(TARGET).rcp $(TARGET).pbitm
+ $(PILRC) $(TARGET).rcp .
+ touch bin.res
+
+$(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS)
+ ! $(NM) -u $(TARGET) | grep .
+
+send: $(TARGET).prc
+ $(PILOTXFER) -i $(TARGET).prc
+
+depend:
+ makedepend -Y -I. *.c
+
+clean:
+ -rm -f *.[oa] $(TARGET) *.bin bin.res *.grc Makefile.bak
+
+veryclean: clean
+ -rm -f $(TARGET).prc pilot.ram pilot.scratch
+