--- /dev/null
+#!/bin/sh
+
+if [ "$XDG_RUNTIME_DIR" = "" ]; then
+ export XDG_RUNTIME_DIR=/run
+fi
+
+WINFO_RUN_DIR="$XDG_RUNTIME_DIR/pepper"
+
+if [ ! -d "$WINFO_RUN_DIR" ]; then
+ echo "Error: no ${WINFO_RUN_DIR} directory exist."
+ exit 1
+fi
+
+cd $WINFO_RUN_DIR
+
+function usage()
+{
+ echo "Usage> # winfo {command}"
+ echo ""
+ echo " Supported commands:"
+ echo ""
+ echo " protocol_trace_on (turn on wayland protocol trace)"
+ echo " protocol_trace_off (turn off wayland protocol trace)"
+ echo " stdout (redirect STDOUT to a file : /run/pepper/stdout.txt)"
+ echo " stderr (redirect STDERR to a file : /run/pepper/stderr.txt)"
+ echo " keygrab_status (MUST BE IMPLEMENTED)"
+ echo " topvwins (MSUT BE IMPLEMENTED)"
+ echo " connected_clients (display connected clients info : pid, uid, gid, socket fd)"
+ echo " reslist (display resources info of the connected clients"
+ echo " help (display this help message)"
+ echo ""
+ echo " To execute commands, just create/remove/update a file with the commands above."
+ echo " Please refer to the following examples."
+ echo ""
+ echo " # winfo protocol_trace_on : enable event trace"
+ echo " # winfo protocol_trace_off : disable event trace"
+ echo " # winfo stdout : redirect STDOUT"
+ echo " # winfo stderr : redirect STDERR"
+ echo " # winfo keygrab_status : display keygrab status"
+ echo " # winfo topvwins : display top/visible window stack"
+ echo " # winfo connected_clients : display connected clients information"
+ echo " # winfo reslist : display each resources information of connected clients"
+ echo " # winfo help : display this help message"
+ echo ""
+}
+
+if [ "$1" = "" ]; then
+ usage
+ exit 1
+fi
+
+CMD="$1"
+
+rm -f ${CMD} ; touch ${CMD}
+echo "winfo ${CMD}"
#define STDOUT_REDIR "stdout"
#define STDERR_REDIR "stderr"
-#define EVENT_TRACE_ON "event_trace_on"
-#define EVENT_TRACE_OFF "event_trace_off"
+#define PROTOCOL_TRACE_ON "protocol_trace_on"
+#define PROTOCOL_TRACE_OFF "protocol_trace_off"
#define KEYGRAB_STATUS "keygrab_status"
#define TOPVWINS "topvwins"
#define CONNECTED_CLIENTS "connected_clients"
static void
_headless_debug_usage()
{
- fprintf(stdout, "Commands:\n\n");
- fprintf(stdout, "\t %s\n", EVENT_TRACE_ON);
- fprintf(stdout, "\t %s\n", EVENT_TRACE_OFF);
+ fprintf(stdout, "Supported commands:\n\n");
+ fprintf(stdout, "\t %s\n", PROTOCOL_TRACE_ON);
+ fprintf(stdout, "\t %s\n", PROTOCOL_TRACE_OFF);
fprintf(stdout, "\t %s\n", STDOUT_REDIR);
fprintf(stdout, "\t %s\n", STDERR_REDIR);
fprintf(stdout, "\t %s\n", KEYGRAB_STATUS);
fprintf(stdout, "\nTo execute commands, just create/remove/update a file with the commands above.\n");
fprintf(stdout, "Please refer to the following examples.\n\n");
- fprintf(stdout, "\t touch %s (to enable event trace)\n", EVENT_TRACE_ON);
- fprintf(stdout, "\t rm -f %s (to disable event trace)\n", EVENT_TRACE_ON);
- fprintf(stdout, "\t touch %s (to disable event trace)\n", EVENT_TRACE_OFF);
- fprintf(stdout, "\t touch stdout (to redirect STDOUT to stdout.txt)\n");
- fprintf(stdout, "\t touch stderr (to redirect STDERR to stderr.txt)\n");
- fprintf(stdout, "\t touch connected_clients (to display connected clients information)\n");
- fprintf(stdout, "\t echo 1 > connected_clients (to display connected clients information)\n");
- fprintf(stdout, "\t touch reslist (to display resources information of the each connected client)\n");
- fprintf(stdout, "\t echo 1 > reslist (to display resources information of the each connected client)\n");
+ fprintf(stdout, "\t # winfo protocol_trace_on\t : enable event trace\n");
+ fprintf(stdout, "\t # winfo event_trace_off\t : disable event trace\n");
+ fprintf(stdout, "\t # winfo stdout\t\t\t : redirect STDOUT\n");
+ fprintf(stdout, "\t # winfo stderr\t\t\t : redirect STDERR\n");
+ fprintf(stdout, "\t # winfo keygrab_status\t\t : display keygrab status\n");
+ fprintf(stdout, "\t # winfo topvwins\t\t : display top/visible window stack\n");
+ fprintf(stdout, "\t # winfo connected_clients\t : display connected clients information\n");
+ fprintf(stdout, "\t # winfo reslist\t\t : display each resources information of connected clients\n");
+ fprintf(stdout, "\t # winfo help\t\t\t : display this help message\n");
}
static void
-_headless_debug_event_trace_on(headless_debug_t *hdebug, void *data)
+_headless_debug_protocol_trace_on(headless_debug_t *hdebug, void *data)
{
(void) hdebug;
(void) data;
}
static void
-_headless_debug_event_trace_off(headless_debug_t *hdebug, void *data)
+_headless_debug_protocol_trace_off(headless_debug_t *hdebug, void *data)
{
(void) hdebug;
(void) data;
}
+static void
+_headless_debug_NOT_supported(headless_debug_t *hdebug, void *data)
+{
+ (void) hdebug;
+ (void) data;
+
+ PEPPER_TRACE("NOT SUPPORTED. WILL BE IMPLEMENTED SOON.\n");
+}
+
static const headless_debug_action_t debug_actions[] =
{
{ STDOUT_REDIR, _headless_debug_redir_stdout, NULL },
{ STDERR_REDIR, _headless_debug_redir_stderr, NULL },
- { EVENT_TRACE_ON, _headless_debug_event_trace_on, _headless_debug_event_trace_off },
- { EVENT_TRACE_OFF, _headless_debug_event_trace_off, NULL },
- { KEYGRAB_STATUS, _headless_debug_dummy, NULL },
- { TOPVWINS, _headless_debug_dummy, NULL },
+ { PROTOCOL_TRACE_ON, _headless_debug_protocol_trace_on, _headless_debug_protocol_trace_off },
+ { PROTOCOL_TRACE_OFF, _headless_debug_protocol_trace_off, NULL },
+ { KEYGRAB_STATUS, _headless_debug_NOT_supported, NULL },
+ { TOPVWINS, _headless_debug_NOT_supported, NULL },
{ CONNECTED_CLIENTS, _headless_debug_connected_clients, NULL },
{ CLIENT_RESOURCES, _headless_debug_connected_clients, NULL },
{ HELP_MSG, _headless_debug_dummy, NULL },