Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
104 changes: 104 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash
set -e

# Build script for PacmanXG on Arch Linux
# Requires: fpc, msegui (mseide-msegui) or msegui source

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# --- Check / install dependencies ---
echo "=== Checking dependencies ==="

if ! command -v fpc &>/dev/null; then
echo "Free Pascal Compiler (fpc) not found. Installing..."
sudo pacman -S --needed --noconfirm fpc
fi

# MSEgui: check common install locations
MSEDIR=""
for candidate in \
/usr/lib/mseide-msegui \
/usr/local/lib/mseide-msegui \
/opt/mseide-msegui \
"$PWD/mseide-msegui" \
"$HOME/mseide-msegui" \
"$HOME/msegui"; do
if [ -d "$candidate/lib" ]; then
MSEDIR="$candidate/"
break
fi
done

if [ -z "$MSEDIR" ]; then
echo "MSEgui libraries not found."
echo ""
echo "Install via AUR (e.g. with yay):"
echo " yay -S mseide-msegui"
echo ""
echo "Or clone manually:"
echo " git clone https://gitlab.com/mseide-msegui/mseide-msegui.git ~/mseide-msegui"
echo ""
echo "Then re-run this script."
exit 1
fi

MSELIBDIR="${MSEDIR}lib/common/"
TARGETOSDIR="linux"

echo "=== Using MSEgui at: ${MSEDIR} ==="
echo "=== MSELIBDIR: ${MSELIBDIR} ==="

# --- Gather unit directories ---
# From the .prj file:
# ${MSEDIR}lib/addon/*/
# ${MSELIBDIR}kernel/$TARGETOSDIR/
# ${MSELIBDIR}kernel/
# ${MSELIBDIR}*/
UNIT_ARGS=""

# ${MSEDIR}lib/addon/*/
for d in "${MSEDIR}"lib/addon/*/; do
[ -d "$d" ] && UNIT_ARGS+=" -Fu${d}"
done

# ${MSELIBDIR}kernel/linux/
[ -d "${MSELIBDIR}kernel/${TARGETOSDIR}" ] && \
UNIT_ARGS+=" -Fu${MSELIBDIR}kernel/${TARGETOSDIR}/"

# ${MSELIBDIR}kernel/
[ -d "${MSELIBDIR}kernel" ] && \
UNIT_ARGS+=" -Fu${MSELIBDIR}kernel/"

# ${MSELIBDIR}*/
for d in "${MSELIBDIR}"*/; do
[ -d "$d" ] && UNIT_ARGS+=" -Fu${d}"
done

# Include paths (same as unit paths)
INC_ARGS=""
for d in "${MSELIBDIR}"*/; do
[ -d "$d" ] && INC_ARGS+=" -Fi${d}"
done
[ -d "${MSELIBDIR}kernel/${TARGETOSDIR}" ] && \
INC_ARGS+=" -Fi${MSELIBDIR}kernel/${TARGETOSDIR}/"
[ -d "${MSELIBDIR}kernel" ] && \
INC_ARGS+=" -Fi${MSELIBDIR}kernel/"

# --- Compile ---
echo "=== Compiling pacmanxg ==="

cd "$SCRIPT_DIR"

fpc \
-Mobjfpc \
-Sh \
-Fcutf8 \
-O2 -XX -Xs -CX \
$UNIT_ARGS \
$INC_ARGS \
-Fu"$SCRIPT_DIR" \
-Fi"$SCRIPT_DIR" \
-o"${SCRIPT_DIR}/pacmanxg" \
"${SCRIPT_DIR}/pacmanxg.pas"

echo "=== Build successful: ${SCRIPT_DIR}/pacmanxg ==="
12 changes: 6 additions & 6 deletions main.mfm
Original file line number Diff line number Diff line change
Expand Up @@ -4409,7 +4409,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'News'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
captiondist = 0
imagelist = timagelist1
imagenr = 31
Expand All @@ -4433,7 +4433,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'Package Management'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
captiondist = 0
imagelist = timagelist1
imagenr = 27
Expand All @@ -4456,7 +4456,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'Tasks'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
captiondist = 0
imagelist = timagelist1
imagenr = 19
Expand Down Expand Up @@ -4523,7 +4523,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'Logs'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
captiondist = 0
imagelist = timagelist1
imagenr = 18
Expand All @@ -4547,7 +4547,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'Settings'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
imagelist = timagelist1
imagenr = 7
onexecute = on_navigate_menu
Expand All @@ -4569,7 +4569,7 @@ object mainfo: tmainfo
faceclicked.dummy = 0
caption = 'Pacman key management'
textflags = [tf_ycentered, tf_wordbreak]
imagepos = ip_leftcenter
imagepos = ip_left
captiondist = 0
imagelist = timagelist1
imagenr = 39
Expand Down
3 changes: 1 addition & 2 deletions main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2451,8 +2451,7 @@ procedure tmainfo.on_run_util(const sender: TObject);
begin
cmd := (findcomponent('d' + (sender as trichbutton).name) as tdropdownlistedit).value;
cmd := check_util_cmdline(cmd);
shell(cmd + ' &');
//Exec(cmd, false);
Exec(cmd + ' &', false);
end;


Expand Down
36 changes: 21 additions & 15 deletions msefiledialog.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
interface

uses
mseglob,mseguiglob,msegui,mseforms,Classes,mseclasses,msewidgets,msegrids,
mseglob,mseguiglob,msegui,mseforms,mseclasses,msewidgets,msegrids,
mselistbrowser,mseedit,msesimplewidgets,msedataedits,msedialog,msetypes,
msestrings,msesystypes,msesys,msedispwidgets,msedatalist,msestat,msestatfile,
msebitmap,msedatanodes,msefileutils,msedropdownlist,mseevent,msegraphedits,
Expand Down Expand Up @@ -75,7 +75,7 @@ tfilelistview = class(tlistview)
// procedure setoptions(const Value: listviewoptionsty); override;
procedure docellevent(var info: celleventinfoty); override;
public
constructor create(aowner: tcomponent); override;
constructor create(aowner: tmsecomponent);
destructor destroy; override;
procedure readlist;
procedure updir;
Expand Down Expand Up @@ -231,17 +231,17 @@ tfiledialogcontroller = class(tlinkedpersistent)
end;

const
defaultfiledialogoptionsedit = defaultoptionsedit+
[oe_savevalue,oe_savestate,oe_saveoptions];
defaultfiledialogoptionsedit = [oe1_savevalue,oe1_savestate,oe1_saveoptions];

type
tfiledialog = class(tdialog,istatfile)
private
fcontroller: tfiledialogcontroller;
fstatvarname: msestring;
fstatfile: tstatfile;
fstatpriority: integer;
fdialogkind: filedialogkindty;
foptionsedit: optionseditty;
foptionsedit: optionsedit1ty;
procedure setcontroller(const value: tfiledialogcontroller);
procedure setstatfile(const Value: tstatfile);
protected
Expand All @@ -251,8 +251,9 @@ tfiledialog = class(tdialog,istatfile)
procedure statreading;
procedure statread;
function getstatvarname: msestring;
function getstatpriority: integer;
public
constructor create(aowner: tcomponent); override;
constructor create(aowner: tmsecomponent);
destructor destroy; override;
function execute: modalresultty; overload; override;
function execute(const akind: filedialogkindty): modalresultty;
Expand All @@ -267,7 +268,7 @@ tfiledialog = class(tdialog,istatfile)
property controller: tfiledialogcontroller read fcontroller write setcontroller;
property dialogkind: filedialogkindty read fdialogkind write fdialogkind
default fdk_none;
property optionsedit: optionseditty read foptionsedit write foptionsedit
property optionsedit: optionsedit1ty read foptionsedit write foptionsedit
default defaultfiledialogoptionsedit;
end;

Expand Down Expand Up @@ -302,7 +303,7 @@ tcustomfilenameedit = class(tcustomdialogstringed)
procedure updatecopytoclipboard(var atext: msestring); override;
procedure updatepastefromclipboard(var atext: msestring); override;
public
constructor create(aowner: tcomponent); override;
constructor create(aowner: tmsecomponent);
destructor destroy; override;
procedure componentevent(const event: tcomponentevent); override;
property controller: tfiledialogcontroller read fcontroller write setcontroller;
Expand Down Expand Up @@ -463,7 +464,7 @@ implementation
uses
msefiledialog_mfm,sysutils,msebits,
msestringenter,msedirtree,msefiledialogres,msekeyboard,
msestockobjects,msesysintf,msearrayutils;
msestockobjects,msesysintf,msearrayutils,Classes;

procedure getfileicon(const info: fileinfoty; var imagelist: timagelist;
out imagenr: integer);
Expand Down Expand Up @@ -718,7 +719,7 @@ function filedialog(var afilename: filenamety;

{ tfilelistview }

constructor tfilelistview.create(aowner: tcomponent);
constructor tfilelistview.create(aowner: tmsecomponent);
begin
fcaseinsensitive:= filesystemiscaseinsensitive;
fincludeattrib:= [fa_all];
Expand All @@ -727,7 +728,7 @@ constructor tfilelistview.create(aowner: tcomponent);
foptionsfile:= defaultfilelistviewoptions;
ffilelist:= tfiledatalist.create;
ffilelist.onchange:= {$ifdef FPC}@{$endif}filelistchanged;
inherited;
inherited create(aowner);
options:= defaultlistviewoptionsfile;
checkcasesensitive;
end;
Expand Down Expand Up @@ -2093,11 +2094,11 @@ function tfiledialogcontroller.getsyscommandline: filenamety;

{ tfiledialog }

constructor tfiledialog.create(aowner: tcomponent);
constructor tfiledialog.create(aowner: tmsecomponent);
begin
foptionsedit:= defaultfiledialogoptionsedit;
fcontroller:= tfiledialogcontroller.create(nil);
inherited;
inherited create(aowner);
end;

destructor tfiledialog.destroy;
Expand Down Expand Up @@ -2158,6 +2159,11 @@ function tfiledialog.getstatvarname: msestring;
result:= fstatvarname;
end;

function tfiledialog.getstatpriority: integer;
begin
result:= fstatpriority;
end;

procedure tfiledialog.setstatfile(const Value: tstatfile);
begin
setstatfilevar(istatfile(self),value,fstatfile);
Expand Down Expand Up @@ -2195,10 +2201,10 @@ function tfilenameeditcontroller.execute(var avalue: msestring): boolean;

{ tcustomfilenameedit }

constructor tcustomfilenameedit.create(aowner: tcomponent);
constructor tcustomfilenameedit.create(aowner: tmsecomponent);
begin
fcontroller:= tfiledialogcontroller.create(self,{$ifdef FPC}@{$endif}formatchanged);
inherited;
inherited create(aowner);
end;

destructor tcustomfilenameedit.destroy;
Expand Down
9 changes: 9 additions & 0 deletions mseide-msegui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.o
*.ppu
*.dcu
*.~*
*.a
*.bak
*.bak?
*.rst
*.rsj
Loading