[rename] change app to teleport everywhere
This commit is contained in:
12
src/Makefile
12
src/Makefile
@@ -4,25 +4,25 @@ CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.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
|
||||
|
||||
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||
|
||||
all: paperplaneapp
|
||||
all: teleportapp
|
||||
|
||||
resources.c: paperplaneapp.gresource.xml window.ui
|
||||
$(GLIB_COMPILE_RESOURCES) paperplaneapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||
resources.c: teleportapp.gresource.xml window.ui
|
||||
$(GLIB_COMPILE_RESOURCES) teleportapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
paperplaneapp: $(OBJS)
|
||||
teleportapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILT_SRC)
|
||||
rm -f $(OBJS)
|
||||
rm -f paperplaneapp
|
||||
rm -f teleportapp
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- 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="default_width">600</property>
|
||||
<property name="default_height">400</property>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paperplaneapp.h"
|
||||
#include "teleportapp.h"
|
||||
|
||||
int
|
||||
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);
|
||||
}
|
||||
|
||||
BIN
src/main.o
Normal file
BIN
src/main.o
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist>
|
||||
<schema path="/org/gtk/paperplaneapp/" id="org.gtk.paperplaneapp">
|
||||
<schema path="/org/gtk/teleportapp/" id="org.gtk.teleportapp">
|
||||
<key name="font" type="s">
|
||||
<default>'Monospace 12'</default>
|
||||
<summary>Font</summary>
|
||||
@@ -1,63 +0,0 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paperplaneapp.h"
|
||||
#include "paperplaneappwin.h"
|
||||
|
||||
struct _PaperplaneApp
|
||||
{
|
||||
GtkApplication parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(PaperplaneApp, paperplane_app, GTK_TYPE_APPLICATION);
|
||||
|
||||
static void
|
||||
paperplane_app_init (PaperplaneApp *app)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
paperplane_app_activate (GApplication *app)
|
||||
{
|
||||
PaperplaneAppWindow *win;
|
||||
|
||||
win = paperplane_app_window_new (PAPERPLANE_APP (app));
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
paperplane_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
PaperplaneAppWindow *win;
|
||||
int i;
|
||||
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
if (windows)
|
||||
win = PAPERPLANE_APP_WINDOW (windows->data);
|
||||
else
|
||||
win = paperplane_app_window_new (PAPERPLANE_APP (app));
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
paperplane_app_window_open (win, files[i]);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
paperplane_app_class_init (PaperplaneAppClass *class)
|
||||
{
|
||||
G_APPLICATION_CLASS (class)->activate = paperplane_app_activate;
|
||||
G_APPLICATION_CLASS (class)->open = paperplane_app_open;
|
||||
}
|
||||
|
||||
PaperplaneApp *
|
||||
paperplane_app_new (void)
|
||||
{
|
||||
return g_object_new (PAPERPLANE_APP_TYPE,
|
||||
"application-id", "org.gtk.paperplaneapp",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
NULL);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#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 */
|
||||
@@ -1,46 +0,0 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paperplaneapp.h"
|
||||
#include "paperplaneappwin.h"
|
||||
|
||||
struct _PaperplaneAppWindow
|
||||
{
|
||||
GtkApplicationWindow parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(PaperplaneAppWindow, paperplane_app_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
paperplane_app_window_init (PaperplaneAppWindow *win)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *menu;
|
||||
GAction *action;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/paperplaneapp/settings.ui");
|
||||
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
|
||||
g_object_unref (builder);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
paperplane_app_window_class_init (PaperplaneAppWindowClass *class)
|
||||
{
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/paperplaneapp/window.ui");
|
||||
}
|
||||
|
||||
PaperplaneAppWindow *
|
||||
paperplane_app_window_new (PaperplaneApp *app)
|
||||
{
|
||||
return g_object_new (PAPERPLANE_APP_WINDOW_TYPE, "application", app, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
paperplane_app_window_open (PaperplaneAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#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 */
|
||||
3395
src/resources.c
Normal file
3395
src/resources.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/resources.o
Normal file
BIN
src/resources.o
Normal file
Binary file not shown.
BIN
src/teleportapp
Executable file
BIN
src/teleportapp
Executable file
Binary file not shown.
63
src/teleportapp.c
Normal file
63
src/teleportapp.c
Normal file
@@ -0,0 +1,63 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "teleportapp.h"
|
||||
#include "teleportappwin.h"
|
||||
|
||||
struct _TeleportApp
|
||||
{
|
||||
GtkApplication parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(TeleportApp, teleport_app, GTK_TYPE_APPLICATION);
|
||||
|
||||
static void
|
||||
teleport_app_init (TeleportApp *app)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
teleport_app_activate (GApplication *app)
|
||||
{
|
||||
TeleportAppWindow *win;
|
||||
|
||||
win = teleport_app_window_new (TELEPORT_APP (app));
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
teleport_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
TeleportAppWindow *win;
|
||||
int i;
|
||||
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
if (windows)
|
||||
win = TELEPORT_APP_WINDOW (windows->data);
|
||||
else
|
||||
win = teleport_app_window_new (TELEPORT_APP (app));
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
teleport_app_window_open (win, files[i]);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
teleport_app_class_init (TeleportAppClass *class)
|
||||
{
|
||||
G_APPLICATION_CLASS (class)->activate = teleport_app_activate;
|
||||
G_APPLICATION_CLASS (class)->open = teleport_app_open;
|
||||
}
|
||||
|
||||
TeleportApp *
|
||||
teleport_app_new (void)
|
||||
{
|
||||
return g_object_new (TELEPORT_APP_TYPE,
|
||||
"application-id", "org.gtk.teleportapp",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
NULL);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/org/gtk/paperplaneapp">
|
||||
<gresource prefix="/org/gtk/teleportapp">
|
||||
<file preprocess="xml-stripblanks">window.ui</file>
|
||||
<file preprocess="xml-stripblanks">settings.ui</file>
|
||||
</gresource>
|
||||
14
src/teleportapp.h
Normal file
14
src/teleportapp.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#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 */
|
||||
BIN
src/teleportapp.o
Normal file
BIN
src/teleportapp.o
Normal file
Binary file not shown.
46
src/teleportappwin.c
Normal file
46
src/teleportappwin.c
Normal file
@@ -0,0 +1,46 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "teleportapp.h"
|
||||
#include "teleportappwin.h"
|
||||
|
||||
struct _TeleportAppWindow
|
||||
{
|
||||
GtkApplicationWindow parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
teleport_app_window_init (TeleportAppWindow *win)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *menu;
|
||||
GAction *action;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/teleportapp/settings.ui");
|
||||
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
|
||||
g_object_unref (builder);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
teleport_app_window_class_init (TeleportAppWindowClass *class)
|
||||
{
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/teleportapp/window.ui");
|
||||
}
|
||||
|
||||
TeleportAppWindow *
|
||||
teleport_app_window_new (TeleportApp *app)
|
||||
{
|
||||
return g_object_new (TELEPORT_APP_WINDOW_TYPE, "application", app, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
teleport_app_window_open (TeleportAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
}
|
||||
16
src/teleportappwin.h
Normal file
16
src/teleportappwin.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#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 */
|
||||
BIN
src/teleportappwin.o
Normal file
BIN
src/teleportappwin.o
Normal file
Binary file not shown.
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.8 -->
|
||||
<template class="PaperplaneAppWindow" parent="GtkApplicationWindow">
|
||||
<property name="title" translatable="yes">Paperplane</property>
|
||||
<property name="default_width">600</property>
|
||||
<property name="default_height">400</property>
|
||||
<template class="TeleportAppWindow" parent="GtkApplicationWindow">
|
||||
<property name="title" translatable="yes">Teleport</property>
|
||||
<property name="default_width">700</property>
|
||||
<property name="default_height">500</property>
|
||||
<child>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="lower">-1</property>
|
||||
|
||||
Reference in New Issue
Block a user