File_Save::~File_Save()
{
    gtk_widget_unref(filechooserdialog1);
    gtk_widget_unref(dialog_vbox1);
    gtk_widget_unref(dialog_action_area1);
    gtk_widget_unref(button1);
    gtk_widget_unref(button2);
}
SidebarIndexPage::~SidebarIndexPage()
{
	XOJ_RELEASE_TYPE(SidebarIndexPage);

	if (this->searchTimeout)
	{
		g_source_remove(this->searchTimeout);
		this->searchTimeout = 0;
	}

	gtk_widget_unref(this->treeViewBookmarks);
	gtk_widget_unref(this->scrollBookmarks);
}
示例#3
0
static  gint
cb_thumbview_button_press (GtkWidget * widget, GdkEventButton * event,
			   ThumbView * tv)
{
    if (ZALBUM (tv->album)->len == 0 || ZLIST (tv->album)->focus < 0)
	return FALSE;

    gtk_widget_grab_focus (GTK_WIDGET (tv->album));

    if (event->type == GDK_BUTTON_PRESS && event->button == 3)
    {
	gint    type;
	guint   n_menu_items;
	GtkWidget *popup_menu, *progs_submenu, *scripts_submenu;
	GtkWidget *menuitem;
	GtkItemFactory *ifactory;

	/*
	 * create popup menu 
	 */
	n_menu_items = sizeof (thumbview_popupmenu_items)
	    / sizeof (thumbview_popupmenu_items[0]) - 1;

	popup_menu =
	    menu_create_items (BROWSER_WINDOW, thumbview_popupmenu_items,
			       n_menu_items, "<ThumbnailButtonPop>", tv);

	ifactory = gtk_item_factory_from_widget (popup_menu);

	type = (gint) zalbum_get_cell_data (ZALBUM (tv->album), tv->current);

	thumbview_update_popupmenu (type, ifactory);

	menuitem =
	    gtk_item_factory_get_item (ifactory, "/Open in External Program");

	progs_submenu = create_progs_submenu (tv);
	menu_set_submenu (popup_menu, "/Open in External Program",
			  progs_submenu);

	menuitem = gtk_item_factory_get_item (ifactory, "/Scripts");
	scripts_submenu = create_scripts_submenu (tv);
	menu_set_submenu (popup_menu, "/Scripts", scripts_submenu);

	gtk_menu_popup (GTK_MENU (popup_menu),
			NULL, NULL, NULL, NULL, event->button, event->time);

#ifdef USE_GTK2
	gtk_object_ref (GTK_OBJECT (popup_menu));
	gtk_object_sink (GTK_OBJECT (popup_menu));
#endif
	gtk_widget_unref (popup_menu);

	return TRUE;
    }

    tv->current = ZLIST (tv->album)->focus;

    return FALSE;
}
示例#4
0
GtkWidget*
view_new (Scene *scene, GLDrawingArea *context)
{
  View *view = VIEW (g_object_new (view_get_type (), NULL));
  GtkWidget *box, *window;

  view->xml = glade_xml_new (GLADEDIR "/view.glade", NULL, NULL);
  if (!view->xml)
    return NULL;
  box = glade_xml_get_widget (view->xml, "view vbox");
  window = glade_xml_get_widget (view->xml, "window");

  gtk_widget_ref (box);
  gtk_container_remove (GTK_CONTAINER (window), box);
  gtk_box_pack_start (GTK_BOX (view), GTK_WIDGET (box), TRUE, TRUE, 0);
  gtk_widget_unref (box);

  gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (context), TRUE, TRUE, 0);
  gtk_box_reorder_child (GTK_BOX (box), GTK_WIDGET (context), 0);

  if (scene == NULL)
    scene = scene_new ();

  view->scene = scene;
  view->context = context;

  g_signal_connect_after (G_OBJECT (context), "realize", G_CALLBACK (on_gl_context_realize), (gpointer) view);

  return GTK_WIDGET (view);
}
示例#5
0
void
bst_choice_destroy (GtkWidget *choice)
{
  g_return_if_fail (GTK_IS_CONTAINER (choice));
  
  gtk_widget_destroy (choice);
  gtk_widget_unref (choice);
}
示例#6
0
Scrollbar::~Scrollbar() {
	XOJ_RELEASE_TYPE(Scrollbar);

	gtk_widget_unref(this->scrollbar);
	this->scrollbar = NULL;
	g_list_free(this->listener);
	this->listener = NULL;
}
SidebarToolbar::~SidebarToolbar()
{
	XOJ_RELEASE_TYPE(SidebarToolbar);

	gtk_widget_unref(GTK_WIDGET(this->toolbar));
	this->toolbar = NULL;

	this->control = NULL;
}
示例#8
0
static void
gtk_combo_button_destroy (GtkObject * combo_button)
{
  gtk_widget_destroy (GTK_COMBO_BUTTON (combo_button)->popwin);
  gtk_widget_unref (GTK_COMBO_BUTTON (combo_button)->popwin);

  if (GTK_OBJECT_CLASS (parent_class)->destroy)
    (*GTK_OBJECT_CLASS (parent_class)->destroy) (combo_button);
}
示例#9
0
文件: scripts.c 项目: IR4T4/xqf
void unref_option_widgets(Script* script) {
	GSList* optlist;

	for (optlist = script->options; optlist; optlist = g_slist_next(optlist)) {
		ScriptOption* opt = optlist->data;
		gtk_widget_unref(opt->widget);
		opt->widget = NULL;
	}
}
示例#10
0
YC20UI2::~YC20UI2()
{
	// It seems this is unnecessary
	if (drawingArea) {
		gtk_widget_unref(drawingArea);
		gtk_widget_destroy(drawingArea);
		drawingArea = 0;
	}
}
示例#11
0
static void mathml_destroy_viewer(MimeViewer *_viewer)
{
	MathMLViewer *viewer = (MathMLViewer *) _viewer;

	debug_print("mathml_destroy_viewer\n");

	gtk_widget_unref(GTK_WIDGET(viewer->scrollwin));
	unlink(viewer->filename);
	g_free(viewer->filename);
    	g_free(viewer);
}
示例#12
0
gint glwidget_context_destroyed( GtkWidget* widget, gpointer data ){
	if ( --g_context_count == 0 ) {
		GlobalOpenGL().contextValid = false;

		GLWidget_sharedContextDestroyed();

		gtk_widget_unref( g_shared );
		g_shared = 0;
	}
	return FALSE;
}
示例#13
0
static void free_errchain(struct errchain *chain)
{
     if (chain) {
	  g_free(chain->title);
	  g_list_foreach(chain->messages, (GFunc) g_free, NULL);
	  g_list_free(chain->messages);
	  if (chain->transient_for) {
	       gtk_widget_unref(chain->transient_for);
	  }
	  g_free(chain);
     }
}
示例#14
0
void messageview_destroy(MessageView *messageview)
{
	GtkWidget *textview  = GTK_WIDGET_PTR(messageview->mimeview->textview);
	GtkWidget *imageview = GTK_WIDGET_PTR(messageview->mimeview->imageview);

	messageview_list = g_list_remove(messageview_list, messageview);

	headerview_destroy(messageview->headerview);
	textview_destroy(messageview->textview);
	mimeview_destroy(messageview->mimeview);

	procmsg_msginfo_free(messageview->msginfo);

	if (messageview->window)
		gtk_widget_destroy(messageview->window);

	g_free(messageview);

	gtk_widget_unref(textview);
	gtk_widget_unref(imageview);
}
示例#15
0
void
dt_imageio_cleanup (dt_imageio_t *iio)
{
    while(iio->plugins_format)
    {
        dt_imageio_module_format_t *module = (dt_imageio_module_format_t *)(iio->plugins_format->data);
        module->cleanup(module);
        if(module->widget) gtk_widget_unref(module->widget);
        if(module->module) g_module_close(module->module);
        free(module);
        iio->plugins_format = g_list_delete_link(iio->plugins_format, iio->plugins_format);
    }
    while(iio->plugins_storage)
    {
        dt_imageio_module_storage_t *module = (dt_imageio_module_storage_t *)(iio->plugins_storage->data);
        if(module->widget) gtk_widget_unref(module->widget);
        if(module->module) g_module_close(module->module);
        free(module);
        iio->plugins_storage = g_list_delete_link(iio->plugins_storage, iio->plugins_storage);
    }
}
示例#16
0
gint GLWidget::onUnRealise(GtkWidget* widget, GLWidget* self) {
	if (--g_context_count == 0) {
		GlobalOpenGL().contextValid = false;

		GLWidget_sharedContextDestroyed();

		gtk_widget_unref(g_shared);
		g_shared = NULL;
	}

	return FALSE;
}
示例#17
0
static void
workspaceview_child_front( View *parent, View *child )
{
	Workspaceview *wview = WORKSPACEVIEW( parent );
	Columnview *cview = COLUMNVIEW( child );

		gtk_widget_ref( GTK_WIDGET( cview ) );
		gtk_container_remove( GTK_CONTAINER( wview->fixed ),
			GTK_WIDGET( cview ) );
		gtk_fixed_put( GTK_FIXED( wview->fixed ),
			GTK_WIDGET( cview ), cview->lx, cview->ly );
		gtk_widget_unref( GTK_WIDGET( cview ) );
}
示例#18
0
文件: menu.cpp 项目: beanhome/dev
wxMenu::~wxMenu()
{
   WX_CLEAR_LIST(wxMenuItemList, m_items);

   if ( GTK_IS_WIDGET( m_menu ))
   {
       // see wxMenu::Init
       gtk_widget_unref( m_menu );
       // if the menu is inserted in another menu at this time, there was
       // one more reference to it:
       if ( m_owner )
           gtk_widget_destroy( m_menu );
   }
}
示例#19
0
void OpenGLModule::unregisterGLWidget(GtkWidget* widget)
{
    assert(_realisedGLWidgets > 0);

    if (--_realisedGLWidgets == 0)
    {
        // This was the last active GL widget
        contextValid = false;

        sharedContextDestroyed();

        gtk_widget_unref(_sharedContext);
        _sharedContext = NULL;
    }
}
示例#20
0
GtkWidget* AbstractToolItem::getNewToolIcon()
{
	XOJ_CHECK_TYPE(AbstractToolItem);

	GtkWidget* icon = this->getNewToolIconImpl();

	if (!GTK_IS_IMAGE(icon))
	{
		GdkPixbuf* pixbuf = Util::newPixbufFromWidget(icon);
		gtk_widget_unref(icon);
		icon = gtk_image_new_from_pixbuf(pixbuf);
		g_object_unref(pixbuf);
	}

	return icon;
}
示例#21
0
static void
dates_navigator_model_finalize (GObject *gobject)
{
	DatesNavigatorModelPrivate *priv = DATES_NAVIGATOR_MODEL (gobject)->priv;

	GtkWidget * store = GTK_WIDGET (gtk_tree_model_filter_get_model (
										GTK_TREE_MODEL_FILTER (gobject)));
	
	if (store)
		gtk_widget_unref (store);

	if (priv->cview)
		g_object_unref (priv->cview);
	
	G_OBJECT_CLASS (dates_navigator_model_parent_class)->finalize (gobject);
}
示例#22
0
static void
layer_dialog_lower_callback(GtkWidget *widget, gpointer gdata)
{
  Layer *layer;
  Diagram *dia;
  GtkWidget *selected;
  GList *list = NULL;
  int pos;

  dia = layer_dialog->diagram;

  if ((dia != NULL) && (dia->data->layers->len>1)) {
    assert(GTK_LIST(layer_dialog->layer_list)->selection != NULL);
    selected = GTK_LIST(layer_dialog->layer_list)->selection->data;

    pos = gtk_list_child_position(GTK_LIST(layer_dialog->layer_list), selected);

    if (pos < dia->data->layers->len-1) {
      layer = DIA_LAYER_WIDGET(selected)->layer;
      data_lower_layer(dia->data, layer);
      
      list = g_list_prepend(list, selected);

      gtk_widget_ref(selected);
      
      gtk_list_remove_items(GTK_LIST(layer_dialog->layer_list),
			    list);
      
      gtk_list_insert_items(GTK_LIST(layer_dialog->layer_list),
			    list, pos + 1);

      gtk_widget_unref(selected);

      gtk_list_select_item(GTK_LIST(layer_dialog->layer_list), pos+1);
      
      diagram_add_update_all(dia);
      diagram_flush(dia);

      undo_layer(dia, layer, TYPE_LOWER_LAYER, 0);
      undo_set_transactionpoint(dia->undo);
    }

  }
}
示例#23
0
static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data)
{
	GtkWidget *notebook = geany_data->main_widgets->notebook;
	GtkWidget *pane = gtk_widget_get_parent(notebook);
	GtkWidget *parent = gtk_widget_get_parent(pane);

	set_state(STATE_UNSPLIT);

	g_return_if_fail(edit_window.editor);

	gtk_widget_ref(notebook);
	gtk_container_remove(GTK_CONTAINER(pane), notebook);

	gtk_widget_destroy(pane);
	edit_window.editor = NULL;
	edit_window.sci = NULL;

	gtk_container_add(GTK_CONTAINER(parent), notebook);
	gtk_widget_unref(notebook);
}
示例#24
0
static void split_view(gboolean horizontal)
{
	GtkWidget *notebook = geany_data->main_widgets->notebook;
	GtkWidget *parent = gtk_widget_get_parent(notebook);
	GtkWidget *pane, *toolbar, *box;
	GeanyDocument *doc = document_get_current();
	gint width = notebook->allocation.width / 2;
	gint height = notebook->allocation.height / 2;

	g_return_if_fail(doc);
	g_return_if_fail(edit_window.editor == NULL);

	set_state(horizontal ? STATE_SPLIT_HORIZONTAL : STATE_SPLIT_VERTICAL);

	gtk_widget_ref(notebook);
	gtk_container_remove(GTK_CONTAINER(parent), notebook);

	pane = horizontal ? gtk_hpaned_new() : gtk_vpaned_new();
	gtk_container_add(GTK_CONTAINER(parent), pane);

	gtk_container_add(GTK_CONTAINER(pane), notebook);
	gtk_widget_unref(notebook);

	box = gtk_vbox_new(FALSE, 0);
	toolbar = create_toolbar();
	gtk_box_pack_start(GTK_BOX(box), toolbar, FALSE, FALSE, 0);
	gtk_container_add(GTK_CONTAINER(pane), box);
	edit_window.vbox = box;

	set_editor(&edit_window, doc->editor);

	if (horizontal)
	{
		gtk_paned_set_position(GTK_PANED(pane), width);
	}
	else
	{
		gtk_paned_set_position(GTK_PANED(pane), height);
	}
	gtk_widget_show_all(pane);
}
示例#25
0
CamWnd::~CamWnd() {
	// Subscribe to the global scene graph update
	GlobalSceneGraph().removeSceneObserver(this);

	if (m_bFreeMove) {
		disableFreeMove();
	}

	removeHandlersMove();

	g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_sizeHandler);
	g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_exposeHandler);

	gtk_widget_unref(m_gl_widget);

	// Disconnect self from EventManager\r
	GlobalEventManager().disconnect(GTK_OBJECT(m_gl_widget));
	GlobalEventManager().disconnect(GTK_OBJECT(m_parent));

	delete m_window_observer;
}
示例#26
0
static void mime_toggle_button_cb (GtkWidget *button, MimeView *mimeview) 
{
	gtk_widget_ref(button); 

	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) {
		gtk_arrow_set(GTK_ARROW(GTK_BIN(button)->child), GTK_ARROW_RIGHT, 
					GTK_SHADOW_NONE);
		gtk_widget_hide(mimeview->icon_mainbox);
		gtk_widget_show(mimeview->ctree_mainbox);
		gtk_paned_set_position(GTK_PANED(mimeview->paned), mimeview->oldsize);

		gtkut_container_remove(GTK_CONTAINER(mimeview->icon_mainbox), 
					button);
		gtk_box_pack_end(GTK_BOX(mimeview->ctree_mainbox), 
				   button, FALSE, FALSE, 0);
		gtk_paned_set_gutter_size(GTK_PANED(mimeview->paned), 6);
	} else {
		gtk_arrow_set(GTK_ARROW(GTK_BIN(button)->child), GTK_ARROW_LEFT, 
			      GTK_SHADOW_NONE);
		mimeview->oldsize = mimeview->ctree_mainbox->allocation.height;
		gtk_widget_hide(mimeview->ctree_mainbox);
		gtk_widget_show(mimeview->icon_mainbox);
		gtk_paned_set_position(GTK_PANED(mimeview->paned), 0);

		gtkut_container_remove(GTK_CONTAINER(mimeview->ctree_mainbox), 
					button);
		gtk_box_pack_start(GTK_BOX(mimeview->icon_mainbox), 
				   button, FALSE, FALSE, 0);
		gtk_box_reorder_child(GTK_BOX(button->parent), button, 0);
		if (mimeview->opened)
			icon_list_toggle_by_mime_info
				(mimeview, gtk_ctree_node_get_row_data(GTK_CTREE(mimeview->ctree), 
								       mimeview->opened));

		gtk_paned_set_gutter_size(GTK_PANED(mimeview->paned), 0);
	}
	gtk_widget_grab_focus(button);
	gtk_widget_unref(button);

}
示例#27
0
static void
replace_plugins()
	{
	GList			*new_monitor_list, *list;
	GkrellmMonitor	*mon;
	extern GtkWidget *gkrellm_monitor_vbox();

	new_monitor_list = NULL;
	for (list = gkrellm_monitor_list; list; list = list->next)
		{
		mon = (GkrellmMonitor *) list->data;
		if (mon->privat->main_vbox && mon != gkrellm_mon_host())
			{
			gtk_widget_ref(mon->privat->main_vbox);
			gtk_container_remove(GTK_CONTAINER(gkrellm_monitor_vbox()),
					mon->privat->main_vbox);
			}
		if (MONITOR_ID(mon) != MON_PLUGIN)
			new_monitor_list = g_list_append(new_monitor_list, mon);
		}
	for (list = gkrellm_monitor_list; list; list = list->next)
		{
		mon = (GkrellmMonitor *) list->data;
		if (MONITOR_ID(mon) == MON_PLUGIN)
			gkrellm_place_plugin(&new_monitor_list, mon);
		}
	g_list_free(gkrellm_monitor_list);
	gkrellm_monitor_list = new_monitor_list;
	for (list = gkrellm_monitor_list; list; list = list->next)
		{
		mon = (GkrellmMonitor *) list->data;
		if (mon->privat->main_vbox && mon != gkrellm_mon_host())
			{
			gtk_box_pack_start(GTK_BOX(gkrellm_monitor_vbox()),
					mon->privat->main_vbox, FALSE, FALSE, 0);
			gtk_widget_unref(mon->privat->main_vbox);
			}
		}
	}
示例#28
0
// Zeige ein Widget im Vollbild Modus an
void interface_show_module_fullscreen (GtkWidget *widget)
{
	if (widget == NULL) {
		g_print("Fehler: Konnte ein Modul nicht anzeigen!\n");
	}
	
	// Modul speichern für interface_show_previous_module
	GList *list = gtk_container_get_children (GTK_CONTAINER(vbox_placeholder));    
	if (list) {
		module.previous = (GtkWidget*) list->data;
		g_list_free (list);
	}
	
	interface_clean();
	
	gtk_widget_ref(widget);
	if (widget->parent) {
		gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
	}
	gtk_container_add(GTK_CONTAINER(vbox_placeholder), widget);
	gtk_widget_unref(widget);

	gtk_widget_show(widget);
}
示例#29
0
static void layout_sort_menu_hide_cb(GtkWidget *widget, gpointer data)
{
	/* destroy the menu */
	gtk_widget_unref(GTK_WIDGET(widget));
}
示例#30
0
void layout_style_set(LayoutWindow *lw, gint style, const gchar *order)
{
	gchar *path;
	ImageWindow *old_image;

	if (!layout_valid(&lw)) return;

	if (style != -1)
		{
		LayoutLocation d, f, i;

		layout_config_parse(style, order, &d,  &f, &i);

		if (lw->dir_location == d &&
		    lw->file_location == f &&
		    lw->image_location == i) return;

		lw->dir_location = d;
		lw->file_location = f;
		lw->image_location = i;
		}

	/* remember state */

	layout_image_slideshow_stop(lw);
	layout_image_full_screen_stop(lw);

	path = lw->path;
	lw->path = NULL;
	old_image = lw->image;
	lw->image = NULL;
	lw->utility_box = NULL;

	layout_geometry_get_dividers(lw, &lw->div_h, &lw->div_v);

	/* clear it all */

	gtk_widget_hide(old_image->widget);
	gtk_widget_ref(old_image->widget);
	gtk_container_remove(GTK_CONTAINER(old_image->widget->parent), old_image->widget);

	lw->h_pane = NULL;
	lw->v_pane = NULL;

	lw->toolbar = NULL;
	lw->thumb_button = NULL;
	lw->path_entry = NULL;
	lw->dir_view = NULL;
	lw->vdl = NULL;
	lw->vdt = NULL;

	lw->file_view = NULL;
	lw->vfl = NULL;
	lw->vfi = NULL;

	lw->info_box = NULL;
	lw->info_progress_bar = NULL;
	lw->info_sort = NULL;
	lw->info_status = NULL;
	lw->info_details = NULL;
	lw->info_zoom = NULL;

	if (lw->ui_manager) g_object_unref(lw->ui_manager);
	lw->ui_manager = NULL;
	lw->action_group = NULL;

	gtk_container_remove(GTK_CONTAINER(lw->main_box), lw->group_box);
	lw->group_box = NULL;

	/* re-fill */

	layout_grid_setup(lw);
	layout_tools_hide(lw, lw->tools_hidden);

	layout_list_sync_sort(lw);
	layout_util_sync(lw);
	layout_status_update_all(lw);

	/* sync */

	if (image_get_path(old_image))
		{
		layout_set_path(lw, image_get_path(old_image));
		}
	else
		{
		layout_set_path(lw, path);
		}
	image_change_from_image(lw->image, old_image);
	image_top_window_set_sync(lw->image, (lw->tools_float || lw->tools_hidden));

	/* clean up */

	gtk_widget_unref(old_image->widget);
	g_free(path);
}