void ltt_tracefile_destroy(LttTracefile *tf);
void ltt_tracefile_copy(LttTracefile *dest, const LttTracefile *src);
+void get_absolute_pathname(const char *pathname, char * abs_pathname);
#endif // TRACE_H
#define HOOK_H
#include <glib.h>
+#include <ltt/compiler.h>
/* A hook is a function to call with the supplied hook data, and with
call site specific data (e.g., hooks for events are called with a
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include <lttv/lttv.h>
+#include <lttvwindow/lttvwindow.h>
#include "cfv.h"
#include "drawing.h"
#include "processlist.h"
#include "eventhooks.h"
-#include <lttv/lttv.h>
extern GSList *g_control_flow_data_list;
#include <gdk/gdk.h>
#include <string.h>
+#include <ltt/trace.h>
+
#include <lttv/lttv.h>
#include <lttv/tracecontext.h>
#include <lttvwindow/lttvwindow.h>
LttTime start, time_end;
LttTime window_end = time_window.end_time;
- g_debug("req : window start_time : %u, %u", time_window.start_time.tv_sec,
+ g_debug("req : window start_time : %lu, %lu", time_window.start_time.tv_sec,
time_window.start_time.tv_nsec);
- g_debug("req : window time width : %u, %u", time_window.time_width.tv_sec,
+ g_debug("req : window time width : %lu, %lu", time_window.time_width.tv_sec,
time_window.time_width.tv_nsec);
- g_debug("req : window_end : %u, %u", window_end.tv_sec,
+ g_debug("req : window_end : %lu, %lu", window_end.tv_sec,
window_end.tv_nsec);
g_debug("x is : %i, x+width is : %i", x, x+width);
LttvTraceHook hook;
- LttvAttributeValue val;
-
nb_trace = lttv_traceset_number(traceset);
// FIXME : eventually request for more traces
// for(i = 0 ; i < nb_trace ; i++) {
events_request->before_request = before_request_hook;
events_request->after_request = after_request_hook;
- g_debug("req : start : %u, %u", start.tv_sec,
+ g_debug("req : start : %lu, %lu", start.tv_sec,
start.tv_nsec);
- g_debug("req : end : %u, %u", time_end.tv_sec,
+ g_debug("req : end : %lu, %lu", time_end.tv_sec,
time_end.tv_nsec);
lttvwindow_events_request(tab, events_request);
LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
TimeWindow time_window =
lttvwindow_get_time_window(cfd->tab);
- LttTime end_time = time_window.end_time;
guint width = cfd->drawing->width;
guint x=0;
g_debug("Begin of chunk");
ControlFlowData *cfd = events_request->viewer_data;
LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
- LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
+ //LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
guint num_cpu =
ltt_trace_per_cpu_tracefile_number(tss->parent.traces[TRACE_NUMBER]->t);
gint x, x_end, width;
ControlFlowData *cfd = events_request->viewer_data;
- LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
+ LttvTracesetContext *tsc = (LttvTracesetContext*)tss;
Drawing_t *drawing = cfd->drawing;
TimeWindow time_window =
g_debug("request expose");
- LttTime window_end = time_window.end_time;
-
-#if 0
- convert_time_to_pixels(
- time_window,
- cfd->drawing->last_start,
- drawing->width,
- &x);
-
-#endif //0
convert_time_to_pixels(
time_window,
end_time,
drawing->width,
&x_end);
x = drawing->damage_begin;
- // x_end = drawing->damage_end;
+
width = x_end - x;
drawing->damage_begin = x+width;
- //drawing->damage_end = drawing->width;
-
- /* ask for the buffer to be redrawn */
-
- //gtk_widget_queue_draw_area ( drawing->drawing_area,
- // 0, 0,
- // drawing->width, drawing->height);
- /* FIXME
- * will need more precise pixel_to_time and time_to_pixel conversion
- * functions to redraw only the needed area. */
gtk_widget_queue_draw_area ( drawing->drawing_area,
x, 0,
width, drawing->height);
{
LttTime time;
- LttTime window_end = time_window.end_time;
-
-
/* left mouse button click */
g_debug("x click is : %f", event->x);
{
GdkPixmap *pixmap;
- if(unlikely(drawing->height == height)) {
+ if(unlikely((guint)drawing->height == height)) {
pixmap = gdk_pixmap_new(
drawing->drawing_area->window,
drawing->width + SAFETY,
PangoContext *context;
PangoLayout *layout;
- PangoAttribute *attribute;
PangoFontDescription *FontDesc;
- gint Font_Size;
PangoRectangle ink_rect;
- guint global_width=0;
+ gint global_width=0;
GdkColor foreground = { 0, 0, 0, 0 };
GdkColor background = { 0, 0xffff, 0xffff, 0xffff };
GtkWidget *drawing_get_widget(Drawing_t *drawing);
GtkWidget *drawing_get_drawing_area(Drawing_t *drawing);
+
+void drawing_data_request(Drawing_t *drawing,
+ GdkPixmap **pixmap,
+ gint x, gint y,
+ gint width,
+ gint height);
+
void drawing_draw_line( Drawing_t *drawing,
GdkPixmap *pixmap,
guint x1, guint y1,
#include <lttv/tracecontext.h>
#include <lttv/state.h>
+#include <lttv/lttv.h>
#include "drawitem.h"
PangoContext *context;
PangoLayout *layout;
- PangoAttribute *attribute;
PangoFontDescription *font_desc;// = pango_font_description_new();
- gint font_size;
PangoRectangle ink_rect;
layout = draw_context->pango_layout;
DrawableItems item;
LttvHooks *hook;
};
-
+#if 0
/*
* We define here each items that can be drawn, together with their
* associated priority. Many item types can have the same priority,
30, /* ITEM_POINT */
10 /* ITEM_BACKGROUND */
};
+#endif //0
/*
* Here are the different structures describing each item type that can be
{
ControlFlowData *control_flow_data = (ControlFlowData *)hook_data;
LttvTrace *trace = (LttvTrace*)call_data;
- LttvTracesetContext *tsc =
- lttvwindow_get_traceset_context(control_flow_data->tab);
control_flow_data->background_info_waiting--;
g_debug("DEBUG : event selected by main window : %u", *event_number);
+ return 0;
}
/* Function that selects the color of status&exemode line */
* We definitely can draw the items related to the ending state.
*/
- /* Check if the x position is unset. In can have been left unset by
- * a draw closure from a after chunk hook. This should never happen,
- * because it must be set by before chunk hook to the damage_begin
- * value.
- */
- g_assert(hashed_process_data->x.middle != -1);
if(ltt_time_compare(hashed_process_data->next_good_time,
evtime) > 0)
{
* We definitely can draw the items related to the ending state.
*/
- /* Check if the x position is unset. In can have been left unset by
- * a draw closure from a after chunk hook. This should never happen,
- * because it must be set by before chunk hook to the damage_begin
- * value.
- */
- g_assert(hashed_process_data->x.middle != -1);
-
if(ltt_time_compare(hashed_process_data->next_good_time,
evtime) > 0)
{
LttTime evtime = ltt_event_time(e);
/* Add process to process list (if not present) */
- LttvProcessState *process_out, *process_in;
+ LttvProcessState *process_in;
LttTime birth;
- guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
+ guint y_in = 0, height = 0, pl_height = 0;
HashedProcessData *hashed_process_data_in = NULL;
ProcessList *process_list = control_flow_data->process_list;
/* Now, the process is in the state hash and our own process hash.
* We definitely can draw the items related to the ending state.
*/
-
- /* Check if the x position is unset. In can have been left unset by
- * a draw closure from a after chunk hook. This should never happen,
- * because it must be set by before chunk hook to the damage_begin
- * value.
- */
- g_assert(hashed_process_data->x.over != -1);
if(likely(ltt_time_compare(hashed_process_data->next_good_time,
evtime) > 0))
* We definitely can draw the items related to the ending state.
*/
- /* Check if the x position is unset. In can have been left unset by
- * a draw closure from a after chunk hook. This should never happen,
- * because it must be set by before chunk hook to the damage_begin
- * value.
- */
- g_assert(hashed_process_data->x.over != -1);
-
if(likely(ltt_time_compare(hashed_process_data->next_good_time,
evtime) > 0))
{
* currently shown time interval. (reuse is only for scrolling)
*/
- g_info("Old time window HOOK : %u, %u to %u, %u",
+ g_info("Old time window HOOK : %lu, %lu to %lu, %lu",
old_time_window->start_time.tv_sec,
old_time_window->start_time.tv_nsec,
old_time_window->time_width.tv_sec,
old_time_window->time_width.tv_nsec);
- g_info("New time window HOOK : %u, %u to %u, %u",
+ g_info("New time window HOOK : %lu, %lu to %lu, %lu",
new_time_window->start_time.tv_sec,
new_time_window->start_time.tv_nsec,
new_time_window->time_width.tv_sec,
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
Drawing_t *drawing = control_flow_data->drawing;
- GtkWidget *widget = drawing->drawing_area;
drawing_clear(control_flow_data->drawing);
redraw_notify(control_flow_data, NULL);
request_background_data(control_flow_data);
-#if 0
- drawing->damage_begin = 0;
- drawing->damage_end = drawing->width;
- if(drawing->damage_begin < drawing->damage_end)
- {
- drawing_data_request(drawing,
- &drawing->pixmap,
- drawing->damage_begin,
- 0,
- drawing->damage_end-drawing->damage_begin,
- drawing->height);
- }
-
- gtk_widget_queue_draw_area(drawing->drawing_area,
- 0,0,
- drawing->width,
- drawing->height);
-#endif //0
return FALSE;
}
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
Drawing_t *drawing = control_flow_data->drawing;
- GtkWidget *widget = drawing->drawing_area;
//g_assert(widget->allocation.width == drawing->damage_end);
LttTime trace_start = tsc->time_span.start_time;
LttTime trace_end = tsc->time_span.end_time;
- g_info("New current time HOOK : %u, %u", current_time.tv_sec,
+ g_info("New current time HOOK : %lu, %lu", current_time.tv_sec,
current_time.tv_nsec);
/* Only draw for processes that are currently in the trace states */
- guint y = 0, height = 0, pl_height = 0;
+ guint y = 0, height = 0;
ProcessList *process_list = control_flow_data->process_list;
- LttTime birth = process_info->birth;
#ifdef EXTRA_CHECK
/* Should be alike when background info is ready */
if(control_flow_data->background_info_waiting==0)
* We definitely can draw the items related to the ending state.
*/
- /* Check if the x position is unset. In can have been left unset by
- * a draw closure from a after chunk hook. This should never happen,
- * because it must be set by before chunk hook to the damage_begin
- * value.
- */
- g_assert(hashed_process_data->x.over != -1);
-
if(unlikely(ltt_time_compare(hashed_process_data->next_good_time,
evtime) <= 0))
{
EventsRequest *events_request = (EventsRequest*)hook_data;
ControlFlowData *control_flow_data = events_request->viewer_data;
LttvTracesetState *tss = (LttvTracesetState*)call_data;
- LttvTracesetContext *tsc = (LttvTracesetContext*)call_data;
ProcessList *process_list = control_flow_data->process_list;
LttTime end_time = events_request->end_time;
#include "hGuiControlFlowInsert.xpm"
-static LttvModule *Main_Win_Module;
-
-
/** Array containing instanced objects. Used when module is unloaded */
GSList *g_control_flow_data_list = NULL ;
-
-
/*****************************************************************************
* Functions for module loading/unloading *
*****************************************************************************/
*/
static void destroy() {
g_info("GUI Control Flow Viewer destroy()");
- int i;
g_slist_foreach(g_control_flow_data_list, destroy_walk, NULL );
static guint process_list_hash_fct(gconstpointer key)
{
- guint pid = ((ProcessInfo*)key)->pid;
- return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((ProcessInfo*)key)->cpu);
+ guint pid = ((const ProcessInfo*)key)->pid;
+ return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((const ProcessInfo*)key)->cpu);
}
/* If hash is good, should be different */
guint trace_num)
{
ProcessInfo process_info;
- gint *path_indices;
HashedProcessData *hashed_process_data;
GtkTreeIter iter;
guint pid, guint cpu, LttTime *birth, guint trace_num)
{
ProcessInfo process_info;
- gint *path_indices;
- GtkTreePath *tree_path;
process_info.pid = pid;
if(pid == 0)
}
if(GTK_IS_TREE_VIEW(widget)) {
- gtk_tree_view_set_headers_clickable(widget, TRUE);
+ gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(widget), TRUE);
}
gtk_widget_add_events(widget, GDK_BUTTON_PRESS_MASK);
g_signal_connect (G_OBJECT(widget),
void
insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data)
{
- guint val = 20;
-
insert_viewer((GtkWidget*)menuitem, (lttvwindow_viewer_constructor)user_data);
- // selected_hook(&val);
}
mw_data = (MainWindow *) g_object_get_data(G_OBJECT(mw),"main_window_data");
if(mw_data == NULL){
- g_printf("Main window data does not exist\n");
+ g_warning("Main window data does not exist\n");
return NULL;
}
return mw_data;
if(child == NULL) return -1;
gint pos;
- GValue value = { 0, };
+ GValue value;
+ memset(&value, 0, sizeof(GValue));
g_value_init(&value, G_TYPE_INT);
gtk_container_child_get_property(GTK_CONTAINER(container),
child,
gboolean lttvwindow_process_pending_requests(Tab *tab)
{
- unsigned max_nb_events;
- GdkWindow * win;
- GdkCursor * new;
GtkWidget* widget;
LttvTracesetContext *tsc;
LttvTracefileContext *tfc;
ltime = g_slist_append(ltime, g_slist_nth_data(list_out, 0));
for(iter=g_slist_nth(list_out,1);iter!=NULL;iter=g_slist_next(iter)) {
/* Find all time requests with the lowest start time in list_out */
- guint index_ltime = g_array_index(ltime, guint, 0);
EventsRequest *event_request_ltime = (EventsRequest*)g_slist_nth_data(ltime, 0);
EventsRequest *event_request_list_out = (EventsRequest*)iter->data;
events_request->event_by_id);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
- g_assert(events_request->trace < nb_trace &&
+ g_assert((guint)events_request->trace < nb_trace &&
events_request->trace > -1);
LttvTraceContext *tc = tsc->traces[events_request->trace];
events_request->event_by_id);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
- g_assert(events_request->trace < nb_trace &&
+ g_assert((guint)events_request->trace < nb_trace &&
events_request->trace > -1);
LttvTraceContext *tc = tsc->traces[events_request->trace];
events_request->event_by_id);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
- g_assert(events_request->trace < nb_trace &&
+ g_assert((guint)events_request->trace < nb_trace &&
events_request->trace > -1);
LttvTraceContext *tc = tsc->traces[events_request->trace];
{
/* 4. Call process traceset middle */
- g_debug("Calling process traceset middle with %p, %lu sec %lu nsec, %lu nb ev, %p end pos", tsc, end_time.tv_sec, end_time.tv_nsec, end_nb_events, end_position);
+ g_debug("Calling process traceset middle with %p, %lu sec %lu nsec, %u nb ev, %p end pos", tsc, end_time.tv_sec, end_time.tv_nsec, end_nb_events, end_position);
count = lttv_process_traceset_middle(tsc, end_time, end_nb_events, end_position);
tfc = lttv_traceset_context_get_current_tfc(tsc);
const char * dir;
char abs_path[PATH_MAX];
gint id;
- gint i;
MainWindow * mw_data = get_window_data_struct(widget);
GtkWidget * notebook = lookup_widget(widget, "MNotebook");
{
TimeInterval time_span;
TimeWindow new_time_window;
- LttTime current_time, time_delta, time_s, time_e, time_tmp;
+ LttTime current_time, time_delta;
MainWindow * mw_data = get_window_data_struct(widget);
LttvTracesetContext *tsc;
GtkWidget * notebook = lookup_widget(widget, "MNotebook");
lttv_module_require(str1, &error);
#endif //0
lttv_library_load(str1, &error);
- if(error != NULL) g_warning(error->message);
+ if(error != NULL) g_warning("%s", error->message);
else g_printf("Load library: %s\n", str);
g_strfreev(dir);
case GTK_RESPONSE_REJECT:
{
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
- LttvLibrary *library;
- {
- GPtrArray *name;
- guint nb,i;
- gchar *lib_name;
- name = g_ptr_array_new();
- nb = lttv_library_number();
- LttvLibraryInfo *lib_info = g_new(LttvLibraryInfo,nb);
- /* ask for the library name */
+ LttvLibrary *library = NULL;
+ GPtrArray *name;
+ guint nb,i;
+ gchar *lib_name;
+ name = g_ptr_array_new();
+ nb = lttv_library_number();
+ LttvLibraryInfo *lib_info = g_new(LttvLibraryInfo,nb);
+ /* ask for the library name */
+
+ for(i=0;i<nb;i++){
+ LttvLibrary *iter_lib = lttv_library_get(i);
+ lttv_library_info(iter_lib, &lib_info[i]);
+
+ gchar *path = lib_info[i].name;
+ g_ptr_array_add(name, path);
+ }
+ lib_name = get_selection((char **)(name->pdata), name->len,
+ "Select a library", "Libraries");
+ if(lib_name != NULL) {
for(i=0;i<nb;i++){
- LttvLibrary *iter_lib = lttv_library_get(i);
- lttv_library_info(iter_lib, &lib_info[i]);
-
- gchar *path = lib_info[i].name;
- g_ptr_array_add(name, lib_info[i].name);
- }
- lib_name = get_selection((char **)(name->pdata), name->len,
- "Select a library", "Libraries");
- if(lib_name != NULL) {
- for(i=0;i<nb;i++){
- if(strcmp(lib_name, lib_info[i].name) == 0) {
- library = lttv_library_get(i);
- break;
- }
+ if(strcmp(lib_name, lib_info[i].name) == 0) {
+ library = lttv_library_get(i);
+ break;
}
}
- g_ptr_array_free(name, TRUE);
- g_free(lib_info);
-
- if(lib_name == NULL) return;
}
-
- lttv_library_unload(library);
+ g_ptr_array_free(name, TRUE);
+ g_free(lib_info);
+
+ if(lib_name == NULL) return;
+
+ if(library != NULL) lttv_library_unload(library);
}
GError *error = NULL;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
- LttvLibrary *library;
+ LttvLibrary *library = NULL;
{
GPtrArray *name;
guint nb,i;
}
lttv_module_require(module_name_out, &error);
- if(error != NULL) g_warning(error->message);
- else g_printf("Load module: %s\n", module_name_out);
+ if(error != NULL) g_warning("%s", error->message);
+ else g_printf("Load module: %s", module_name_out);
#if 0
if(lib_name == NULL) return;
}
- LttvModule *module;
+ LttvModule *module = NULL;
{
/* Ask for the module to load : list modules in the selected lib */
GPtrArray *name;
gpointer user_data)
{
MainWindow * mw_data = get_window_data_struct((GtkWidget*)widget);
- float width = event->width;
- TimeWindow time_win;
- double ratio;
- TimeInterval *time_span;
- LttTime time;
// MD : removed time width modification upon resizing of the main window.
// The viewers will redraw themselves completely, without time interval
}
id = gtk_dialog_run(GTK_DIALOG(dialogue));
+ GtkTreeModel **store_model = &store; /* for strict aliasing */
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
- if (gtk_tree_selection_get_selected (select, (GtkTreeModel**)&store, &iter)){
+ if (gtk_tree_selection_get_selected (select, store_model, &iter)){
gtk_tree_model_get ((GtkTreeModel*)store, &iter, MODULE_COLUMN, &unload_module_name, -1);
}
case GTK_RESPONSE_REJECT:
void add_all_menu_toolbar_constructors(MainWindow * mw, gpointer user_data)
{
- int i;
+ guint i;
GdkPixbuf *pixbuf;
lttvwindow_viewer_constructor constructor;
LttvMenus * global_menu, * instance_menu;
{
GList * list;
Tab * tab;
- LttTime tmp_time;
//create a new tab data structure
tab = g_new(Tab,1);
sizeof (GtkDirSelection),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_dir_selection_init,
+ NULL /* GValue */
};
file_selection_type =
index = new_names->len - 1;
else
{
- gint i = 0, j = 0, cmp;
+ guint i = 0, j = 0;
+ gint cmp;
/* do a quick diff, stopping at the first file not in the
* old list
index = new_names->len - 1;
else
{
- gint i = 0, j = 0, cmp;
+ guint i = 0, j = 0;
+ gint cmp;
/* do a quick diff, stopping at the first file not in the
* old list
gchar str[256];
err = gtk_label_get_text (GTK_LABEL (fs->selection_text));
err += 11; //pass over "Selection: "
- sprintf(str,"%s\0",err);
+ sprintf(str,"%s",err);
if (fs->last_selected != NULL)
gchar **selections;
gchar *filename, *dirname;
gchar *current, *buf;
- gint i, count;
+ guint i, count;
gboolean unselected_entry;
g_return_val_if_fail (GTK_IS_DIR_SELECTION (filesel), NULL);
gchar **remaining_text,
CompletionState *cmpl_state)
{
- gchar* first_slash;
PossibleCompletion *poss;
prune_memory_usage (cmpl_state);
for (i = 0; i < entry_count; i += 1)
{
- GError *error = NULL;
-
if (i == 0)
- dirent = ".";
+ dirent = ".";
else if (i == 1)
- dirent = "..";
+ dirent = "..";
else
- {
- dirent = g_dir_read_name (directory);
- if (!dirent) /* Directory changed */
- break;
- }
+ {
+ dirent = g_dir_read_name (directory);
+ if (!dirent) /* Directory changed */
+ break;
+ }
sent->entries[n_entries].entry_name = g_filename_to_utf8 (dirent, -1, NULL, NULL, &error);
if (sent->entries[n_entries].entry_name == NULL
const void *b)
{
- return strcmp (((CompletionDirEntry*)a)->sort_key,
- (((CompletionDirEntry*)b))->sort_key);
+ return strcmp (((const CompletionDirEntry*)a)->sort_key,
+ (((const CompletionDirEntry*)b))->sort_key);
}
static gint
LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab);
+/* set_time_window
+ *
+ * It updates the time window of the tab, then calls the updatetimewindow
+ * hooks of each viewer.
+ *
+ * This is called whenever the scrollbar value changes.
+ *
+ * This is mostly an internal function.
+ */
+
+void set_time_window(Tab *tab, const TimeWindow *time_window);
+
+
+/* set_current_time
+ *
+ * It updates the current time of the tab, then calls the updatetimewindow
+ * hooks of each viewer.
+ *
+ * This is called whenever the current time value changes.
+ *
+ * This is mostly an internal function.
+ */
+
+void set_current_time(Tab *tab, const LttTime *current_time);
+
#endif //VIEWER_H
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <string.h>
#include <ltt/time.h>
#include <ltt/trace.h>
LttvTrace *lttvwindowtraces_get_trace_by_name(gchar *path)
{
- LttvAttribute *attribute = lttv_global_attributes();
guint i;
for(i=0;i<lttvwindowtraces_get_number();i++) {
LttvAttributeValue value;
LttvAttributeType type;
gboolean ret_val;
- LttvHooks *before_request, *after_request;
if(trace == NULL)
return FALSE;
&value);
g_assert(type == LTTV_POINTER);
LttvHooks *before_request = (LttvHooks*)*(value.v_pointer);
-
if(before_request != NULL) lttv_hooks_call(before_request, tsc);
{
LttvMenuClosure c;
- /* if h is null, do nothing, or popup a warning message */
- if(h == NULL)return;
-
c.con = f;
c.menu_path = menu_path;
c.menu_text = menu_text;
c.widget = widget;
- g_array_append_val(h,c);
+ if(h != NULL) g_array_append_val(h,c);
return c;
}
GtkWidget *lttv_menus_remove(LttvMenus *h, lttvwindow_viewer_constructor f)
{
LttvMenuClosure * tmp;
- gint i;
+ guint i;
GtkWidget *widget;
for(i=0;i<h->len;i++){
{
LttvToolbarClosure c;
- /* if h is null, do nothing, or popup a warning message */
- if(h == NULL)return;
-
c.con = f;
c.tooltip = tooltip;
c.pixmap = pixmap;
c.widget = widget;
- g_array_append_val(h,c);
+ if(h != NULL) g_array_append_val(h,c);
return c;
}
GtkWidget *lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f)
{
LttvToolbarClosure * tmp;
- gint i;
+ guint i;
GtkWidget *widget;
for(i=0;i<h->len;i++){