From b985b4e18ad0eca9c0748c43e924a110a831e68b Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 6 Oct 2024 23:28:25 +0200 Subject: [PATCH] notes: remove dependency on DeforaOS Mailer --- project.conf | 2 +- tools/notes.c | 123 --------------------------------------------- tools/project.conf | 18 ------- 3 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 tools/notes.c delete mode 100644 tools/project.conf diff --git a/project.conf b/project.conf index 99f7956..2812ff9 100644 --- a/project.conf +++ b/project.conf @@ -2,7 +2,7 @@ package=Notes version=0.2.0 config=h,sh -subdirs=data,doc,include,po,src,tools,tests +subdirs=data,doc,include,po,src,tests targets=tests dist=Makefile,COPYING,config.h,config.sh diff --git a/tools/notes.c b/tools/notes.c deleted file mode 100644 index ffd679d..0000000 --- a/tools/notes.c +++ /dev/null @@ -1,123 +0,0 @@ -/* $Id$ */ -/* Copyright (c) 2015-2024 Pierre Pronchery */ -/* This file is part of DeforaOS Desktop Notes */ -/* All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - - -#include -#include -#include "Notes.h" - - -/* Notes */ -/* private */ -/* types */ -typedef struct _MailerPlugin NotesPlugin; - -struct _MailerPlugin -{ - MailerPluginHelper * helper; - - Notes * notes; - - /* widgets */ - GtkWidget * widget; - GtkWidget * view; -}; - - -/* protected */ -/* prototypes */ -/* plug-in */ -static MailerPlugin * _notes_init(MailerPluginHelper * helper); -static void _notes_destroy(NotesPlugin * notes); -static GtkWidget * _notes_get_widget(NotesPlugin * notes); - - -/* public */ -/* variables */ -/* plug-in */ -MailerPluginDefinition plugin = -{ - "Notes", - "notes", - NULL, - _notes_init, - _notes_destroy, - _notes_get_widget, - NULL -}; - - -/* protected */ -/* functions */ -/* plug-in */ -/* notes_init */ -static MailerPlugin * _notes_init(MailerPluginHelper * helper) -{ - NotesPlugin * notes; - GtkWidget * widget; - GtkTreeViewColumn * column; - size_t i; - - if((notes = malloc(sizeof(*notes))) == NULL) - return NULL; - if((notes->notes = notes_new(NULL, NULL)) == NULL) - { - _notes_destroy(notes); - return NULL; - } - notes->helper = helper; - notes->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); - widget = notes_get_widget(notes->notes); - gtk_box_pack_start(GTK_BOX(notes->widget), widget, TRUE, TRUE, 0); - widget = notes_get_view(notes->notes); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(widget), FALSE); - for(i = 0; i < ND_COL_COUNT; i++) - if((column = notes_get_view_column(notes->notes, i)) == NULL) - continue; - else if(i != ND_COL_TITLE) - gtk_tree_view_column_set_visible(column, FALSE); - gtk_widget_show_all(notes->widget); - return notes; -} - - -/* notes_destroy */ -static void _notes_destroy(NotesPlugin * notes) -{ - if(notes->notes != NULL) - notes_delete(notes->notes); - free(notes); -} - - -/* notes_get_widget */ -static GtkWidget * _notes_get_widget(NotesPlugin * notes) -{ - return notes->widget; -} diff --git a/tools/project.conf b/tools/project.conf deleted file mode 100644 index ce05bef..0000000 --- a/tools/project.conf +++ /dev/null @@ -1,18 +0,0 @@ -targets=notes -cppflags=-I../include -cflags_force=`pkg-config --cflags libDesktop Mailer` -fPIC -cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -ldflags_force=`pkg-config --libs libDesktop` -ldflags=-Wl,-z,relro -Wl,-z,now -dist=Makefile - -#targets -[notes] -type=plugin -sources=notes.c -ldflags=-L../src -Wl,-rpath,$(LIBDIR) -lNotes -install=$(LIBDIR)/Mailer/plugins - -#sources -[notes.c] -depends=../src/note.c,../src/noteedit.c,../src/notes.c