You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2003/10/01 20:08:58 UTC
cvs commit: jakarta-tomcat-connectors/procrun tomcat.bmp extend.h tomcat.c tomcat.rc
mturk 2003/10/01 11:08:58
Modified: procrun extend.h tomcat.c tomcat.rc
Added: procrun tomcat.bmp
Log:
Implement the list view parser as callback.
Move the listview creation back to procrun.
Revision Changes Path
1.2 +4 -7 jakarta-tomcat-connectors/procrun/extend.h
Index: extend.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/procrun/extend.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- extend.h 29 Sep 2003 09:01:39 -0000 1.1
+++ extend.h 1 Oct 2003 18:08:58 -0000 1.2
@@ -66,13 +66,10 @@
*/
-#define IDB_BMPSPLASH 201
-#define IDI_ICOI 202
-#define IDI_ICOS 203
-#define IDI_ICOW 204
-#define IDD_DLGSPLASH 205
-#define IDL_INFO 206
-
+#define EXT_ICOCONWRAP 1
+#define EXT_ICOCONTRY 1
+#define EXT_ICOCONTRYSTOP 1
+#define EXT_BMPSPLASH 1
#define PROCRUN_REGKEY_ROOT "SOFTWARE\\Apache Software Foundation\\Tomcat Service Manager"
#define PROCRUN_GUI_DISPLAY "Tomcat Service Manager"
1.2 +9 -104 jakarta-tomcat-connectors/procrun/tomcat.c
Index: tomcat.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/procrun/tomcat.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tomcat.c 29 Sep 2003 09:01:39 -0000 1.1
+++ tomcat.c 1 Oct 2003 18:08:58 -0000 1.2
@@ -91,16 +91,12 @@
#include <jni.h>
#include "procrun.h"
-
-
-int ac_lview_current = 0;
-static struct {
- char * label;
- DWORD width;
-} ac_columns[] = {
+
+prcrun_lview_t tac_columns[] = {
{ "Status", 140 },
{ "Class", 172 },
{ "Message", 300 },
+ { NULL, 0 },
};
static char *ac_lv_stat = NULL;
@@ -108,70 +104,10 @@
static char *ac_lv_class = NULL;
static char *ac_lv_clmsg = NULL;
static int ac_lv_iicon = 0;
-/* splash window handle */
-static HWND ac_splash_hwnd = NULL;
-static HWND ac_splist_hwnd;
-
-#define STR_NOT_NULL(s) { if((s) == NULL) (s) = ""; }
-
-
-LRESULT CALLBACK ac_splash_dlg_proc(HWND hdlg, UINT message, WPARAM wparam, LPARAM lparam)
-{
-
- switch (message) {
- case WM_INITDIALOG:
- ac_splash_hwnd = hdlg;
- ac_center_window(hdlg);
- ac_splist_hwnd = GetDlgItem(hdlg, IDL_INFO);
- break;
- }
+
- return FALSE;
-}
-void acx_create_view(HWND hdlg, LPRECT pr, LPRECT pw)
-{
- LV_COLUMN lvc;
- int i;
- HIMAGELIST imlist;
- HICON hicon;
- imlist = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 3, 0);
- hicon = LoadImage(ac_instance, MAKEINTRESOURCE(IDI_ICOI),
- IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
- ImageList_AddIcon(imlist, hicon);
- hicon = LoadImage(ac_instance, MAKEINTRESOURCE(IDI_ICOW),
- IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
- ImageList_AddIcon(imlist, hicon);
- hicon = LoadImage(ac_instance, MAKEINTRESOURCE(IDI_ICOS),
- IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
- ImageList_AddIcon(imlist, hicon);
-
- ac_list_hwnd = CreateWindowEx(0L, WC_LISTVIEW, "",
- WS_VISIBLE | WS_CHILD |
- LVS_REPORT | WS_EX_CLIENTEDGE,
- 0, 0, pr->right - pr->left,
- pr->bottom - abs((pw->top - pw->bottom)),
- hdlg, NULL, ac_instance, NULL);
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
-
- ListView_SetImageList(ac_list_hwnd,imlist, LVSIL_SMALL);
-
- for (i = 0; i < sizeof(ac_columns) / sizeof(ac_columns[0]); ++i) {
- lvc.iSubItem = i;
- lvc.cx = ac_columns[i].width;
- lvc.pszText = ac_columns[i].label;
- ListView_InsertColumn(ac_list_hwnd, i, &lvc );
- }
-#ifdef LVS_EX_FULLROWSELECT
- ListView_SetExtendedListViewStyleEx(ac_list_hwnd, 0,
- LVS_EX_FULLROWSELECT |
- LVS_EX_INFOTIP);
-#endif
-
-}
-
-void acx_parse_list_string(const char *str)
+void tc_parse_list_string(const char *str)
{
int row = 0x7FFFFFFF;
LV_ITEM lvi;
@@ -246,43 +182,12 @@
}
-void acx_process_splash(const char *str)
-{
- /* set the status to 'green' when received Jk running
- * and close the spash window if present
- */
- if (STRN_COMPARE(str, "INFO: Jk running")) {
- ac_show_try_icon(ac_main_hwnd, NIM_MODIFY, ac_cmdname, 0);
- /* kill the splash window if present */
- if (ac_splash_hwnd)
- EndDialog(ac_splash_hwnd, TRUE);
- ac_splash_hwnd = NULL;
- }
- else if (ac_splash_hwnd) {
- SendMessage(ac_splist_hwnd, LB_INSERTSTRING, 0, (LPARAM)str);
- }
-
-}
-
-void acx_create_spash(HWND hwnd)
-{
-
- if (ac_use_try) {
- DialogBox(ac_instance, MAKEINTRESOURCE(IDD_DLGSPLASH),
- hwnd, (DLGPROC)ac_splash_dlg_proc);
- }
-
-}
-
-void acx_close_spash()
-{
- if (ac_use_try && ac_splash_hwnd)
- EndDialog(ac_splash_hwnd, TRUE);
-}
-
void acx_init_extended()
{
- ac_use_lview = 1;
+ ac_use_lview = 1;
+ ac_splash_msg = "INFO: Jk running";
+ ac_columns = &tac_columns[0];
+ lv_parser = tc_parse_list_string;
}
#endif
1.2 +1 -17 jakarta-tomcat-connectors/procrun/tomcat.rc
Index: tomcat.rc
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/procrun/tomcat.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tomcat.rc 29 Sep 2003 09:01:39 -0000 1.1
+++ tomcat.rc 1 Oct 2003 18:08:58 -0000 1.2
@@ -59,28 +59,12 @@
#include "procrun.h"
#include "windows.h"
-IDI_ICOI ICON "icoi.ico"
-IDI_ICOS ICON "icos.ico"
-IDI_ICOW ICON "icow.ico"
-
IDI_ICOCONWRAP ICON "tomcatp.ico"
IDI_ICOCONTRY ICON "tomcatr.ico"
IDI_ICOCONTRYSTOP ICON "tomcats.ico"
#ifdef _MSC_VER
-IDB_BMPSPLASH BITMAP DISCARDABLE "splash.bmp"
+IDB_BMPSPLASH BITMAP DISCARDABLE "tomcat.bmp"
#endif
#include "procrun.rc"
-
-IDD_DLGSPLASH DIALOGEX 0, 0, 322, 151
-STYLE DS_SYSMODAL | DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE |
- WS_BORDER
-EXSTYLE WS_EX_TOPMOST
-FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
-BEGIN
- LISTBOX IDL_INFO,7,126,217,9, LBS_NOINTEGRALHEIGHT |
- LBS_NOSEL | NOT WS_BORDER | NOT LBS_USETABSTOPS
- CONTROL IDB_BMPSPLASH,IDC_STATIC,"Static",SS_BITMAP |
- SS_CENTERIMAGE,0,0,322,151
-END
1.1 jakarta-tomcat-connectors/procrun/tomcat.bmp
<<Binary file>>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org