Commit 849ff785 authored by Tobias Bernard's avatar Tobias Bernard

[rename] change app to teleport everywhere

parent c274a8b0
...@@ -4,25 +4,25 @@ CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0) ...@@ -4,25 +4,25 @@ CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0) LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
SRC = paperplaneapp.c paperplaneappwin.c main.c SRC = teleportapp.c teleportappwin.c main.c
BUILT_SRC = resources.c BUILT_SRC = resources.c
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o) OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
all: paperplaneapp all: teleportapp
resources.c: paperplaneapp.gresource.xml window.ui resources.c: teleportapp.gresource.xml window.ui
$(GLIB_COMPILE_RESOURCES) paperplaneapp.gresource.xml --target=$@ --sourcedir=. --generate-source $(GLIB_COMPILE_RESOURCES) teleportapp.gresource.xml --target=$@ --sourcedir=. --generate-source
%.o: %.c %.o: %.c
$(CC) -c -o $(@F) $(CFLAGS) $< $(CC) -c -o $(@F) $(CFLAGS) $<
paperplaneapp: $(OBJS) teleportapp: $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS) $(CC) -o $(@F) $(OBJS) $(LIBS)
clean: clean:
rm -f $(BUILT_SRC) rm -f $(BUILT_SRC)
rm -f $(OBJS) rm -f $(OBJS)
rm -f paperplaneapp rm -f teleportapp
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.8 --> <!-- interface-requires gtk+ 3.8 -->
<template class="PaperplaneAppWindow" parent="GtkApplicationWindow"> <template class="TeleportAppWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Example Application</property> <property name="title" translatable="yes">Example Application</property>
<property name="default_width">600</property> <property name="default_width">600</property>
<property name="default_height">400</property> <property name="default_height">400</property>
......
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "paperplaneapp.h" #include "teleportapp.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
return g_application_run (G_APPLICATION (paperplane_app_new ()), argc, argv); return g_application_run (G_APPLICATION (teleport_app_new ()), argc, argv);
} }
File added
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist> <schemalist>
<schema path="/org/gtk/paperplaneapp/" id="org.gtk.paperplaneapp"> <schema path="/org/gtk/teleportapp/" id="org.gtk.teleportapp">
<key name="font" type="s"> <key name="font" type="s">
<default>'Monospace 12'</default> <default>'Monospace 12'</default>
<summary>Font</summary> <summary>Font</summary>
......
#ifndef __PAPERPLANEAPP_H
#define __PAPERPLANEAPP_H
#include <gtk/gtk.h>
#define PAPERPLANE_APP_TYPE (paperplane_app_get_type ())
G_DECLARE_FINAL_TYPE (PaperplaneApp, paperplane_app, PAPERPLANE, APP, GtkApplication)
PaperplaneApp *paperplane_app_new (void);
#endif /* __PAPERPLANEAPP_H */
#ifndef __PAPERPLANEAPPWIN_H
#define __PAPERPLANEAPPWIN_H
#include <gtk/gtk.h>
#include "paperplaneapp.h"
#define PAPERPLANE_APP_WINDOW_TYPE (paperplane_app_window_get_type ())
G_DECLARE_FINAL_TYPE (PaperplaneAppWindow, paperplane_app_window, PAPERPLANE, APP_WINDOW, GtkApplicationWindow)
PaperplaneAppWindow *paperplane_app_window_new (PaperplaneApp *app);
void paperplane_app_window_open (PaperplaneAppWindow *win,
GFile *file);
#endif /* __PAPERPLANEAPPWIN_H */
This diff is collapsed.
File added
File added
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "paperplaneapp.h" #include "teleportapp.h"
#include "paperplaneappwin.h" #include "teleportappwin.h"
struct _PaperplaneApp struct _TeleportApp
{ {
GtkApplication parent; GtkApplication parent;
}; };
G_DEFINE_TYPE(PaperplaneApp, paperplane_app, GTK_TYPE_APPLICATION); G_DEFINE_TYPE(TeleportApp, teleport_app, GTK_TYPE_APPLICATION);
static void static void
paperplane_app_init (PaperplaneApp *app) teleport_app_init (TeleportApp *app)
{ {
} }
static void static void
paperplane_app_activate (GApplication *app) teleport_app_activate (GApplication *app)
{ {
PaperplaneAppWindow *win; TeleportAppWindow *win;
win = paperplane_app_window_new (PAPERPLANE_APP (app)); win = teleport_app_window_new (TELEPORT_APP (app));
gtk_window_present (GTK_WINDOW (win)); gtk_window_present (GTK_WINDOW (win));
} }
static void static void
paperplane_app_open (GApplication *app, teleport_app_open (GApplication *app,
GFile **files, GFile **files,
gint n_files, gint n_files,
const gchar *hint) const gchar *hint)
{ {
GList *windows; GList *windows;
PaperplaneAppWindow *win; TeleportAppWindow *win;
int i; int i;
windows = gtk_application_get_windows (GTK_APPLICATION (app)); windows = gtk_application_get_windows (GTK_APPLICATION (app));
if (windows) if (windows)
win = PAPERPLANE_APP_WINDOW (windows->data); win = TELEPORT_APP_WINDOW (windows->data);
else else
win = paperplane_app_window_new (PAPERPLANE_APP (app)); win = teleport_app_window_new (TELEPORT_APP (app));
for (i = 0; i < n_files; i++) for (i = 0; i < n_files; i++)
paperplane_app_window_open (win, files[i]); teleport_app_window_open (win, files[i]);
gtk_window_present (GTK_WINDOW (win)); gtk_window_present (GTK_WINDOW (win));
} }
static void static void
paperplane_app_class_init (PaperplaneAppClass *class) teleport_app_class_init (TeleportAppClass *class)
{ {
G_APPLICATION_CLASS (class)->activate = paperplane_app_activate; G_APPLICATION_CLASS (class)->activate = teleport_app_activate;
G_APPLICATION_CLASS (class)->open = paperplane_app_open; G_APPLICATION_CLASS (class)->open = teleport_app_open;
} }
PaperplaneApp * TeleportApp *
paperplane_app_new (void) teleport_app_new (void)
{ {
return g_object_new (PAPERPLANE_APP_TYPE, return g_object_new (TELEPORT_APP_TYPE,
"application-id", "org.gtk.paperplaneapp", "application-id", "org.gtk.teleportapp",
"flags", G_APPLICATION_HANDLES_OPEN, "flags", G_APPLICATION_HANDLES_OPEN,
NULL); NULL);
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/org/gtk/paperplaneapp"> <gresource prefix="/org/gtk/teleportapp">
<file preprocess="xml-stripblanks">window.ui</file> <file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">settings.ui</file> <file preprocess="xml-stripblanks">settings.ui</file>
</gresource> </gresource>
......
#ifndef __TELEPORTAPP_H
#define __TELEPORTAPP_H
#include <gtk/gtk.h>
#define TELEPORT_APP_TYPE (teleport_app_get_type ())
G_DECLARE_FINAL_TYPE (TeleportApp, teleport_app, TELEPORT, APP, GtkApplication)
TeleportApp *teleport_app_new (void);
#endif /* __TELEPORTAPP_H */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "paperplaneapp.h" #include "teleportapp.h"
#include "paperplaneappwin.h" #include "teleportappwin.h"
struct _PaperplaneAppWindow struct _TeleportAppWindow
{ {
GtkApplicationWindow parent; GtkApplicationWindow parent;
}; };
G_DEFINE_TYPE(PaperplaneAppWindow, paperplane_app_window, GTK_TYPE_APPLICATION_WINDOW); G_DEFINE_TYPE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW);
static void static void
paperplane_app_window_init (PaperplaneAppWindow *win) teleport_app_window_init (TeleportAppWindow *win)
{ {
gtk_widget_init_template (GTK_WIDGET (win)); gtk_widget_init_template (GTK_WIDGET (win));
GtkBuilder *builder; GtkBuilder *builder;
...@@ -20,27 +20,27 @@ paperplane_app_window_init (PaperplaneAppWindow *win) ...@@ -20,27 +20,27 @@ paperplane_app_window_init (PaperplaneAppWindow *win)
gtk_widget_init_template (GTK_WIDGET (win)); gtk_widget_init_template (GTK_WIDGET (win));
builder = gtk_builder_new_from_resource ("/org/gtk/paperplaneapp/settings.ui"); builder = gtk_builder_new_from_resource ("/org/gtk/teleportapp/settings.ui");
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu")); menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
g_object_unref (builder); g_object_unref (builder);
} }
static void static void
paperplane_app_window_class_init (PaperplaneAppWindowClass *class) teleport_app_window_class_init (TeleportAppWindowClass *class)
{ {
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class), gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
"/org/gtk/paperplaneapp/window.ui"); "/org/gtk/teleportapp/window.ui");
} }
PaperplaneAppWindow * TeleportAppWindow *
paperplane_app_window_new (PaperplaneApp *app) teleport_app_window_new (TeleportApp *app)
{ {
return g_object_new (PAPERPLANE_APP_WINDOW_TYPE, "application", app, NULL); return g_object_new (TELEPORT_APP_WINDOW_TYPE, "application", app, NULL);
} }
void void
paperplane_app_window_open (PaperplaneAppWindow *win, teleport_app_window_open (TeleportAppWindow *win,
GFile *file) GFile *file)
{ {
} }
#ifndef __TELEPORTAPPWIN_H
#define __TELEPORTAPPWIN_H
#include <gtk/gtk.h>
#include "teleportapp.h"
#define TELEPORT_APP_WINDOW_TYPE (teleport_app_window_get_type ())
G_DECLARE_FINAL_TYPE (TeleportAppWindow, teleport_app_window, TELEPORT, APP_WINDOW, GtkApplicationWindow)
TeleportAppWindow *teleport_app_window_new (TeleportApp *app);
void teleport_app_window_open (TeleportAppWindow *win,
GFile *file);
#endif /* __TELEPORTAPPWIN_H */
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.8 --> <!-- interface-requires gtk+ 3.8 -->
<template class="PaperplaneAppWindow" parent="GtkApplicationWindow"> <template class="TeleportAppWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Paperplane</property> <property name="title" translatable="yes">Teleport</property>
<property name="default_width">600</property> <property name="default_width">700</property>
<property name="default_height">400</property> <property name="default_height">500</property>
<child> <child>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="lower">-1</property> <property name="lower">-1</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment