#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <l4/dope/dopelib.h>
#include <l4/util/atomic.h>
#include <l4/util/bitops.h>
#include <l4/log/l4log.h>
#include "threadinfo.h"
#include "subwindow.h"
#include "jtop.h"
#include "startup.h"
#include "service.h"
#include "scope.h"
#include "debug.h"
Functions | |
static void | press_callback (dope_event *ev, void *arg) |
static void | sort_callback (dope_event *ev, void *arg) |
Callback for setting sort-orders in windows. | |
static void | select_all_callback (dope_event *ev, void *arg) |
Callback for Top "X" select-button press. | |
static void | disp_insert (load_display_t *disp) |
Insert a disp into the list. | |
static load_display_t * | disp_unlink (int id) |
Remove a disp from the list. | |
load_display_t * | disp_by_nr (int id) |
Return a locked display by its number. | |
static load_display_t * | disp_alloc (void) |
Allocate a new display. | |
static void | disp_free (load_display_t *disp) |
Free a load display with all its items. | |
int | subwindow_create (int id_parent) |
Generate a new window from the selected threads of a parent. | |
static void | subwindow_close (int id) |
static void | zap_threads (int id) |
static void | subwindow_scroll (int id, int dir) |
static void | subwindow_scrollpage (int id, int dir) |
static void | subwindow_scrolledge (int id, int which) |
static void | subwindow_toggletimedisp (int id) |
int | do_nonmouse_event (dope_event *ev, void *arg) |
Check if it is a non-mouse event and call press_callback if so. | |
void | subwindow_name_callback (dope_event *ev, void *arg) |
Callback for name-label press. | |
void | subwindow_thread_callback (dope_event *ev, void *arg) |
Callback for thread-label press. | |
Variables | |
load_display_t | main_disp |
os_mutex | disp_list_lock |
static long | id_mask = -1 |
static load_display_t* disp_alloc | ( | void | ) | [static] |
Allocate a new display.
This function returns a new display structure. The fields win, grid and name are already filled in. If it is called the first time (i.e., list_count==0), main_disp is returned.
!0 | Ok | |
<0 | Error |
References gen_name().
Referenced by subwindow_create().
load_display_t* disp_by_nr | ( | int | id | ) |
Return a locked display by its number.
This function uses the list-lock.
Referenced by scope_create(), select_all_callback(), select_callback(), sort_callback(), subwindow_create(), subwindow_name_callback(), and subwindow_thread_callback().
static void disp_free | ( | load_display_t * | disp | ) | [static] |
Free a load display with all its items.
disp is unlocked.
Referenced by subwindow_create().
static void disp_insert | ( | load_display_t * | disp | ) | [static] |
static load_display_t* disp_unlink | ( | int | id | ) | [static] |
Remove a disp from the list.
This function removes the load-display specified by idx from the list.
This function uses the list-lock.
int do_nonmouse_event | ( | dope_event * | ev, | |
void * | arg | |||
) | [inline] |
Check if it is a non-mouse event and call press_callback if so.
If the event is not a mouse-event, it is probably a keyboard-event, meant for the press_callback. An event-specific bind (press-mouse, press-keyboard) would be nice here.
Referenced by select_all_callback(), sort_callback(), subwindow_name_callback(), and subwindow_thread_callback().
void select_all_callback | ( | dope_event * | ev, | |
void * | arg | |||
) | [static] |
Callback for Top "X" select-button press.
arg | a jtop_callback_t type, which win and idx set. win is the window-id, idx is the nr of the row (0..) |
References disp_by_nr(), and do_nonmouse_event().
Referenced by subwindow_create().
static void sort_callback | ( | dope_event * | ev, | |
void * | arg | |||
) | [static] |
Callback for setting sort-orders in windows.
arg | a jtop_callback_t type, which win and idx set. win is the window-id, idx is the sort_t |
References disp_by_nr(), do_nonmouse_event(), and update_values().
Referenced by subwindow_create().
int subwindow_create | ( | int | id_parent | ) |
Generate a new window from the selected threads of a parent.
No reference is held to the parent, so the parent can be destroyed when this function returned.
id_parent | Id of the parent disp. Used for getting the switch- setting. Set it to -1 to create the root-window. |
References disp_alloc(), disp_by_nr(), disp_free(), disp_insert(), select_all_callback(), sort_callback(), and update_values().
void subwindow_name_callback | ( | dope_event * | ev, | |
void * | arg | |||
) |
Callback for name-label press.
Left key toggles selection, right key disables.
arg | a jtop_callback_t type, which win and idx set. win is the window-id, idx is the nr of the row (0..) |
References disp_by_nr(), and do_nonmouse_event().
void subwindow_thread_callback | ( | dope_event * | ev, | |
void * | arg | |||
) |
Callback for thread-label press.
This callback selects threads that are similar to the clicked one. With L4, this is the same task, with Linux, this is something else.
Left key toggles selection, right key disables.
arg | a jtop_callback_t type, which win and idx set. win is the window-id, idx is the nr of the row (0..) |
References disp_by_nr(), and do_nonmouse_event().