projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make modules more flexible (builtin or loaded are identical). Add a test module
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
modules
/
gui
/
main
/
src
/
callbacks.c
diff --git
a/ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
b/ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
index 240aab4cc69dab02175c1bf2ba080e6afc415164..08a58516c2eb22bd47019b7e2596e22e3dbf52c4 100644
(file)
--- a/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
+++ b/
ltt/branches/poly/lttv/modules/gui/main/src/callbacks.c
@@
-21,11
+21,11
@@
#endif
#include <gtk/gtk.h>
#endif
#include <gtk/gtk.h>
-#include <gmodule.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"
+#include <lttv/lttv.h>
#include <lttv/mainwindow.h>
#include <lttv/menu.h>
#include <lttv/toolbar.h>
#include <lttv/mainwindow.h>
#include <lttv/menu.h>
#include <lttv/toolbar.h>
@@
-274,10
+274,10
@@
void create_new_window(GtkWidget* widget, gpointer user_data, gboolean clone)
if(clone){
g_printf("Clone : use the same traceset\n");
if(clone){
g_printf("Clone : use the same traceset\n");
- construct_main_window(parent
, NULL
);
+ construct_main_window(parent);
}else{
g_printf("Empty : traceset is set to NULL\n");
}else{
g_printf("Empty : traceset is set to NULL\n");
- construct_main_window(NULL
, parent->win_creation_data
);
+ construct_main_window(NULL);
}
}
}
}
@@
-386,7
+386,7
@@
void redraw_viewer(MainWindow * mw_data, TimeWindow * time_window)
//set the cursor to be X shape, indicating that the computer is busy in doing its job
new = gdk_cursor_new(GDK_X_CURSOR);
//set the cursor to be X shape, indicating that the computer is busy in doing its job
new = gdk_cursor_new(GDK_X_CURSOR);
- widget = lookup_widget(mw_data->mwindow, "MToolbar
2
");
+ widget = lookup_widget(mw_data->mwindow, "MToolbar
1
");
win = gtk_widget_get_parent_window(widget);
gdk_window_set_cursor(win, new);
gdk_cursor_unref(new);
win = gtk_widget_get_parent_window(widget);
gdk_window_set_cursor(win, new);
gdk_cursor_unref(new);
@@
-818,6
+818,7
@@
void
on_close_tab_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
on_close_tab_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
+ GList * list;
int count = 0;
GtkWidget * notebook;
Tab * tmp;
int count = 0;
GtkWidget * notebook;
Tab * tmp;
@@
-842,6
+843,9
@@
on_close_tab_activate (GtkMenuItem *menuitem,
}
gtk_notebook_remove_page((GtkNotebook*)notebook, count);
}
gtk_notebook_remove_page((GtkNotebook*)notebook, count);
+ list = gtk_container_get_children(GTK_CONTAINER(notebook));
+ if(g_list_length(list)==1)
+ gtk_notebook_set_show_tabs((GtkNotebook*)notebook, FALSE);
}
}
@@
-1037,10
+1041,7
@@
on_load_module_activate (GtkMenuItem *menuitem,
str1 = strrchr(str,'\\');
str1++;
}
str1 = strrchr(str,'\\');
str1++;
}
- if(mw_data->win_creation_data)
- lttv_module_load(str1, mw_data->win_creation_data->argc,mw_data->win_creation_data->argv);
- else
- lttv_module_load(str1, 0,NULL);
+ lttv_module_require(str1, NULL);
g_slist_foreach(g_main_window_list, (gpointer)insert_menu_toolbar_item,
NULL);
g_strfreev(dir);
g_slist_foreach(g_main_window_list, (gpointer)insert_menu_toolbar_item,
NULL);
g_strfreev(dir);
@@
-1063,30
+1064,36
@@
on_unload_module_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
int i;
gpointer user_data)
{
int i;
- char **name, *unload_module_name;
+ GPtrArray *name;
+ char *unload_module_name;
guint nb;
guint nb;
- LttvModule ** modules, *module;
+ LttvLibrary *library;
+ LttvLibraryInfo library_info;
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
- modules = lttv_module_list(&nb);
- name = g_new(char*, nb);
+ name = g_ptr_array_new();
+ nb = lttv_library_number();
+
for(i=0;i<nb;i++){
for(i=0;i<nb;i++){
- module = modules[i];
- name[i] = lttv_module_name(module);
+ library = lttv_library_get(i);
+ lttv_library_info(library, &library_info);
+ if(library_info.load_count > 0) g_ptr_array_add(name, library_info.name);
}
}
- unload_module_name =get_unload_module(
name,nb
);
+ unload_module_name =get_unload_module(
(char **)(name->pdata), name->len
);
if(unload_module_name){
for(i=0;i<nb;i++){
if(unload_module_name){
for(i=0;i<nb;i++){
- if(strcmp(unload_module_name, name[i]) == 0){
- lttv_module_unload(modules[i]);
+ library = lttv_library_get(i);
+ lttv_library_info(library, &library_info);
+ if(strcmp(unload_module_name, library_info.name) == 0){
+ lttv_library_unload(library);
break;
}
}
}
break;
}
}
}
- g_
free(name
);
+ g_
ptr_array_free(name, TRUE
);
}
}
@@
-1108,7
+1115,7
@@
on_add_module_search_path_activate (GtkMenuItem *menuitem,
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
dir = gtk_dir_selection_get_dir (file_selector);
- lttv_
module
_path_add(dir);
+ lttv_
library
_path_add(dir);
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
default:
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
default:
@@
-1736,7
+1743,7
@@
void insert_menu_toolbar_item(MainWindow * mw, gpointer user_data)
tmp = g_hash_table_lookup(mw->hash_toolbar_item, g_strdup(toolbar_item->tooltip));
if(tmp)continue;
constructor = toolbar_item->con;
tmp = g_hash_table_lookup(mw->hash_toolbar_item, g_strdup(toolbar_item->tooltip));
if(tmp)continue;
constructor = toolbar_item->con;
- tool_menu_title_menu = lookup_widget(mw->mwindow,"MToolbar
2
");
+ tool_menu_title_menu = lookup_widget(mw->mwindow,"MToolbar
1
");
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**)toolbar_item->pixmap);
pixmap = gtk_image_new_from_pixbuf(pixbuf);
insert_view = gtk_toolbar_append_element (GTK_TOOLBAR (tool_menu_title_menu),
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**)toolbar_item->pixmap);
pixmap = gtk_image_new_from_pixbuf(pixbuf);
insert_view = gtk_toolbar_append_element (GTK_TOOLBAR (tool_menu_title_menu),
@@
-1759,9
+1766,9
@@
void insert_menu_toolbar_item(MainWindow * mw, gpointer user_data)
/* Create a main window
*/
/* Create a main window
*/
-void construct_main_window(MainWindow * parent
, WindowCreationData * win_creation_data
)
+void construct_main_window(MainWindow * parent)
{
{
- g_
critical
("construct_main_window()");
+ g_
debug
("construct_main_window()");
GtkWidget * new_window; /* New generated main window */
MainWindow * new_m_window;/* New main window structure */
GtkNotebook * notebook;
GtkWidget * new_window; /* New generated main window */
MainWindow * new_m_window;/* New main window structure */
GtkNotebook * notebook;
@@
-1784,11
+1791,6
@@
void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio
new_m_window->tab = NULL;
new_m_window->current_tab = NULL;
new_m_window->attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
new_m_window->tab = NULL;
new_m_window->current_tab = NULL;
new_m_window->attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
- if(parent){
- new_m_window->win_creation_data = parent->win_creation_data;
- }else{
- new_m_window->win_creation_data = win_creation_data;
- }
new_m_window->hash_menu_item = g_hash_table_new_full (g_str_hash, g_str_equal,
main_window_destroy_hash_key,
new_m_window->hash_menu_item = g_hash_table_new_full (g_str_hash, g_str_equal,
main_window_destroy_hash_key,
@@
-1963,6
+1965,8
@@
void * create_tab(MainWindow * parent, MainWindow* current_window,
gtk_notebook_append_page(notebook, (GtkWidget*)tmp_tab->multi_vpaned, tmp_tab->label);
list = gtk_container_get_children(GTK_CONTAINER(notebook));
gtk_notebook_set_current_page(notebook,g_list_length(list)-1);
gtk_notebook_append_page(notebook, (GtkWidget*)tmp_tab->multi_vpaned, tmp_tab->label);
list = gtk_container_get_children(GTK_CONTAINER(notebook));
gtk_notebook_set_current_page(notebook,g_list_length(list)-1);
+ if(g_list_length(list)>1)
+ gtk_notebook_set_show_tabs(notebook, TRUE);
}
}
@@
-1992,7
+1996,7
@@
void remove_toolbar_item(gpointer main_win, gpointer user_data)
GtkWidget * tool_menu_title_menu, *insert_view;
GtkWidget * tool_menu_title_menu, *insert_view;
- tool_menu_title_menu = lookup_widget(mw->mwindow,"MToolbar
2
");
+ tool_menu_title_menu = lookup_widget(mw->mwindow,"MToolbar
1
");
insert_view = (GtkWidget*)g_hash_table_lookup(mw->hash_toolbar_item,
toolbar_item->tooltip);
if(insert_view){
insert_view = (GtkWidget*)g_hash_table_lookup(mw->hash_toolbar_item,
toolbar_item->tooltip);
if(insert_view){
This page took
0.02472 seconds
and
4
git commands to generate.