|
From: <cre...@us...> - 2007-07-29 18:44:38
|
Revision: 1722
http://frontierkernel.svn.sourceforge.net/frontierkernel/?rev=1722&view=rev
Author: creecode
Date: 2007-07-29 11:44:39 -0700 (Sun, 29 Jul 2007)
Log Message:
-----------
added window.setQuickScript verb
Modified Paths:
--------------
Frontier/trunk/Common/headers/command.h
Frontier/trunk/Common/headers/miniwindow.h
Frontier/trunk/Common/resources/Mac/kernelverbs.r
Frontier/trunk/Common/resources/Win32/kernelverbs.rc
Frontier/trunk/Common/source/command.c
Frontier/trunk/Common/source/miniwindow.c
Frontier/trunk/Common/source/shellwindowverbs.c
Modified: Frontier/trunk/Common/headers/command.h
===================================================================
--- Frontier/trunk/Common/headers/command.h 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/headers/command.h 2007-07-29 18:44:39 UTC (rev 1722)
@@ -25,15 +25,19 @@
******************************************************************************/
+
#define commandinclude
-/*prototypes*/
+// prototypes
-//extern cmdprocessstarted (void) ;
+// extern cmdprocessstarted (void) ;
-//extern cmdprocesskilled (void);
+// extern cmdprocesskilled (void);
extern boolean startcmddialog (void);
extern boolean cmdstart (void);
+
+extern boolean cmdsetstring ( Handle ); // 2007-07-25 creedon
+
Modified: Frontier/trunk/Common/headers/miniwindow.h
===================================================================
--- Frontier/trunk/Common/headers/miniwindow.h 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/headers/miniwindow.h 2007-07-29 18:44:39 UTC (rev 1722)
@@ -129,7 +129,7 @@
} tyminirecord, *ptrminirecord, **hdlminirecord;
-/*globals*/
+// globals
extern WindowPtr miniwindow;
@@ -138,7 +138,7 @@
extern hdlminirecord minidata;
-/*prototypes*/
+// prototypes
extern boolean minisetstring (short, Handle);
@@ -158,6 +158,5 @@
extern boolean ministart (short);
+extern boolean minireloadstrings ( short ); // 2007-07-27 creedon
-
-
Modified: Frontier/trunk/Common/resources/Mac/kernelverbs.r
===================================================================
--- Frontier/trunk/Common/resources/Mac/kernelverbs.r 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/resources/Mac/kernelverbs.r 2007-07-29 18:44:39 UTC (rev 1722)
@@ -764,9 +764,11 @@
"gettitle",
"settitle",
"about",
- "quicktime", /*7.0b4 PBS: QuickTime Player window*/
+ "quicktime", // 7.0b4 PBS: QuickTime Player window
"getfile",
- "isreadonly", /*7.0b6 PBS: is a window read-only*/
+ "isreadonly", // 7.0b6 PBS: is a window read-only
+ "setquickscript" // 2007-07-25 creedon
+
}
}
};
Modified: Frontier/trunk/Common/resources/Win32/kernelverbs.rc
===================================================================
--- Frontier/trunk/Common/resources/Win32/kernelverbs.rc 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/resources/Win32/kernelverbs.rc 2007-07-29 18:44:39 UTC (rev 1722)
@@ -701,7 +701,7 @@
1, // Number of "blocks" in this resource
"window\0", // Function Processor Name
true, // Window required
- 30, // Count of verbs
+ 31, // Count of verbs
"isopen\0",
"open\0",
"isfront\0",
@@ -732,6 +732,7 @@
"about\0",
"getfile\0",
"isreadonly\0",
+ "setquickscript\0" // 2007-07-27 creedon
END
@@ -1075,7 +1076,7 @@
"hmacMD5\0",
"MD5\0",
"SHA1\0",
- "hmacSHA1\0",
+ "hmacSHA1\0"
END
1026 /* sqliteverbs */ EFP DISCARDABLE
Modified: Frontier/trunk/Common/source/command.c
===================================================================
--- Frontier/trunk/Common/source/command.c 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/source/command.c 2007-07-29 18:44:39 UTC (rev 1722)
@@ -43,53 +43,59 @@
#include "command.h"
-
#define cmdtextitem 1
-
static hdlprocessrecord quickscriptprocess = nil;
+static boolean cmdsavestring ( short stringnumber, Handle htext ) {
-static boolean cmdsavestring (short stringnumber, Handle htext) {
-#pragma unused(stringnumber)
-
- /*
- the cmd dialog only has one string, so we ignore the stringnumber param.
+ #pragma unused(stringnumber)
- set the script string in the cancoondata record, for saving -- so we have
- a permanent copy of the last script he wrote across invocations of the
- program.
+ //
+ // the cmd dialog only has one string, so we ignore the stringnumber param.
+ //
+ // set the script string in the cancoondata record, for saving -- so we
+ // have a permanent copy of the last script he wrote across invocations of
+ // the program.
+ //
+ // 2004-12-03 creedon, aradke: bug fix for hscriptstring being NULL
+ //
+ // 5.0d14 dmb: hscriptstring is now a text handle, not a hdlstring.
+ //
+ // 1993-01-21 dmb: don't set superglobals manually anymore
+ //
- 1/21/93 dmb: don't set superglobals manually anymore
+ register hdlcancoonrecord hc;
- 5.0d14 dmb: hscriptstring is now a text handle, not a hdlstring.
- */
+ Handle h;
- Handle h; /* 2004-12-03 creedon - temporary handle */
- register hdlcancoonrecord hc;
+ assert ( cancoonglobals != nil );
- assert (cancoonglobals != nil);
+ hc = cancoonglobals; // copy into register
- hc = cancoonglobals; /*copy into register*/
+ if ( ! equalhandles ( htext, ( **hc ).hscriptstring ) ) {
- if (!equalhandles (htext, (**hc).hscriptstring)) {
-
- if ((**hc).hscriptstring == nil) { /* 2004-12-03 creedon, aradke */
- copyhandle (htext, &h);
- (**hc).hscriptstring = h;
+ if ( ( **hc ).hscriptstring == NULL ) {
+
+ copyhandle ( htext, &h );
+
+ ( **hc ).hscriptstring = h;
+
}
else
- copyhandlecontents (htext, (**hc).hscriptstring);
+ copyhandlecontents ( htext, ( **hc ).hscriptstring );
+
+ ( **hc ).fldirty = true;
- (**hc).fldirty = true;
}
- return (true);
- } /*cmdsavestring*/
+ return ( true );
-
+ } // cmdsavestring
+
+
static boolean cmdloadstring (short stringnumber, Handle *h) {
#pragma unused(stringnumber)
@@ -424,5 +430,18 @@
} /*cmdstart*/
+boolean cmdsetstring ( Handle h ) {
+ //
+ // 2007-07-25 creedon: created
+ //
+
+ if ( ! cmdsavestring ( NULL, h ) )
+ return ( false );
+
+ minireloadstrings ( idcommandconfig );
+
+ return ( true );
+
+ }
Modified: Frontier/trunk/Common/source/miniwindow.c
===================================================================
--- Frontier/trunk/Common/source/miniwindow.c 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/source/miniwindow.c 2007-07-29 18:44:39 UTC (rev 1722)
@@ -51,7 +51,6 @@
#include "wpengine.h"
-
#define flmsgactive flmassiveupdate
WindowPtr miniwindow = nil;
@@ -61,7 +60,6 @@
hdlminirecord minidata = nil;
-
/*
5.0d14 dmb: major rewrite:
use wpengine, not the Dialog Manager.
@@ -1111,11 +1109,9 @@
shellbringtofront (hinfo);
- /*
- minisetvalue ();
+ // minisetvalue ();
- miniloadstrings ();
- */
+ // miniloadstrings ();
shellpushwindowglobals (hinfo);
@@ -1367,4 +1363,31 @@
} /*ministart*/
+boolean minireloadstrings ( short idconfig ) {
+ //
+ // reload the strings if the window is around
+ //
+ // 2007-07-27 creedon: created
+ //
+
+ hdlwindowinfo hinfo;
+
+ if ( minifindwindow ( idconfig, &hinfo ) ) {
+
+ shellpushwindowglobals ( hinfo );
+
+ miniloadstrings ( );
+
+ ( **minidata ).flselectallpending = true; // select all on idle
+
+ shellpopglobals ( );
+
+ return ( true );
+
+ }
+
+ return ( false );
+
+ } // minireloadstrings
+
Modified: Frontier/trunk/Common/source/shellwindowverbs.c
===================================================================
--- Frontier/trunk/Common/source/shellwindowverbs.c 2007-07-28 21:42:34 UTC (rev 1721)
+++ Frontier/trunk/Common/source/shellwindowverbs.c 2007-07-29 18:44:39 UTC (rev 1722)
@@ -59,7 +59,7 @@
typedef enum tywindowtoken {
-
+
isopenfunc,
openfunc,
@@ -118,20 +118,21 @@
#ifdef MACVERSION
- playerfunc, /*7.0b4 PBS: QuickTime Player window*/
-
+ playerfunc, // 7.0b4 PBS: QuickTime Player window
+
#endif
getfilefunc,
- isreadonlyfunc, /*7.0b6 PBS: return true if window is read-only*/
+ isreadonlyfunc, // 7.0b6 PBS: return true if window is read-only
+ setquickscriptfunc, // 2007-07-25 creedon: window.setQuickScript
+
ctwindowverbs
+
} tywindowtoken;
-
-
static boolean getwinaddressparam (hdltreenode hfirst, short pnum, hdlwindowinfo *hinfo) {
hdlhashtable htable;
@@ -1078,18 +1079,21 @@
static boolean windowfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
-
- /*
- 10/3/91 dmb: moved a couple of verbs in from shellverbs.c -- they're the
- odd ones out following zoomfunc.
-
- 6/24/92 dmb: added gettitle, settitle verbs
-
- 6/1/93 dmb: when vreturned is nil, return whether or not verb token must
- be run in the Frontier process
- 6.2a8 AR: systemstatsfunc now works for GDBs (at least partly)
- */
+ //
+ // 2007-07-28 creedon: added setquickscriptfunc case, set the Quick Script
+ // window script
+ //
+ // 6.2a8 AR: systemstatsfunc now works for GDBs (at least partly)
+ //
+ // 1993-06-01 dmb: when vreturned is nil, return whether or not verb token
+ // must be run in the Frontier process
+ //
+ // 1992-06-24 dmb: added gettitle, settitle verbs
+ //
+ // 1991-10-03 dmb: moved a couple of verbs in from shellverbs.c -- they're
+ // the odd ones out following zoomfunc.
+ //
register hdltreenode hp = hparam1;
register tyvaluerecord *v = vreturned;
@@ -1275,12 +1279,29 @@
case isreadonlyfunc: /*7.0b6 PBS: return true if a window is read-only*/
return (isreadonlyverb (hparam1, v));
+
+ case setquickscriptfunc: {
+ Handle h;
+
+ flnextparamislast = true;
+
+ if ( ! getreadonlytextvalue ( hparam1, 1, &h ) )
+ return (false);
+
+ ( *v ).data.flvalue = cmdsetstring ( h );
+
+ return ( true );
+
+ }
+
default:
+
errornum = notimplementederror;
goto error;
- } /*switch*/
+
+ } // switch
error:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|